Skip to content

Fix/role issues#1029

Merged
sanjaykhondal-aw merged 7 commits intodevelop-nextjsfrom
fix/role-issues
Jun 12, 2025
Merged

Fix/role issues#1029
sanjaykhondal-aw merged 7 commits intodevelop-nextjsfrom
fix/role-issues

Conversation

@sanjaykhondal-aw
Copy link
Contributor

@sanjaykhondal-aw sanjaykhondal-aw commented Jun 11, 2025

WHAT

  • (497) Resolved: Able to create schema with only Issuer and Verifier roles.
  • (499) Resolved: Organization role was not reflecting Verifier access after role update.
  • Fixed incorrect checkbox CSS in the connection list table within the generic table used in verification.
  • In the Attribute table, resolved the issue where the select dropdown in the condition column was missing the placeholder and value.
  • Resolved typescript errors.

Screenshot from 2025-06-11 10-24-16
image
image
image
image


Important

Fixes role-based access, UI inconsistencies, and TypeScript errors across multiple components.

  • Role Management:
    • Fixes role-based access in RoleViewButton.tsx by simplifying role checks for features like CREATE_ORG, ISSUANCE, and VERIFICATION.
    • Ensures organization role updates reflect Verifier access in app-sidebar.tsx.
  • UI Fixes:
    • Corrects checkbox CSS in ConnectionListCells.tsx for the connection list table.
    • Adds missing placeholder and value in the select dropdown of the Attribute table in CommonConstant.ts.
  • TypeScript and Code Quality:
    • Resolves TypeScript errors across multiple files, including SchemasList.tsx and DevelopersSetting.tsx.
    • Fixes typo in enums.ts by renaming CRETAE_ORG to CREATE_ORG.
    • Adds disabled prop to EmptyMessage.tsx for better button control.

This description was created by Ellipsis for 6c70748. You can customize this summary. It will automatically update as commits are pushed.

Signed-off-by: sanjaykhondal-aw <sanjay.khondal@ayanworks.com>
Signed-off-by: sanjaykhondal-aw <sanjay.khondal@ayanworks.com>
Signed-off-by: sanjaykhondal-aw <sanjay.khondal@ayanworks.com>
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Caution

Changes requested ❌

Reviewed everything up to aa4bb3f in 1 minute and 59 seconds. Click for details.
  • Reviewed 702 lines of code in 12 files
  • Skipped 0 files when reviewing.
  • Skipped posting 7 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. nextjs/src/config/CommonConstant.ts:75
  • Draft comment:
    Verify that setting the predicate condition value to 'Select' (instead of an empty string) meets the intended placeholder behavior.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is asking the PR author to verify their intention regarding a specific change. This violates the rule against asking the author to confirm their intention or ensure behavior is intended. The comment does not provide a specific suggestion or ask for a test to be written, which would have been acceptable.
2. nextjs/src/features/verification/components/ConnectionListCells.tsx:54
  • Draft comment:
    The custom checkbox cell uses both a button onClick and a hidden input onChange. Ensure these handlers don’t trigger duplicate events. Consider consolidating the event handling.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.
3. nextjs/src/features/wallet/DidListComponent.tsx:142
  • Draft comment:
    Avoid using window.location.reload() in SPA context; consider using router.refresh() to update the view instead.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
4. nextjs/src/features/wallet/DidListComponent.tsx:407
  • Draft comment:
    Using setPrivateKeyValue(privateKeyValue || privateKey) may prevent state update if privateKeyValue is already truthy. Consider using the new private key directly.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
5. nextjs/src/features/wallet/DidListComponent.tsx:295
  • Draft comment:
    The useEffect calling fetchOrganizationDetails has an empty dependency array. If orgId can change, consider including it in the dependency array.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
6. nextjs/src/components/RoleViewButton.tsx:33
  • Draft comment:
    Typo: 'Features.CRETAE_ORG' should likely be 'Features.CREATE_ORG'.
  • Reason this comment was not posted:
    Marked as duplicate.
7. nextjs/src/features/profile/components/DevelopersSetting.tsx:25
  • Draft comment:
    Typo/lexicographical note: The property name 'organisation' (in the UserOrgRole interface) is spelled using British English, while the 'Organization' interface uses American English. Consider unifying the spelling to improve consistency.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% While the comment is technically correct about the inconsistency, we need to consider if this is actually worth fixing. The inconsistency might be intentional if one matches an API response format. Without knowing the external constraints, changing this could actually break functionality. Additionally, this is a relatively minor issue that doesn't affect functionality. I might be underestimating the value of consistent naming in a codebase. Inconsistent naming can lead to confusion and bugs over time. While consistency is valuable, this particular case seems more likely to be tied to external API constraints, and forcing consistency could cause problems. The risk of breaking changes outweighs the benefit. The comment should be removed. While it points out a real inconsistency, changing it could break API compatibility and the benefit doesn't justify the risk.

