-
Notifications
You must be signed in to change notification settings - Fork 14
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
#3943 - Bug - restriction view when access limited #3982
#3943 - Bug - restriction view when access limited #3982
Conversation
@@ -160,6 +153,8 @@ export default defineComponent({ | |||
return "Resolution reason is required."; | |||
}; | |||
|
|||
console.info("props.canResolveRestriction: ", props.canResolveRestriction); |
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.
Please remove the console.info.
/> | ||
</template> | ||
</check-permission-role> | ||
<footer-buttons |
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.
Check permission role is required and must not be removed.
</check-permission-role> | ||
<footer-buttons | ||
:processing="processing" | ||
:primaryLabel="allowUserToEdit ? 'Resolve restriction' : 'Close'" |
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.
I would suggest the following quick solution which would keep the primary behavior as primary and secondary behaviour as secondary not having to juggle based on the situation.
Solution
<template #footer>
<check-permission-role :role="allowedRole">
<template #="{ notAllowed }">
<footer-buttons
primaryLabel="Resolve restriction"
:secondaryLabel="allowUserToEdit ? 'Cancel' : 'Close'"
@primaryClick="submit"
@secondaryClick="cancel"
:disablePrimaryButton="notAllowed"
:showPrimaryButton="allowUserToEdit"
/>
</template>
</check-permission-role>
</template>
Note: there is no processing variable so removed :processing="processing"
Result:
View Active Restriction with permission
View resolved restriction with permission
View Resolved restriction without permission
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.
The solution looks great, and we can probably adopt this in other stories. Thanks @dheepak-aot
secondaryLabel="Cancel" | ||
@primaryClick="allowUserToEdit ? submit() : cancel()" | ||
@secondaryClick="cancel" | ||
:showSecondaryButton="allowUserToEdit" |
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.
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.
I agree with this solution, which is adopted in the latest commit.
Please have a look at the comments. |
|
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.
Looks good @lewischen-aot 👍
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.
👍
Screenshot
![image](https://private-user-images.githubusercontent.com/148148914/388701322-455e12e4-8c1d-45a6-82c3-7308a3091275.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5Mjg1MTksIm5iZiI6MTczODkyODIxOSwicGF0aCI6Ii8xNDgxNDg5MTQvMzg4NzAxMzIyLTQ1NWUxMmU0LThjMWQtNDVhNi04MmMzLTczMDhhMzA5MTI3NS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwN1QxMTM2NTlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1kNjc3ODVlZGVmNDQxYjhhNzg0MDRhZWYwMWNlY2Q5MzZlNGM2ZjQwYmYzOThjYjAyMTk0NGM3ZGI1MWYyNjZiJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.KBvrq3utrCr49KXtKeo_B_e_Hg6PZe4Nq-1aZ8bECKA)