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

[ACS-6278] - stop showing 'edit aspects' and 'manage rules' when node is a smart folder #3512

Conversation

dominikiwanekhyland
Copy link
Contributor

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce? (check one with "x")

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation
  • Other... Please describe:

What is the current behaviour? (You can also link to an open issue here)
When node is a smart folder and user right clicks on it, there are 'manage rules' and 'edit aspects' visible.

What is the new behaviour?
Those options are not available for smart folders.

Does this PR introduce a breaking change? (check one with "x")

  • Yes
  • No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:

projects/aca-shared/rules/src/app.rules.ts Outdated Show resolved Hide resolved
projects/aca-shared/rules/src/app.rules.ts Outdated Show resolved Hide resolved
@@ -624,3 +626,19 @@ export function canOpenWithOffice(context: AcaRuleContext): boolean {

return context.permissions.check(file, ['update']);
}

function isSmartFolder(context: RuleContext): boolean {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should use AcaRuleContext otherwise this rule won't be reusable in ADW as far as I remember

Copy link
Contributor Author

Choose a reason for hiding this comment

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

isSmartFolder has parameter with RuleContext, because canEditAspects and canManagePermissions also have that. In ADW there is imported for example:
export const canEditAspects = (context: RuleContext)
so I think it would be fine if I just leave it like that?

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay fine for me

@dominikiwanekhyland dominikiwanekhyland force-pushed the ACS-6278-permissions-manager-should-not-be-showed-for-smart-folder branch from 5ad5fe3 to 6c55b94 Compare November 9, 2023 06:29
Copy link

sonarqubecloud bot commented Nov 9, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@dominikiwanekhyland dominikiwanekhyland merged commit b5d561d into develop Nov 9, 2023
30 checks passed
@dominikiwanekhyland dominikiwanekhyland deleted the ACS-6278-permissions-manager-should-not-be-showed-for-smart-folder branch November 9, 2023 08:30
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.

3 participants