Workflow ID: wflow_ZmVyfOiwdCcKWD14

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

const role = useAppSelector((state) => state.organization.orgInfo?.roles[0])
const isRoleAccess = (): boolean => {
switch (feature) {
case Features.CRETAE_ORG:
Copy link
Contributor

Choose a reason for hiding this comment

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

Possible typo: 'CRETAE_ORG' may be intended as 'CREATE_ORG'. Please verify the enum naming.

Suggested change
case Features.CRETAE_ORG:
case Features.CREATE_ORG:

Signed-off-by: sanjaykhondal-aw <sanjay.khondal@ayanworks.com>
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed b0e6364 in 1 minute and 37 seconds. Click for details.
  • Reviewed 26 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. nextjs/src/common/enums.ts:38
  • Draft comment:
    Corrected enum name from CRETAE_ORG to CREATE_ORG ensures consistency. Verify similar constants (e.g., CRETAE_SCHEMA) if needed.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 50% <= threshold 50% The comment acknowledges a correction in the enum name, which is a valid observation. However, it also asks the author to verify similar constants, which is against the rules as it asks for verification. The first part of the comment is useful, but the second part is not allowed.
2. nextjs/src/components/RoleViewButton.tsx:32
  • Draft comment:
    Updated switch case to use Features.CREATE_ORG maintains consistency with the enums.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment seems to be purely informative, as it is just stating what was done without providing any actionable feedback or suggestions. It doesn't ask for confirmation or suggest any changes.
3. nextjs/src/common/enums.ts:40
  • Draft comment:
    Typo: 'CRETAE_SCHEMA' appears to be misspelled. Consider renaming it to 'CREATE_SCHEMA' for consistency and clarity.
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_k0JqFsWI3wfHjrGW

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Signed-off-by: sanjaykhondal-aw <sanjay.khondal@ayanworks.com>
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Caution

Changes requested ❌

Reviewed 936a3ee in 1 minute and 42 seconds. Click for details.
  • Reviewed 20 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. nextjs/src/features/dashboard/components/SchemasList.tsx:255
  • Draft comment:
    Disabled buttons may not trigger onClick, so tooltip feedback (set in handleCreateSchemaClick) won’t display. Consider a wrapper or alternative event (e.g. onMouseEnter) for showing the tooltip when disabled.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% The comment raises a valid technical point - disabled buttons often don't trigger click events. However, looking at the code structure, the tooltip is actually controlled by a separate TooltipTrigger wrapper component from a UI library, not directly by the onClick handler. The tooltip appears to be using a controlled 'open' prop (showTooltip state), which suggests it works independently of button clicks. I could be wrong about how the TooltipTrigger component works internally. Maybe it does rely on button events propagating. Even if I'm uncertain about the internal tooltip implementation, the code shows the tooltip state is controlled externally via the 'open' prop, which suggests it should work regardless of button state. The comment should be deleted as it appears to misunderstand how the tooltip is implemented in this case - it's controlled via state rather than click events.

Workflow ID: wflow_P9HpLIo84cKJ9l6U

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

<Button onClick={handleCreateSchemaClick}>
<Button
onClick={handleCreateSchemaClick}
disabled={
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider extracting the permission check (orgId, walletExists, role check) into a shared variable to avoid duplicating logic in both the disabled prop and handleCreateSchemaClick.

Signed-off-by: sanjaykhondal-aw <sanjay.khondal@ayanworks.com>
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed 6c70748 in 37 seconds. Click for details.
  • Reviewed 12 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. nextjs/src/features/schemas/components/SchemaList.tsx:86
  • Draft comment:
    Removed outdated commented state initialization. Using the properly typed useState<ISchemaData[]>([]) improves code clarity.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None

Workflow ID: wflow_GkDSiHXSRWZLhRMi

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@sonarqubecloud
Copy link

@sanjaykhondal-aw sanjaykhondal-aw merged commit 2ffd442 into develop-nextjs Jun 12, 2025
4 of 5 checks passed
@pranalidhanavade pranalidhanavade deleted the fix/role-issues branch September 19, 2025 04:26
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.

2 participants