feat: unsaved changes prompt + beta preparations UI
This commit is contained in:
@@ -1,8 +1,18 @@
|
||||
<template lang="pug">
|
||||
v-dialog(v-model='isShown', max-width='550')
|
||||
v-card.wiki-form
|
||||
.dialog-header.is-short New Local User
|
||||
.dialog-header.is-short
|
||||
span New User
|
||||
v-card-text
|
||||
v-select.md2(
|
||||
:items='providers'
|
||||
item-text='title'
|
||||
item-value='key'
|
||||
outline
|
||||
prepend-icon='business'
|
||||
v-model='provider'
|
||||
label='Provider'
|
||||
)
|
||||
v-text-field.md2(
|
||||
outline
|
||||
prepend-icon='email'
|
||||
@@ -11,12 +21,7 @@
|
||||
ref='emailInput'
|
||||
)
|
||||
v-text-field.md2(
|
||||
outline
|
||||
prepend-icon='person'
|
||||
v-model='name'
|
||||
label='Name'
|
||||
)
|
||||
v-text-field.md2(
|
||||
v-if='provider === `local`'
|
||||
outline
|
||||
prepend-icon='lock'
|
||||
append-icon='casino'
|
||||
@@ -25,15 +30,24 @@
|
||||
counter='255'
|
||||
@click:append='generatePwd'
|
||||
)
|
||||
v-text-field.md2(
|
||||
outline
|
||||
prepend-icon='person'
|
||||
v-model='name'
|
||||
label='Name'
|
||||
)
|
||||
v-card-chin
|
||||
v-spacer
|
||||
v-btn(flat, @click='isShown = false') Cancel
|
||||
v-btn(color='primary', @click='createUser') Create User
|
||||
v-btn(color='primary', @click='newUser') Create
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import _ from 'lodash'
|
||||
import uuidv4 from 'uuid/v4'
|
||||
|
||||
import providersQuery from 'gql/admin/users/users-query-strategies.gql'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
value: {
|
||||
@@ -43,11 +57,11 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
providers: [],
|
||||
provider: 'local',
|
||||
email: '',
|
||||
name: '',
|
||||
password: '',
|
||||
jobTitle: '',
|
||||
location: ''
|
||||
name: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -66,12 +80,22 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async createUser() {
|
||||
async newUser() {
|
||||
|
||||
},
|
||||
generatePwd() {
|
||||
this.password = uuidv4().slice(-12)
|
||||
}
|
||||
},
|
||||
apollo: {
|
||||
providers: {
|
||||
query: providersQuery,
|
||||
fetchPolicy: 'network-only',
|
||||
update: (data) => data.authentication.strategies,
|
||||
watchLoading (isLoading) {
|
||||
this.$store.commit(`loading${isLoading ? 'Start' : 'Stop'}`, 'admin-users-strategies-refresh')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user