-
Notifications
You must be signed in to change notification settings - Fork 61
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
fix(service-portal): sp list submitted #16383
Conversation
WalkthroughThis pull request introduces new localized messages for the signature collection feature in both the admin and service portals. It modifies the Changes
Possibly related PRs
Suggested reviewers
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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 using PR comments)
Other keywords and placeholders
Documentation and Community
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #16383 +/- ##
=======================================
Coverage 36.75% 36.75%
=======================================
Files 6804 6804
Lines 140875 140875
Branches 40134 40134
=======================================
Hits 51782 51782
Misses 89093 89093
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Sentry.
|
Datadog ReportAll test runs ✅ 5 Total Test Services: 0 Failed, 4 Passed Test Services
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (3)
libs/service-portal/signature-collection/src/screens/Parliamentary/OwnerView/index.tsx (1)
109-175
: LGTM! Consider extracting complex props for improved readability.The changes to the
ActionCard
component effectively implement conditional rendering based on thelist.active
state, enhancing the component's flexibility and user experience. The use of TypeScript and localization functions is consistent with best practices.To further improve code readability and maintainability, consider extracting the complex
cta
andtag
props into separate functions or variables. This would make the JSX more concise and easier to understand at a glance.Here's a suggested refactoring:
const getCta = (list: SignatureCollectionList) => { if (!list.active) return undefined; return { label: formatMessage(m.viewList), variant: 'text', icon: 'arrowForward', onClick: () => { const path = location.pathname.includes('fyrirtaeki') ? SignatureCollectionPaths.CompanyViewParliamentaryList : SignatureCollectionPaths.ViewParliamentaryList navigate(path.replace(':id', list.id), { state: { collectionId: currentCollection?.id || '', }, }) }, }; }; const getTag = (list: SignatureCollectionList) => { if (!list.active) { return { label: formatMessage(m.listSubmitted), variant: 'blueberry', }; } return { label: 'Cancel collection', renderTag: () => ( <DialogPrompt // ... (rest of the DialogPrompt props) /> ), }; }; // In the JSX: <ActionCard // ... other props cta={getCta(list)} tag={getTag(list)} />This refactoring would make the component more readable while maintaining the same functionality.
libs/service-portal/signature-collection/src/lib/messages.ts (1)
112-116
: LGTM! Consider adding a description for clarity.The new
listSubmitted
message entry follows the existing conventions and structure. It adheres to the coding guidelines for files in thelibs
directory by supporting reusability and using TypeScript.Consider adding a brief description to provide context for translators:
listSubmitted: { id: 'sp.signatureCollection:listSubmitted', defaultMessage: 'Lista skilað', - description: '', + description: 'Message displayed when a list has been submitted', },libs/portals/admin/signature-collection/src/lib/messages.ts (1)
471-476
: LGTM! Consider adding a description for translators.The new
lockListDescription
message is well-formatted and consistent with the existing code. It's correctly placed among other lock-related messages.Consider adding a brief description to provide context for translators:
lockListDescription: { id: 'admin-portal.signature-collection:lockListDescription', defaultMessage: 'Ýtið hér ef framboð hefur skilað inn framboðsgögnum fyrir lok framboðsfrest', - description: '', + description: 'Prompt to lock the list when nomination papers are submitted before the deadline', },
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (4)
- libs/portals/admin/signature-collection/src/lib/messages.ts (1 hunks)
- libs/portals/admin/signature-collection/src/shared-components/completeReview/lockList/index.tsx (1 hunks)
- libs/service-portal/signature-collection/src/lib/messages.ts (1 hunks)
- libs/service-portal/signature-collection/src/screens/Parliamentary/OwnerView/index.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
libs/portals/admin/signature-collection/src/lib/messages.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/portals/admin/signature-collection/src/shared-components/completeReview/lockList/index.tsx (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/service-portal/signature-collection/src/lib/messages.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/service-portal/signature-collection/src/screens/Parliamentary/OwnerView/index.tsx (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
🔇 Additional comments (1)
libs/portals/admin/signature-collection/src/shared-components/completeReview/lockList/index.tsx (1)
59-59
: LGTM! Consider verifying consistency across the application.The change from
m.lockList
tom.lockListDescription
appears to provide a more detailed description in the modal, which likely improves user experience. This modification aligns with the coding guidelines and doesn't affect the component's reusability or structure.To ensure consistency, please verify that this new message key is used appropriately in other parts of the application where a detailed lock list description is needed. Run the following script to check for other occurrences:
This will help ensure that the new
lockListDescription
message is used consistently and that there are no leftover uses oflockList
that should be updated.✅ Verification successful
LGTM! The change correctly updates the message key to
lockListDescription
in the specified file without affecting other parts of the codebase.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for occurrences of lockList and lockListDescription message keys # Search for lockList message key echo "Occurrences of lockList message key:" rg --type typescript "m\.lockList[^D]" ./libs # Search for lockListDescription message key echo "Occurrences of lockListDescription message key:" rg --type typescript "m\.lockListDescription" ./libsLength of output: 360
Script:
#!/bin/bash # Description: Check for occurrences of lockList and lockListDescription message keys in TypeScript files # Search for lockList message key, excluding lockListDescription echo "Occurrences of lockList message key (excluding lockListDescription):" rg --glob '*.ts' --glob '*.tsx' "m\.lockList(?!Description)" ./libs # Search for lockListDescription message key echo "Occurrences of lockListDescription message key:" rg --glob '*.ts' --glob '*.tsx' "m\.lockListDescription" ./libsLength of output: 788
Script:
#!/bin/bash # Description: Check for occurrences of 'm.lockList' excluding 'm.lockListDescription' in TypeScript files # Search for 'm.lockList' message key excluding 'lockListDescription' echo "Occurrences of 'm.lockList' message key (excluding 'm.lockListDescription'):" rg --glob '*.ts' --glob '*.tsx' "m\.lockList" ./libs | grep -v "m\.lockListDescription" # Search for 'm.lockListDescription' message key echo "Occurrences of 'm.lockListDescription' message key:" rg --glob '*.ts' --glob '*.tsx' "m\.lockListDescription" ./libsLength of output: 2050
* fix(service-portal): sp list submitted * tweak * chore: nx format:write update dirty files --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: andes-it <[email protected]>
* fix(service-portal): company route signature collections (#16382) * draft * chore: nx format:write update dirty files * fix: company path * tweaks * p * view list company path * chore: nx format:write update dirty files * nav tweak --------- Co-authored-by: andes-it <[email protected]> Co-authored-by: Ásdís Erna Guðmundsdóttir <[email protected]> * fix(service-portal): sp list submitted (#16383) * fix(service-portal): sp list submitted * tweak * chore: nx format:write update dirty files --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: andes-it <[email protected]> * fix(portals-admin): adding report date (#16384) * fix(portals-admin): adding report date * chore: nx format:write update dirty files * tweak * tweak supervisors info * chore: nx format:write update dirty files * tweak * message - company card * tweak * t * t * chore: nx format:write update dirty files --------- Co-authored-by: andes-it <[email protected]> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> * fix(signature-collection): tweaks 15.10 (#16402) * tweaka * chore: nx format:write update dirty files --------- Co-authored-by: andes-it <[email protected]> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> * fix(signature-collection): Tweaks for parliamentary collection (#16407) * Tweaks for parliamentary collection * revertt' * Update libs/api/domains/signature-collection/src/lib/signatureCollection.service.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * managers should see other managers --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> * fix(signature-collection): Fix paper signatures for candidacy (#16411) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> * fix(signature-collections): ongoing updates (#16409) * tweaks * tweak - create list * copylink * chore: nx format:write update dirty files --------- Co-authored-by: andes-it <[email protected]> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --------- Co-authored-by: albinagu <[email protected]> Co-authored-by: andes-it <[email protected]> Co-authored-by: Ásdís Erna Guðmundsdóttir <[email protected]> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: juni-haukur <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Checklist:
Summary by CodeRabbit
ActionLockList
component to display a more informative message in the modal.OwnerView
component to dynamically show or hide action elements based on the list's active state.