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

UNOTOPLYS-243 : Ajout du panel latéral pour le paramétrage des formulaires.

parent 8f5f8244
...@@ -24,6 +24,7 @@ import { PanelUtils } from '@/components/panel/panel.utils'; ...@@ -24,6 +24,7 @@ import { PanelUtils } from '@/components/panel/panel.utils';
import OaHeader from '@/components/header/oa-header.vue'; import OaHeader from '@/components/header/oa-header.vue';
import PanelScreen from '@/components/panel/panel-screen/panel-screen.vue'; import PanelScreen from '@/components/panel/panel-screen/panel-screen.vue';
import PanelWorkspace from '@/components/panel/panel-workspace/panel-workspace.vue'; import PanelWorkspace from '@/components/panel/panel-workspace/panel-workspace.vue';
import PanelForm from '@/components/panel/panel-form/panel-form.vue';
config.initVueAdmin(Vue); config.initVueAdmin(Vue);
...@@ -32,6 +33,7 @@ config.initVueAdmin(Vue); ...@@ -32,6 +33,7 @@ config.initVueAdmin(Vue);
OaHeader, OaHeader,
PanelScreen, PanelScreen,
PanelWorkspace, PanelWorkspace,
PanelForm,
}, },
provide: { provide: {
auditsService: () => new AuditsService(), auditsService: () => new AuditsService(),
...@@ -89,6 +91,8 @@ export default class Admin extends Vue { ...@@ -89,6 +91,8 @@ export default class Admin extends Vue {
return PanelScreen; return PanelScreen;
} else if (this.asideComponent === PanelUtils.PANEL_WORKSPACE) { } else if (this.asideComponent === PanelUtils.PANEL_WORKSPACE) {
return PanelWorkspace; return PanelWorkspace;
} else if (this.asideComponent === PanelUtils.PANEL_FORM) {
return PanelForm;
} else { } else {
return null; return null;
} }
......
import Vue from 'vue';
import {Component, Prop} from 'vue-property-decorator';
import {formAsideTabs} from '@/shared/model/form.model';
@Component
export default class PanelWorkspace extends Vue {
@Prop()
public url: string;
public get tabs() {
return formAsideTabs.map((tab: string) => {
return {
anchor: `${this.url}#${tab}`,
label: this.$t(`form.aside.tabs.${tab}.label`),
};
});
}
}
<template>
<aside class="bg-white border-r">
<div class="sticky top-0 left-0">
<ul>
<li
v-for="(tab, index) in tabs"
:key="index"
class="flex items-center transition border-b hover:absolute hover:bg-blue-100 focus:ring"
:tabindex="index"
role="button"
>
<a class="rounded-md cursor-pointer p-4" :href="tab.anchor">{{ tab.label }}</a>
</li>
</ul>
</div>
</aside>
</template>
<script lang="ts" src="./panel-form.component.ts" />
export enum PanelUtils { export enum PanelUtils {
PANEL_SCREEN = 'panel-screen', PANEL_SCREEN = 'panel-screen',
PANEL_WORKSPACE = 'panel-workspace', PANEL_WORKSPACE = 'panel-workspace',
PANEL_FORM = 'panel-form',
} }
import { Authority } from '@/shared/security/authority'; import { Authority } from '@/shared/security/authority';
import {PanelUtils} from "@/components/panel/panel.utils";
const FormCreationComponent = () => import('@/views/form/form-creation.vue'); const FormCreationComponent = () => import('@/views/form/form-creation.vue');
const FormPreviewComponent = () => import('@/views/form/form-preview.vue'); const FormPreviewComponent = () => import('@/views/form/form-preview.vue');
...@@ -31,7 +32,10 @@ export default [ ...@@ -31,7 +32,10 @@ export default [
path: '/admin/workspace/:idWorkspace/form/:idForm/settings', path: '/admin/workspace/:idWorkspace/form/:idForm/settings',
name: 'FormSettingsComponent', name: 'FormSettingsComponent',
component: FormSettingsComponent, component: FormSettingsComponent,
meta: { authorities: [Authority.ADMIN] }, meta: {
authorities: [Authority.ADMIN],
panel: PanelUtils.PANEL_FORM,
},
}, },
{ {
path: '/admin/form/:idForm/share', path: '/admin/form/:idForm/share',
......
...@@ -31,3 +31,5 @@ export class Form implements IForm { ...@@ -31,3 +31,5 @@ export class Form implements IForm {
public workspaceId?: number public workspaceId?: number
) {} ) {}
} }
export const formAsideTabs = ['informations', 'managers'];
<template> <template>
<section class="max-w-4xl mx-auto p-9"> <section class="max-w-4xl mx-auto p-9">
<h1 class="mb-4 text-2xl">{{ $t('form.settings.title') }}</h1> <h1 id="informations" class="mb-4 text-2xl">{{ $t('form.settings.title') }}</h1>
<form v-on:submit.prevent="save()"> <form v-on:submit.prevent="save()">
<oa-input <oa-input
id="reference" id="reference"
......
...@@ -30,6 +30,16 @@ ...@@ -30,6 +30,16 @@
}, },
"actions": { "actions": {
"add": "Créer un questionnaire" "add": "Créer un questionnaire"
},
"aside": {
"tabs": {
"informations": {
"label": "Informations générales"
},
"managers": {
"label": "Contributeurs"
}
}
} }
} }
} }
Supports Markdown
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