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

Delano/28 client dashboard #81

Merged
merged 25 commits into from
Mar 19, 2024
Merged

Delano/28 client dashboard #81

merged 25 commits into from
Mar 19, 2024

Conversation

van
Copy link
Collaborator

@van van commented Mar 16, 2024

Type

Enhancement, Documentation


Description

  • Added dashboard screen showing list of past requests
  • Added RequestList and RequestDetails components to view requests
  • Updated dashboard sidebar links and layout
  • Added DeliveryInfoForm component for client address and delivery branch
  • Added PetsForm component to display pet info
  • Updated RequestList to use Tailwind CSS classes
  • Removed unused dashboard data table code

Changes walkthrough

Relevant files
Configuration changes
settings.py
Configure DRF Spectacular and CORS settings                           

apps/api/afb/settings.py
["Added 'staging.afb.pet' to the ALLOWED_HOSTS and CORS_ALLOWED_ORIGINS settings", "Added 'drf_spectacular' and 'drf_spectacular_sidecar' to the INSTALLED_APPS", 'Configured the DEFAULT_SCHEMA_CLASS setting for the DRF Spectacular package']

+19/-0   

PR-Agent usage:
Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

delano added 24 commits March 6, 2024 12:13
- Add dashboard screen showing list of past requests
- Add RequestList and RequestDetails components to view requests
- Update dashboard sidebar links and layout
* Add DeliveryInfoForm component for client address and delivery branch
* Add PetsForm component to display pet info
* Update RequestList to use Tailwind CSS classes
* Remove unused dashboard data table code
* Disable profile edit features to simplify UI
* Update profile and pets pages to use new form components
* Make UI changes for mobile/desktop
- Adds Hero section with image, title, description and call to action buttons
- Updates navbar with sign in button color change
- Adds footer links
- Shows dialog modal on mobile
- Add links from current animalfoodbank.org
- Add newsletter subscription
- Adjust text and background colors in forms and tables to be visible in dark mode
- Improve pet details form description
Using useSeoMeta composable in app.vue, about.vue, clients.vue, index.vue, login/index.vue, login/magic.vue, and profile.vue
- Fetch request data from mock API on route change
- Populate request details component with route request data
- Add helper text for users creating first request
- Remove unused imports
The footer email subscription input icon was changed from an envelope to a paw print to better match the theme of the newsletter. Additionally, the Phosphor icon pack was added to the Nuxt config icons array to enable use of the paw print icon across the app UI.
- Add branch location dropdown with predefined options
- Validate branch selection on submit
- Support custom icon props in section component
- Update relevant layouts and forms

Additional context:
- Improving request workflows
- Standardizing components
- Upgrade @nuxt/fonts to 0.0.2
- Add @vitejs/plugin-vue dependency
- Upgrade nuxt-og-image for optimizing images
- Update other dependencies including pinia, vue-tsc and typescript
Includes the optional drf-spectacular[sidecar] so
we can avoid loading Swagger UI via 3rd party CDN.
- Rename `first_name` to `preferred_name` in Profile model
- Remove `last_name` field from Profile model
- Make `address` and `address_verbatim` fields nullable by adding `null=True`
- Add separate `first_name` and `last_name` fields to User model for compatibility
- Update `__str__` method on Profile model to use `preferred_name`
- Add OpenAPI schema definition
Copy link

joshua-keaton bot commented Mar 18, 2024

PR Description updated to latest commit (d098eb9)

Copy link

joshua-keaton bot commented Mar 18, 2024

PR Review

(Review updated until commit d098eb9)

⏱️ Estimated effort to review [1-5]

4, due to the extensive changes across multiple files and technologies (Python, Vue, JavaScript, TypeScript, CSS), including updates to dependencies, addition of new components, and configuration changes. The review requires a thorough understanding of the project's architecture and the implications of the updates on the overall functionality.

🧪 Relevant tests

No

🔍 Possible issues

Possible Bug: The onSubmit function in apps/ui/components/PetsForm.vue and apps/ui/components/DeliveryInfoForm.vue only logs the event data to the console and shows a toast notification. It doesn't seem to actually submit the data to the backend or perform any meaningful action.

Performance Concern: The removal of first_name and last_name fields in favor of a single preferred_name field in the Profile model may affect existing data and functionalities that rely on these fields.

Compatibility Issue: The onSubmit function in various forms does not include any form of input validation or sanitization, potentially opening up to injection attacks or unintended data submission.

🔒 Security concerns

No

Code feedback:
relevant fileapps/ui/package.json
suggestion      

Consider adding tests for the new features and updates introduced in this PR to ensure they work as expected and do not break existing functionality. [important]

relevant line"shikiji": "^0.10.2",

relevant fileapps/ui/package.json
suggestion      

