Commit 1c78e54b authored by Vincent A's avatar Vincent A 🌱

Add CSV upload

parent 14ef35ad
......@@ -12029,6 +12029,11 @@
"integrity": "sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg==",
"dev": true
},
"papaparse": {
"version": "4.6.2",
"resolved": "https://registry.npmjs.org/papaparse/-/papaparse-4.6.2.tgz",
"integrity": "sha512-P/4p6S6wZyXAjcFPnJAjFn7lxMIkd+23prFELhcbfWswQfg7dG1XJfV8/lKvk5lu5BGSSJZFHSDMejjFcB1feg=="
},
"parallel-transform": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.1.0.tgz",
......
......@@ -2,18 +2,19 @@
<v-container fluid grid-list-md>
<v-slide-y-transition mode="out-in">
<v-card>
<v-card-title>
<h1>Benutzer und Gruppen</h1>
<v-spacer></v-spacer>
<v-text-field
v-model="search"
append-icon="search"
:label="$vuetify.t('$vuetify.AdminUsers.searchLabel')"
single-line
hide-details
></v-text-field>
</v-card-title>
<v-card-text>
<v-toolbar>
<v-toolbar-title>{{ users.length }} Benutzer</v-toolbar-title>
<v-spacer></v-spacer>
<v-text-field
v-model="search"
append-icon="search"
:label="$vuetify.t('$vuetify.AdminUsers.searchLabel')"
single-line
hide-details
></v-text-field>
</v-toolbar>
<v-data-table
:headers="headers"
:items="users"
......@@ -88,10 +89,11 @@
</v-card>
</v-data-table>
<v-layout row wrap>
<v-layout row wrap mt-3>
<v-flex xs12 sm6>
<GroupsUsersEdit
:user="toEdit"
:users="users"
:handleCancel="reset"
:handleSuccess="handleNewUser"
/>
......@@ -209,8 +211,8 @@ export default {
config: JSON.parse(entry.config)
})
// Groups are returned as a composite value, which means they're strings
// that need to be unpacked
// Groups are returned from Postgrest as a composite value, which means
// they're strings that need to be unpacked
const parseGroups = entry => Object.assign({}, entry, {
groups: entry.groups[0] === '(,,)' // Postgres return value for 'no groups'
? []
......@@ -233,19 +235,25 @@ export default {
hasSetPassword: entry.config.temp_password == null
})
api.user.getListing().then((res) => {
this.users = res.data
.map(parseConfig)
.map(parseGroups)
.map(checkTempPassword)
this.isLoading = false
})
api.user.getListing()
.then((res) => {
this.users = res.data
.map(parseConfig)
.map(parseGroups)
.map(checkTempPassword)
this.isLoading = false
})
.catch(() => {
this.isLoading = false
})
},
handleNewUser: function (data) {
handleNewUser: function () {
this.isLoading = true
this.reset()
this.getUsers()
},
handleGroupsUpdated: function (data) {
this.isLoading = true
this.getUsers()
},
deleteUser: function () {
......
This diff is collapsed.
......@@ -262,7 +262,7 @@ export default {
'change.status': 'Status setzen!'
},
AdminUsers: {
'titleAdd': 'Neuen Benutzer hinzufügen',
'titleAdd': 'Neue Benutzer hinzufügen',
'titleEdit': 'Benutzer "{0}" ändern',
'columnHasSetPassword': 'Passwort zurückgesetzt',
'columnHasSetPassword-true': 'Ja',
......@@ -288,12 +288,15 @@ export default {
'deleteText': 'Benutzer "{0}" wirklich löschen?',
'deleteConfirm': 'Unwiderrufbar löschen',
'deleteCancel': 'Zurück',
'snackbarCreated': 'Nutzer erstellt',
'snackbarCreated': '{0} Nutzer erstellt',
'snackbarSaved': 'Nutzerdaten gesichert',
'snackbarDeleted': 'Nutzer wurde gelöscht',
'snackbarRoleAdded': 'Rolle wurde hinzugefügt',
'snackbarDeleteFailed': 'Nutzer konnte nicht gelöscht werden',
'snackbarDuplicateGroup': 'Der Benutzer hat diese Rolle bereits'
'snackbarDuplicateGroup': 'Der Benutzer hat diese Rolle bereits',
'csvDialog': 'Aus CSV-Datei',
'csvFilePicker': 'Datei auswählen',
'csvFormatError': 'Bitte sicherstellen, dass alle benötigten Spalten vorhanden sind.'
},
AdminChangePhase: {
'title': 'Phasen verschieben',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment