-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add public toggle to permissions modal #144
Conversation
<h3 class="pb-1">Public</h3> | ||
<ul> | ||
<li>This option toggles the file to be publicly available and accessible to anyone</li> | ||
<li>To instead set explicit permissions, add users and use the options below</li> |
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.
Maybe this?
To set explicit permission instead, add users and use the options below
Or this for a more active tone
Add users and use the options below to set explicit permissions instead
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 went with the wording in the screenshots in the original user research ticket (SHOWCASE-3331). Might want to check in with Tyler on that one.
<div class="ml-4"> | ||
<ObjectPublicToggle | ||
v-if="object && getUserId" |
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.
Do we need the extra div levels or can this still work with the class applied to the ObjectPublicToggle component directly?
<div class="mt-1 mb-2"> | ||
<h3>User Permissions</h3> | ||
</div> |
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.
Might be able to get away with just an h3 with class attribute and not require the div wrapper?
frontend/src/assets/primevue.scss
Outdated
.p-dropdown.usersearch { | ||
width: 100% !important | ||
} |
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.
Unnecessary. You can use locally scoped css in SearchUsers.vue.
@@ -208,6 +208,8 @@ export const useObjectStore = defineStore('object', () => { | |||
try { | |||
appStore.beginIndeterminateLoading(); | |||
await objectService.togglePublic(objectId, isPublic); | |||
const obj = findObjectById(objectId); | |||
if (obj) obj.public = isPublic; |
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.
Are these two new lines doing anything?
was the intention to update the store. eg: if (obj) state.objects.value.find((x) => x.id === objectId).public = isPublic
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.
Yes we need to update the store here so the new value is reflected elsewhere. Would prefer to leave this using findObjectById() in the event we change up how we are looking up objects. Less things to track down and update.
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.
oh ok. i didnt know you could update the store like this
The updated dropdown hint is longer than before, so it doesn't fully display. The dropdown was therefore widened so that it shows the entire hint, filling the whitespace between it and the "Add" button.
Added "User Permissions" heading in the permissions modal, right above the "Add user" button. Also: tweak spacing for "Public" heading and corresponding toggle
In 60c2bad, the user search dropdown was widened to fill the width of the modal - this was achieved using !important in the Primevue stylesheet. This has been moved to a locally scoped style inside SearchUsers.vue instead, eliminating the need for !important.
643fc3d
to
f692250
Compare
Description
This PR makes the following UX improvements to the object permissions modal, as originally identified in SHOWCASE-3331:
A bugfix on
/app/.gitignore
incorrectly ignoringpackage-lock.json
(unrelated to the Jira ticket) has also been slipstreamed in.https://apps.nrs.gov.bc.ca/int/jira/browse/SHOWCASE-3366
Types of changes
Bug fix (non-breaking change which fixes an issue)
New feature (non-breaking change which adds functionality)
Checklist
Further comments
Screenshots
Object permissions modal:
Object permissions modal, after clicking "Add user":