Review the necessity of each newly added dependency to avoid bloating the application. If a library is only used in a specific component, consider dynamically importing it to reduce the initial load time. [important]

relevant line"svelte": "^4.2.12",

relevant fileapps/ui/nuxt.config.ts
suggestion      

Ensure that the TypeScript and Vue updates are compatible with the rest of your project. It might be necessary to adjust some type definitions or Vue component options. Testing and linting will help catch any issues. [important]

relevant linetypescript: "^5.4.2",

relevant fileapps/api/requirements.txt
suggestion      

Given the removal of fs-extra and jsonfile in some places, verify that no part of the application relies on these packages or provide alternatives where necessary. [important]

relevant line- "fs-extra==9.1.0",


✨ Review tool usage guide:

Overview:
The review tool scans the PR code changes, and generates a PR review. The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.
When commenting, to edit configurations related to the review tool (pr_reviewer section), use the following template:

/review --pr_reviewer.some_config1=... --pr_reviewer.some_config2=...

With a configuration file, use the following template:

[pr_reviewer]
some_config1=...
some_config2=...
Utilizing extra instructions

The review tool can be configured with extra instructions, which can be used to guide the model to a feedback tailored to the needs of your project.

Be specific, clear, and concise in the instructions. With extra instructions, you are the prompter. Specify the relevant sub-tool, and the relevant aspects of the PR that you want to emphasize.

Examples for extra instructions:

[pr_reviewer] # /review #
extra_instructions="""
In the 'possible issues' section, emphasize the following:
- Does the code logic cover relevant edge cases?
- Is the code logic clear and easy to understand?
- Is the code logic efficient?
...
"""

Use triple quotes to write multi-line instructions. Use bullet points to make the instructions more readable.

How to enable\disable automation
  • When you first install PR-Agent app, the default mode for the review tool is:
pr_commands = ["/review", ...]

meaning the review tool will run automatically on every PR, with the default configuration.
Edit this field to enable/disable the tool, or to change the used configurations

Auto-labels

The review tool can auto-generate two specific types of labels for a PR:

  • a possible security issue label, that detects possible security issues (enable_review_labels_security flag)
  • a Review effort [1-5]: x label, where x is the estimated effort to review the PR (enable_review_labels_effort flag)
Extra sub-tools

The review tool provides a collection of possible feedbacks about a PR.
It is recommended to review the possible options, and choose the ones relevant for your use case.
Some of the feature that are disabled by default are quite useful, and should be considered for enabling. For example:
require_score_review, require_soc2_ticket, require_can_be_split_review, and more.

Auto-approve PRs

By invoking:

/review auto_approve

The tool will automatically approve the PR, and add a comment with the approval.

To ensure safety, the auto-approval feature is disabled by default. To enable auto-approval, you need to actively set in a pre-defined configuration file the following:

[pr_reviewer]
enable_auto_approval = true

(this specific flag cannot be set with a command line argument, only in the configuration file, committed to the repository)

You can also enable auto-approval only if the PR meets certain requirements, such as that the estimated_review_effort is equal or below a certain threshold, by adjusting the flag:

[pr_reviewer]
maximal_review_effort = 5
More PR-Agent commands

To invoke the PR-Agent, add a comment using one of the following commands:

  • /review: Request a review of your Pull Request.
  • /describe: Update the PR title and description based on the contents of the PR.
  • /improve [--extended]: Suggest code improvements. Extended mode provides a higher quality feedback.
  • /ask <QUESTION>: Ask a question about the PR.
  • /update_changelog: Update the changelog based on the PR's contents.
  • /add_docs 💎: Generate docstring for new components introduced in the PR.
  • /generate_labels 💎: Generate labels for the PR based on the PR's contents.
  • /analyze 💎: Automatically analyzes the PR, and presents changes walkthrough for each component.

See the tools guide for more details.
To list the possible configuration parameters, add a /config comment.

See the review usage page for a comprehensive guide on using this tool.

Copy link

joshua-keaton bot commented Mar 18, 2024

Persistent review updated to latest commit d098eb9

Copy link

van bot commented Mar 18, 2024

Persistent review updated to latest commit d098eb9

Copy link

van bot commented Mar 18, 2024

PR Review

⏱️ Estimated effort to review [1-5]

3, because the PR includes a significant number of changes across multiple files, including configuration updates, model changes, and new UI components. While the changes seem well-organized, the overall scope and complexity of the PR will require a moderate amount of time and effort to review thoroughly.

🧪 Relevant tests

No

🔍 Possible issues

No

🔒 Security concerns

No

Code feedback:
relevant fileapps/ui/components/DeliveryInfoForm.vue
suggestion      

Consider adding a validation rule to ensure the 'branch_selection' field is not empty. This will help provide a better user experience and ensure the form is properly filled out. [important]

