Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finalise application process #618

Merged
merged 13 commits into from
Aug 12, 2024
Merged

Finalise application process #618

merged 13 commits into from
Aug 12, 2024

Conversation

kdmnk
Copy link
Contributor

@kdmnk kdmnk commented Aug 8, 2024

This PR implements the missing finalise applications feature.

It's on a new page now where the final names and statistics can be seen.
It is also possible to change who has been admitted as resident or extern.

@kdmnk kdmnk requested a review from a team as a code owner August 8, 2024 10:07
Copy link
Contributor

coderabbitai bot commented Aug 8, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

Walkthrough

The recent changes significantly enhance the functionality of the admission management system. Key improvements include the introduction of the indexFinalize method for reviewing both admitted and not admitted applications, a comprehensive overhaul of the finalize method, and modifications to the Blade template that streamline user interactions. These updates optimise database interactions and provide clearer management of application statuses, ultimately improving the overall workflow.

Changes

File Change Summary
app/Http/Controllers/Auth/AdmissionController.php Introduced indexFinalize method for viewing applications; completely restructured finalize method for improved processing, including soft deletes and status updates.
app/Models/Application.php Enhanced model with new boolean properties for residency status, added soft delete capability, and introduced methods for managing admitted workshop data.
resources/views/auth/admission/index.blade.php Removed the inline finalisation form; added a link to a separate page for viewing the finalisation process, thereby streamlining user interaction.
routes/web.php Added a new GET route for accessing the indexFinalize method, enhancing the admission process handling.

Sequence Diagram(s)

sequenceDiagram
    participant Admin
    participant Controller as AdmissionController
    participant View as Finalization View
    participant Model as Application Model
    participant Database

    Admin->>Controller: Access /admission/finalize
    Controller->>Model: Fetch admitted and not admitted applications
    Model-->>Controller: Return applications data
    Controller->>View: Render finalization view with applications
    View->>Admin: Display applications for finalization
    Admin->>View: Submit finalization form
    View->>Controller: POST finalize data
    Controller->>Model: Update application statuses
    Model->>Database: Soft delete not admitted applications
    Database-->>Model: Confirm updates
    Controller-->>View: Return success message
    View->>Admin: Display success notification
Loading

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

This commit fixes the style issues introduced in dbf0da7 according to the output
from PHP CS Fixer.

Details: #618
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Outside diff range, codebase verification and nitpick comments (2)
resources/views/auth/application/role_status_update_component.blade.php (1)

1-17: Consider improving accessibility and semantics.

The current HTML structure lacks semantic tags and accessibility attributes. Consider using more semantic HTML elements and adding ARIA roles or labels for better accessibility.

- <div style="display: flex;flex-direction: column;align-items: center;justify-content: center;">
+ <section style="display: flex;flex-direction: column;align-items: center;justify-content: center;" role="region" aria-label="Role Status Update">
app/Livewire/ApplicationRoleStatusUpdate.php (1)

40-43: Clarify the purpose of the updated property.

The getUpdatedProperty method determines if the lastUpdated time is within the last two seconds. Ensure this logic is necessary and correctly implemented.

Consider renaming the method to isRecentlyUpdated for clarity.

- public function getUpdatedProperty()
+ public function isRecentlyUpdated()

->with('application')
->whereIn('id', $not_admitted->pluck('user_id'))
//ignore users with any existing role
->whereDoesntHave('roles')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: At the moment, even newly registered applicants get the printer role by default, so I don't think this will end up deleting anybody as-is. (last year's applicants are still present in the users table too)

$user->roles()->attach(Role::get(Role::PRINTER)->id);

Probably easier to jump into the database and fix this manually, rather than changing the code here to handle this quirk.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, true... But this won't be the case after #394 has been merged.
But even before that we can just delete that role.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree; we don't need the printer role. No one can print without paying for admins before, anyway.

Copy link
Contributor

@viktorcsimma viktorcsimma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, a seeded applicant did not get workshops nor educational information; is this specific to seeded users or a general problem? I think at least workshops should not be a problem.

app/Http/Controllers/Auth/AdmissionController.php Outdated Show resolved Hide resolved
app/Http/Controllers/Auth/AdmissionController.php Outdated Show resolved Hide resolved
app/Http/Controllers/Auth/AdmissionController.php Outdated Show resolved Hide resolved
@BertalanD
Copy link
Member

@coderabbitai review

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

kdmnk and others added 2 commits August 9, 2024 11:44
This commit fixes the style issues introduced in f33f2f2 according to the output
from PHP CS Fixer.

Details: #618
Copy link
Contributor

@viktorcsimma viktorcsimma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now:) one more small change and we can go ahead, I think.

resources/views/auth/admission/index.blade.php Outdated Show resolved Hide resolved
@viktorcsimma
Copy link
Contributor

@coderabbitai review

@kdmnk kdmnk merged commit de56424 into development Aug 12, 2024
6 checks passed
@kdmnk kdmnk deleted the finalise-applications branch August 12, 2024 08:58
@kdmnk kdmnk linked an issue Aug 12, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make the secretary able to handle some changes to submitted applications
4 participants