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

UNOTOPLYS-80 : Ajout d'une colonne "name_bo" permettant d'avoir un titre technique pour un écran.

parent b0f0a048
......@@ -47,6 +47,13 @@ public class Screen implements Serializable {
@Column(name = "name", nullable = false, unique = true)
private String name;
/**
* Nom de l'écran : pour l'affichage uniquement
*/
@NotNull
@Column(name = "name_bo", nullable = false, unique = true)
private String nameBo;
/**
* reference du screen pour constituer l'URL
*/
......@@ -221,6 +228,13 @@ public class Screen implements Serializable {
this.index = index;
}
public String getNameBo() {
return nameBo;
}
public void setNameBo(String nameBo) {
this.nameBo = nameBo;
}
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here
@Override
......
......@@ -26,6 +26,8 @@ public class ScreenDTO implements Serializable {
@ApiModelProperty(value = "Nom de l'écran : pour l'affichage uniquement", required = true)
private String name;
private String nameBo;
private Integer index;
/**
......@@ -134,6 +136,14 @@ public class ScreenDTO implements Serializable {
this.nextScreenExpressions = nextScreenExpressions;
}
public String getNameBo() {
return nameBo;
}
public void setNameBo(String nameBo) {
this.nameBo = nameBo;
}
@Override
public boolean equals(Object o) {
if (this == o) {
......
......@@ -12,6 +12,8 @@ public class ScreenPanelDTO implements Serializable, Comparable {
private String title;
private String titleBo;
private Integer index;
private Long id;
......@@ -40,6 +42,14 @@ public class ScreenPanelDTO implements Serializable, Comparable {
this.id = id;
}
public String getTitleBo() {
return titleBo;
}
public void setTitleBo(String titleBo) {
this.titleBo = titleBo;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
......
......@@ -11,5 +11,6 @@ import org.mapstruct.Mapping;
@Mapper(componentModel = "spring")
public interface ScreenPanelMapper extends EntityMapper<ScreenPanelDTO, Screen> {
@Mapping(source = "name", target = "title")
@Mapping(source = "nameBo", target = "titleBo")
ScreenPanelDTO toDto(Screen screen);
}
alter table screen add column name_bo varchar(255);
update screen set name_bo = name where name_bo is null;
alter table screen alter column name_bo set not null;
......@@ -39,6 +39,7 @@
<include file="config/liquibase/changelog/20210420145300_migration_screen_index.sql" relativeToChangelogFile="false"/>
<include file="config/liquibase/changelog/20210420150500_add_constraint_screen_index.sql" relativeToChangelogFile="false"/>
<include file="config/liquibase/changelog/20210420151000_drop_screen_previous_id.sql" relativeToChangelogFile="false"/>
<include file="config/liquibase/changelog/20210422143300_screen_name_bo.sql" relativeToChangelogFile="false"/>
<!-- jhipster-needle-liquibase-add-constraints-changelog - JHipster will add liquibase constraints changelogs here -->
<!-- jhipster-needle-liquibase-add-incremental-changelog - JHipster will add incremental liquibase changelogs here -->
</databaseChangeLog>
......@@ -33,7 +33,7 @@
: 'bg-white border-gray-300 group-hover:border-gray-400',
]"
>{{ panelScreen.index }}</span
>{{ panelScreen.title }}
>{{ panelScreen.titleBo }}
</li>
</ol>
</div>
......
export interface IScreen {
id?: number;
name?: string;
nameBo?: string;
reference?: string;
description?: any;
defaultNextScreenReference?: any;
......@@ -16,6 +17,7 @@ export class Screen implements IScreen {
constructor(
public id?: number,
public name?: string,
public nameBo?: string,
public reference?: string,
public description?: any,
public defaultNextScreenReference?: any,
......
......@@ -72,8 +72,30 @@ export default class ScreenEdit extends Vue {
}
}
public saveChange() {
public saveItemChange() {
this.screen.items = JSON.stringify(this.screen.itemsList);
this.save();
}
public setName(name) {
this.screen.name = name;
this.save();
}
public setNameBo(nameBo) {
this.screen.nameBo = nameBo;
this.save();
}
public setReference(reference) {
this.screen.reference = reference;
this.save();
}
public setDescription(description) {
this.screen.description = description;
this.save();
}
}
......@@ -2,23 +2,22 @@
<main>
<section class="max-w-4xl mx-auto p-9">
<h1 class="mb-6 text-3xl">{{ $t('screen.label.step', { num: stepNum }) }}</h1>
<oa-input id="0" :label="$t('screen.label.title')" :value="screen.name" required="true" @update="screen.name = $event" />
<oa-input id="0" :label="$t('screen.label.title')" :value="screen.name" required="true" @update="setName" />
<oa-input id="0" :label="$t('screen.label.titleBo')" :value="screen.nameBo" required="true" @update="setNameBo" />
<oa-input
id="1"
:label="$t('screen.label.reference.label')"
:value="screen.reference"
required="true"
@update="screen.reference = $event"
@update="setReference"
:helpText="$t('screen.label.reference.helpText')"
/>
<oa-textarea id="2" :label="$t('screen.label.description')" :value="screen.description" @update="screen.description = $event" />
<oa-textarea id="2" :label="$t('screen.label.description')" :value="screen.description" @update="setDescription" />
<ul class="flex justify-center border-b-2 mb-8">
<li>
<a class="block p-2 text-blue-500 border-b border-blue-600 py-2" href="#">Contenus</a>
</li>
<li>
<a class="block p-2 text-gray-600 border-b border-transparent py-2" href="#">Conditions daffichage</a>
</li>
</ul>
<div class="mb-8 border-b-2">
......@@ -26,7 +25,7 @@
<div class="bg-blue-100 mb-8 flex w-auto items-center">
<h2 class="p-2 font-bold uppercase text-blue-600 text-xs">Section {{ index }}</h2>
</div>
<screen-item-edit :componentConfiguration="item" @itemEdit="saveChange"></screen-item-edit>
<screen-item-edit :componentConfiguration="item" @itemEdit="saveItemChange"></screen-item-edit>
</div>
</div>
</section>
......
......@@ -37,6 +37,7 @@
"label": {
"step": "Étape {{ num }}",
"title": "Titre de l’étape",
"titleBo": "Titre de l'étape (seulement pour le backoffice)",
"reference": {
"label": "Référence",
"helpText": "Cette information est utilisée pour définir l'URL de l'étape (ex: https://apply.univ-nantes.fr/form/staps/<strong>ref1</strong>)"
......
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