Commit 54747437 authored by Kevin Robert's avatar Kevin Robert
Browse files

Prise en compte des remarques de PR.

parent 6a6bc12e
......@@ -52,22 +52,6 @@ config.initVueAdmin(Vue);
export default class Admin extends Vue {
public asideComponent: String = null;
public tabs: Object = {
workspace: [
{ title: 'Paramétrage', path: '/settings' },
{ title: 'Questionnaires', path: '/view' },
],
form: [
{ title: 'Paramétrage', path: '/settings' },
{ title: 'Edition', path: '/view' },
],
};
public currentTabs: Object[] = [
{ title: 'Paramétrage', path: '/settings' },
{ title: 'Questionnaires', path: '/view' },
];
beforeRouteEnter(to, from, next) {
next(vm => {
vm.setAsideComponent(to.meta.panel);
......
<template>
<main>
<h2 class="mb-4 text-2xl">Utilisateurs</h2>
<h2 class="mb-4 text-2xl" v-text="$t('user.table.titre')">Utilisateurs</h2>
<table class="w-full bg-white border-t-2">
<thead class="font-bold">
<tr class="border-b-2">
<th class="p-2 text-left">Id</th>
<th class="p-2 text-left">Nom</th>
<th class="p-2 text-left">Email</th>
<th class="p-2 text-left">Actif</th>
<th class="p-2 text-left" v-text="$t('user.table.id')">ID</th>
<th class="p-2 text-left" v-text="$t('user.table.nom')">Nom</th>
<th class="p-2 text-left" v-text="$t('user.table.email')">Email</th>
<th class="p-2 text-left" v-text="$t('user.table.actif')">Actif</th>
</tr>
</thead>
<tbody>
<tr v-for="(user, index) in users" class="text-left align-top border-b">
<tr v-for="(user, index) in users" :key="index" class="text-left align-top border-b">
<td class="p-2">
<a :href="getUserEditLink(user.id)">{{ user.id }}</a>
</td>
......
......@@ -12,7 +12,7 @@ import AlertService from '@/shared/alert/alert.service';
import TranslationService from '@/locale/translation.service';
import FrontFormService from '@/front/services/front-form.service';
import { ROUTES } from '@/router/routes-constants';
import HeaderService from "@/shared/service/header-service";
import HeaderService from '@/shared/service/header-service';
/* tslint:enable */
Vue.config.productionTip = false;
......@@ -25,7 +25,7 @@ const store = config.initVueXStore(Vue);
const alertService = new AlertService(store);
const translationService = new TranslationService(store, i18n);
const accountService = new AccountService(store, translationService, router);
const headerService = new HeaderService(store);
const headerService = new HeaderService(store, translationService, i18n);
const frontFormService = new FrontFormService(store, router, alertService, translationService, i18n);
router.beforeEach((to, from, next) => {
......
......@@ -10,7 +10,6 @@ export const headerStore: Module<any, any> = {
mutations: {
tabs(state, newTabs) {
state.tabs = newTabs;
localStorage.setItem('tabs', newTabs);
},
},
};
import {Store} from "vuex";
import VueI18n from 'vue-i18n';
import TranslationService from '@/locale/translation.service';
export default class HeaderService {
constructor(private store: Store<any>) {
constructor(private store: Store<any>, private translationService: TranslationService, private i18n: VueI18n) {
this.translationService.refreshTranslation(this.store.getters.currentLanguage);
}
public updateTabsForWorkspaceId(workspaceId: number, currentKey: String): void {
let tabs: Object[] = [
{
'title': 'Paramétrage',
'title': this.i18n.t('onglets.parametrages'),
'link': `/admin/workspace/${workspaceId}/settings`,
'isCurrent': currentKey === 'settings'
},
{
'title': 'Questionnaires',
'title': this.i18n.t('onglets.forms'),
'link': `/admin/workspace/${workspaceId}/view`,
'isCurrent': currentKey === 'view'}
'isCurrent': currentKey === 'view'
},
];
this.store.commit('tabs', tabs);
}
......@@ -23,12 +27,12 @@ export default class HeaderService {
public updateTabsForFormId(workspaceId: number, formId: number, currentKey: String): void {
let tabs: Object[] = [
{
'title': 'Paramétrage',
'title': this.i18n.t('onglets.parametrages'),
'link': `/admin/workspace/${workspaceId}/form/${formId}/settings`,
'isCurrent': currentKey === 'settings'
},
{
'title': 'Édition',
'title': this.i18n.t('onglets.edition'),
'link': `/admin/workspace/${workspaceId}/form/${formId}/view`,
'isCurrent': currentKey === 'view'}
];
......@@ -38,12 +42,12 @@ export default class HeaderService {
public updateTabsForAdmin(currentTab: String): void {
let tabs: Object[] = [
{
'title': 'Espaces de travail',
'title': this.i18n.t('onglets.workspaces'),
'link': '/admin/workspace/list',
'isCurrent': currentTab === 'workspaces'
},
{
'title': 'Utilisateurs',
'title': this.i18n.t('onglets.utilisateurs'),
'link': '/admin/user/list',
'isCurrent': currentTab === 'users'}
];
......
<template>
<main>
<section class="max-w-4xl mx-auto p-9">
<h2 class="mb-4 text-2xl" id="s1">Informations générales</h2>
<h2 class="mb-4 text-2xl" id="s1" v-text="$t('form.settings.title')">Informations générales</h2>
<form v-on:submit.prevent="save()">
<oa-input id="id" label="ID" type="text" :value="form.id" required="true" disabled="true"></oa-input>
<oa-input id="reference" label="Référence" type="text" :value="form.reference" required="true" @update="setReference"></oa-input>
<oa-input id="name" label="Nom" type="text" :value="form.name" required="true" @update="setName"></oa-input>
<oa-textarea id="description" label="Description" :value="form.description" @update="setDescription"></oa-textarea>
<oa-button type="submit" variant="primary" label="Enregistrer"></oa-button>
<oa-input id="id" :label="$t('form.settings.id')" type="text" :value="form.id" required="true" disabled="true"></oa-input>
<oa-input id="reference" :label="$t('form.settings.reference')" type="text" :value="form.reference" required="true" @update="setReference"></oa-input>
<oa-input id="name" :label="$t('form.settings.name')" type="text" :value="form.name" required="true" @update="setName"></oa-input>
<oa-textarea id="description" :label="$t('form.settings.description')" :value="form.description" @update="setDescription"></oa-textarea>
<oa-button type="submit" variant="primary" :label="$t('button.save')"></oa-button>
</form>
<admin-users-table :users="authorizedUsers"></admin-users-table>
</section>
......
<template>
<main>
<section class="max-w-6xl px-4 mx-auto py-9 xl:px-0">
<toolbar title="Utilisateurs" addActionName="Ajouter un utilisateur" actionLink="/admin/user/creation"></toolbar>
<toolbar title="Utilisateurs" :addActionName="$t('user.actions.nouveau')" actionLink="/admin/user/creation"></toolbar>
<table class="w-full bg-white border-t-2">
<thead class="font-bold">
<tr class="border-b-2">
<th class="p-2 text-left">Id</th>
<th class="p-2 text-left">Nom</th>
<th class="p-2 text-left">Email</th>
<th class="p-2 text-left">Actif</th>
</tr>
<tr class="border-b-2">
<th class="p-2 text-left" v-text="$t('user.table.id')">ID</th>
<th class="p-2 text-left" v-text="$t('user.table.nom')">Nom</th>
<th class="p-2 text-left" v-text="$t('user.table.email')">Email</th>
<th class="p-2 text-left" v-text="$t('user.table.actif')">Actif</th>
</tr>
</thead>
<tbody>
<tr v-for="(user, index) in users" class="text-left align-top border-b">
<tr v-for="(user, index) in users" :key="index" class="text-left align-top border-b">
<td class="p-2">
<a :href="getUserEditLink(user.id)">{{ user.id }}</a>
</td>
......
<template>
<main>
<section class="max-w-4xl mx-auto p-9">
<h2 class="mb-4 text-2xl">Informations générales</h2>
<h2 class="mb-4 text-2xl" v-text="$t('form.settings.title')">Informations générales</h2>
<form v-on:submit.prevent="save()">
<oa-input id="id" label="ID" type="text" :value="workspace.id" required="true" disabled="true"></oa-input>
<oa-input id="name" label="Nom" type="text" :value="workspace.name" required="true" @update="setName"></oa-input>
<oa-textarea id="description" label="Description" :value="workspace.description" @update="setDescription"></oa-textarea>
<oa-button type="submit" variant="primary" label="Enregistrer"></oa-button>
<oa-input id="id" :label="$t('form.settings.id')" type="text" :value="workspace.id" required="true" disabled="true"></oa-input>
<oa-input id="name" :label="$t('form.settings.name')" type="text" :value="workspace.name" required="true" @update="setName"></oa-input>
<oa-textarea id="description" :label="$t('form.settings.description')" :value="workspace.description" @update="setDescription"></oa-textarea>
<oa-button type="submit" variant="primary" :label="$t('button.save')"></oa-button>
</form>
<admin-users-table :users="authorizedUsers"></admin-users-table>
</section>
......
......@@ -30,7 +30,7 @@ export default class WorkspaceView extends Vue {
*/
public forms: Object[] = [];
public idWorkspace;
public idWorkspace = -1;
/**
* Récupération des workspaces avant de faire l'affichage.
......
......@@ -30,5 +30,14 @@
"reference": "reference du formulaire pour constituer l&#39;URL"
}
}
},
"form": {
"settings": {
"title": "Informations générales",
"id": "ID",
"reference": "Référence",
"name": "Titre",
"description": "Description"
}
}
}
......@@ -143,5 +143,11 @@
"not.image": "Le fichier doit être une image et non du type \"{{ fileType }}\""
}
},
"footer": "Ceci est votre pied de page"
"onglets": {
"parametrages": "Paramétrages",
"edition": "Édition",
"forms": "Questionnaires",
"workspaces": "Espaces de travail",
"utilisateurs": "Utilisateurs"
}
}
{
"user": {
"table": {
"titre": "Utilisateurs",
"id": "ID",
"nom": "Nom",
"email": "Email",
"actif": "Actif"
},
"actions": {
"nouveau": "Ajouter un utilisateur"
}
}
}
......@@ -22,5 +22,13 @@
"description": "Description",
"form": "Form"
}
},
"form": {
"settings": {
"title": "Informations générales",
"id": "ID",
"name": "Titre",
"description": "Description"
}
}
}
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