relevant lineif (!state.branch_selection) errors.push({ path: 'branch_selection', message: 'Please doublecheck branch location.' })

relevant fileapps/ui/components/RequestList.vue
relevant line


✨ Review tool usage guide:

Overview:
The review tool scans the PR code changes, and generates a PR review. The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.
When commenting, to edit configurations related to the review tool (pr_reviewer section), use the following template:

/review --pr_reviewer.some_config1=... --pr_reviewer.some_config2=...

With a configuration file, use the following template:

[pr_reviewer]
some_config1=...
some_config2=...
Utilizing extra instructions

The review tool can be configured with extra instructions, which can be used to guide the model to a feedback tailored to the needs of your project.

Be specific, clear, and concise in the instructions. With extra instructions, you are the prompter. Specify the relevant sub-tool, and the relevant aspects of the PR that you want to emphasize.

Examples for extra instructions:

[pr_reviewer] # /review #
extra_instructions="""
In the 'possible issues' section, emphasize the following:
- Does the code logic cover relevant edge cases?
- Is the code logic clear and easy to understand?
- Is the code logic efficient?
...
"""

Use triple quotes to write multi-line instructions. Use bullet points to make the instructions more readable.

How to enable\disable automation
  • When you first install PR-Agent app, the default mode for the review tool is:
pr_commands = ["/review", ...]

meaning the review tool will run automatically on every PR, with the default configuration.
Edit this field to enable/disable the tool, or to change the used configurations

Auto-labels

The review tool can auto-generate two specific types of labels for a PR:

  • a possible security issue label, that detects possible security issues (enable_review_labels_security flag)
  • a Review effort [1-5]: x label, where x is the estimated effort to review the PR (enable_review_labels_effort flag)
Extra sub-tools

The review tool provides a collection of possible feedbacks about a PR.
It is recommended to review the possible options, and choose the ones relevant for your use case.
Some of the feature that are disabled by default are quite useful, and should be considered for enabling. For example:
require_score_review, require_soc2_ticket, require_can_be_split_review, and more.

Auto-approve PRs

By invoking:

/review auto_approve

The tool will automatically approve the PR, and add a comment with the approval.

To ensure safety, the auto-approval feature is disabled by default. To enable auto-approval, you need to actively set in a pre-defined configuration file the following:

[pr_reviewer]
enable_auto_approval = true

(this specific flag cannot be set with a command line argument, only in the configuration file, committed to the repository)

You can also enable auto-approval only if the PR meets certain requirements, such as that the estimated_review_effort is equal or below a certain threshold, by adjusting the flag:

[pr_reviewer]
maximal_review_effort = 5
More PR-Agent commands

To invoke the PR-Agent, add a comment using one of the following commands:

  • /review: Request a review of your Pull Request.
  • /describe: Update the PR title and description based on the contents of the PR.
  • /improve [--extended]: Suggest code improvements. Extended mode provides a higher quality feedback.
  • /ask <QUESTION>: Ask a question about the PR.
  • /update_changelog: Update the changelog based on the PR's contents.
  • /add_docs 💎: Generate docstring for new components introduced in the PR.
  • /generate_labels 💎: Generate labels for the PR based on the PR's contents.
  • /analyze 💎: Automatically analyzes the PR, and presents changes walkthrough for each component.

See the tools guide for more details.
To list the possible configuration parameters, add a /config comment.

See the review usage page for a comprehensive guide on using this tool.

@AnimalFoodBank AnimalFoodBank deleted a comment from van bot Mar 18, 2024
@AnimalFoodBank AnimalFoodBank deleted a comment from van bot Mar 18, 2024
@AnimalFoodBank AnimalFoodBank deleted a comment from van bot Mar 18, 2024
@AnimalFoodBank AnimalFoodBank deleted a comment from van bot Mar 18, 2024
@AnimalFoodBank AnimalFoodBank deleted a comment from van bot Mar 18, 2024
Copy link

van bot commented Mar 18, 2024

Preparing PR description...

@AnimalFoodBank AnimalFoodBank deleted a comment from van bot Mar 19, 2024
@delano delano marked this pull request as ready for review March 19, 2024 16:02
@AnimalFoodBank AnimalFoodBank deleted a comment from van bot Mar 19, 2024
@AnimalFoodBank AnimalFoodBank deleted a comment from van bot Mar 19, 2024
@AnimalFoodBank AnimalFoodBank deleted a comment from van bot Mar 19, 2024
Signed-off-by: Delano <1206+delano@users.noreply.github.com>
@delano delano merged commit e181c9a into main Mar 19, 2024
0 of 2 checks passed
@delano delano deleted the delano/28-client-dashboard branch March 19, 2024 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants