-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat:User CRUD #35
Merged
Merged
feat:User CRUD #35
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1c3c048
feat:User CRUD
d82ba1a
fix:review suggession implemented
05e1ffa
fix:name change to preferred name in the UI
8976934
fix:remove delete option and add is_enable and password length
c2eaabe
fix:user CRUD updated
aeea5dc
feat:Add loading button and User password chamge
8d221f9
fix:password editing permission
bd2cd58
fix:cancel button disable when isLoading
aa2ecd6
fix:users list limited
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
<template> | ||
<v-row> | ||
<v-col> | ||
<v-row> | ||
<v-col> | ||
<v-card> | ||
<v-container fluid> | ||
<v-row> | ||
<v-col> | ||
<ValidationProvider | ||
v-slot="{ errors }" | ||
name="email" | ||
rules="required|email" | ||
> | ||
<v-text-field | ||
v-model.trim="value.email" | ||
:error-messages="errors" | ||
:readonly="!editing" | ||
label="Email" | ||
required | ||
></v-text-field> | ||
</ValidationProvider> | ||
|
||
<ValidationProvider | ||
v-slot="{ errors }" | ||
name="preferred name" | ||
rules="required|min:1|max:100" | ||
> | ||
<v-text-field | ||
v-model.trim="value.name" | ||
:error-messages="errors" | ||
:readonly="!editing" | ||
label="Preferred name" | ||
required | ||
></v-text-field> | ||
</ValidationProvider> | ||
|
||
<ValidationProvider v-slot="{ errors }" name="full_name"> | ||
<v-text-field | ||
v-model.trim="value.full_name" | ||
:error-messages="errors" | ||
:readonly="!editing" | ||
label="Full name" | ||
></v-text-field> | ||
</ValidationProvider> | ||
|
||
<ValidationProvider | ||
v-if="create" | ||
v-slot="{ errors }" | ||
name="password" | ||
rules="required|min:10|max:100" | ||
vid="password" | ||
> | ||
<v-text-field | ||
v-model.trim="value.password" | ||
:error-messages="errors" | ||
:readonly="!editing" | ||
label="Password" | ||
required | ||
type="password" | ||
></v-text-field> | ||
</ValidationProvider> | ||
|
||
<ValidationProvider | ||
v-if="create" | ||
v-slot="{ errors }" | ||
name="confirmation" | ||
rules="required|confirmed:password" | ||
> | ||
<v-text-field | ||
v-model="value.password_confirm" | ||
:error-messages="errors" | ||
label="Password confirmation" | ||
required | ||
type="password" | ||
></v-text-field> | ||
</ValidationProvider> | ||
|
||
<ValidationProvider | ||
v-slot="{ errors }" | ||
name="roles" | ||
rules="required" | ||
> | ||
<v-select | ||
v-model="value.roles" | ||
class="pt-3" | ||
:items="roles" | ||
:error-messages="errors" | ||
chips | ||
deletable-chips | ||
dense | ||
label="Role" | ||
hide-details | ||
small-chips | ||
variant="solo" | ||
:readonly="!editing" | ||
></v-select> | ||
</ValidationProvider> | ||
</v-col> | ||
</v-row> | ||
|
||
<standard-options :editing="editing" :value="value" as="users" /> | ||
|
||
<standard-audit v-if="!editing" :value="value" /> | ||
|
||
<standard-identifier v-if="!editing" :value="value" /> | ||
</v-container> | ||
</v-card> | ||
</v-col> | ||
</v-row> | ||
</v-col> | ||
</v-row> | ||
</template> | ||
|
||
<script> | ||
import { ValidationProvider } from 'vee-validate' | ||
import StandardAudit from '@/components/StandardAudit' | ||
import StandardIdentifier from '@/components/StandardIdentifier' | ||
import StandardOptions from '@/components/StandardOptions' | ||
|
||
export default { | ||
components: { | ||
StandardAudit, | ||
StandardIdentifier, | ||
StandardOptions, | ||
ValidationProvider | ||
}, | ||
|
||
props: { | ||
create: { default: false, type: Boolean }, | ||
editing: { default: false, type: Boolean }, | ||
value: { type: Object, required: true } | ||
}, | ||
|
||
computed: { | ||
roles() { | ||
const roles = ['user', 'manager'] | ||
if ( | ||
this.$cannotPatch('users', { | ||
_id: this.value._id | ||
}) | ||
) { | ||
return roles.filter(role => role === this.value.roles) | ||
} | ||
|
||
return roles | ||
} | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
admin section will still be shown to a standard user in this case.
I believe admin section should be shown to only
manager
andsys admin
Related to #43
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.
making a note that we also want this nav section to be hidden when you "drill down" into an Org. And we want to change the name
Admin Section
=>Admin
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.
admin section will still be shown to standard
users
(in addition tomanagers
and admins) but perhaps that is our intentThere 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.
we discussed today, @ergjustin will make this
can
->canCreate