Commit 0248704b authored by Julien BOUYER's avatar Julien BOUYER
Browse files

Merge branch 'feature/UNOTOPLYS-217_eslint_fix' into 'develop'

UNOTOPLYS-217 chore : fix des erreurs ESLint

See merge request !62
parents ae484431 7e4091eb
......@@ -8,7 +8,7 @@
"prettier:check": "prettier --check \"{,src/**/,webpack/}*.{md,json,yml,html,js,ts,tsx,css,scss,vue,java}\"",
"prettier:format": "prettier --write \"{,src/**/,webpack/}*.{md,json,yml,html,js,ts,tsx,css,scss,vue,java}\"",
"lint": "vue-cli-service lint --no-fix",
"lint:fix": "vue-cli-service lint",
"lint:fix": "vue-cli-service lint --fix",
"cleanup": "rimraf target/classes/static/",
"clean-www": "rimraf target/classes/static/app/{src,target/}",
"start": "npm run webapp:dev",
......
......@@ -7,7 +7,7 @@ export default class ConfigurationService {
const properties = [];
const propertiesObject = this.getConfigPropertiesObjects(res.data);
for (const key in propertiesObject) {
if (propertiesObject.hasOwnProperty(key)) {
if (Object.prototype.hasOwnProperty.call(propertiesObject, key)) {
properties.push(propertiesObject[key]);
}
}
......@@ -31,7 +31,7 @@ export default class ConfigurationService {
const detailProperties = propertyObject['properties'];
const vals = [];
for (const keyDetail in detailProperties) {
if (detailProperties.hasOwnProperty(keyDetail)) {
if (Object.prototype.hasOwnProperty.call(detailProperties, keyDetail)) {
vals.push({ key: keyDetail, val: detailProperties[keyDetail]['value'] });
}
}
......
......@@ -46,7 +46,7 @@ export default class HealthService {
let hasDetails = false;
for (const key in healthObject) {
if (healthObject.hasOwnProperty(key)) {
if (Object.prototype.hasOwnProperty.call(healthObject, key)) {
const value = healthObject[key];
if (key === 'status' || key === 'error') {
healthData[key] = value;
......@@ -73,7 +73,7 @@ export default class HealthService {
public flattenHealthData(result: any, path: any, data: any): any {
for (const key in data) {
if (data.hasOwnProperty(key)) {
if (Object.prototype.hasOwnProperty.call(data, key)) {
const value = data[key];
if (this.isHealthObject(value)) {
if (this.hasSubSystem(value)) {
......@@ -106,7 +106,7 @@ export default class HealthService {
let result = false;
for (const key in healthObject) {
if (healthObject.hasOwnProperty(key)) {
if (Object.prototype.hasOwnProperty.call(healthObject, key)) {
const value = healthObject[key];
if (value && value.status) {
result = true;
......@@ -120,7 +120,7 @@ export default class HealthService {
let result = false;
for (const key in healthObject) {
if (healthObject.hasOwnProperty(key)) {
if (Object.prototype.hasOwnProperty.call(healthObject, key)) {
if (key === 'status') {
result = true;
}
......
......@@ -11,7 +11,7 @@ import Toolbar from '@/components/toolbar/toolbar.vue';
},
})
export default class AdminHomeComponent extends Vue {
private cards: Object[] = [
private cards: any[] = [
{ title: 'Mon premier workspace', number_element: '15', type_element: 'Questionnaires', link: 'ScreenEdit' },
{ title: 'Staps Nantes', number_element: '32', type_element: 'Questionnaires', link: 'ScreenEdit' },
];
......
......@@ -108,13 +108,7 @@
</tr>
</tbody>
</table>
<b-modal
ref="removeUser"
id="removeUser"
title="Confirm delete operation"
v-bind:title="$t('entity.delete.title')"
@ok="deleteUser()"
>
<b-modal ref="removeUser" id="removeUser" v-bind:title="$t('entity.delete.title')" @ok="deleteUser()">
<div class="modal-body">
<p id="jhi-delete-user-heading" v-text="$t('userManagement.delete.question', { login: removeId })">
Are you sure you want to delete this user?
......
import Vue from 'vue';
import Component from 'vue-class-component';
@Component
export default class CardToolbar extends Vue {}
<template>
<!--<div class="flex items-center">-->
<!--<button class="p-1 text-blue-600 transition rounded-md hover:text-white hover:bg-blue-600 focus:ring">-->
<!--<svg class="icon" viewBox="0 0 24 24">-->
<!--<path fill="currentColor" d="M21,7V3H17V4H7V3H3V7H4V17H3V21H7V20H17V21H21V17H20V7H21M18,4H20V6H18V4M4,4H6V6H4V4M6,20H4V18H6V20M20,20H18V18H20V20M18,17H17V18H7V17H6V7H7V6H17V7H18V17M16,8V10H13V16H11V10H8V8H16Z"></path>-->
<!--</svg>-->
<!--</button>-->
<!--<button class="p-1 text-blue-600 transition rounded-md hover:text-white hover:bg-blue-600 focus:ring">-->
<!--<svg class="icon" viewBox="0 0 24 24">-->
<!--<path fill="currentColor" d="M21,3H3C2,3 1,4 1,5V19A2,2 0 0,0 3,21H21C22,21 23,20 23,19V5C23,4 22,3 21,3M5,17L8.5,12.5L11,15.5L14.5,11L19,17H5Z"></path>-->
<!--</svg>-->
<!--</button>-->
<!--<button class="p-1 text-blue-600 transition rounded-md hover:text-white hover:bg-blue-600 focus:ring">-->
<!--<svg class="icon" viewBox="0 0 24 24">-->
<!--<path fill="currentColor" d="M18,9H16V7H18M18,13H16V11H18M18,17H16V15H18M8,9H6V7H8M8,13H6V11H8M8,17H6V15H8M18,3V5H16V3H8V5H6V3H4V21H6V19H8V21H16V19H18V21H20V3H18Z"></path>-->
<!--</svg>-->
<!--</button>-->
<!--<button class="p-1 text-blue-600 transition rounded-md hover:text-white hover:bg-blue-600 focus:ring">-->
<!--<svg class="icon" viewBox="0 0 24 24">-->
<!--<path fill="currentColor" d="M20.56 18H3.44C2.65 18 2 17.37 2 16.59V7.41C2 6.63 2.65 6 3.44 6H20.56C21.35 6 22 6.63 22 7.41V16.59C22 17.37 21.35 18 20.56 18M6.81 15.19V11.53L8.73 13.88L10.65 11.53V15.19H12.58V8.81H10.65L8.73 11.16L6.81 8.81H4.89V15.19H6.81M19.69 12H17.77V8.81H15.85V12H13.92L16.81 15.28L19.69 12Z"></path>-->
<!--</svg>-->
<!--</button>-->
<!--</div>-->
</template>
<script lang="ts" src="./card-toolbar.component.ts" />
<template></template>
<template>
<div></div>
</template>
<script lang="ts" src="./message.component.ts" />
<template>
<component :is="componentForItem" :configuration="componentConfiguration" @itemEdit="itemEdit"/>
<component :is="componentForItem" :configuration="componentConfiguration" @itemEdit="itemEdit" />
</template>
<script lang="ts" src="./screen-item-edit.component.ts" />
......@@ -18,7 +18,7 @@ export default class AdminUsersTable extends Vue {
@Prop()
public authorizedUsers: User[];
public loginSearch: string = '';
public loginSearch = '';
private userSelected: IUser = new User();
......
......@@ -11,7 +11,7 @@ export default class Item extends Vue {
@Prop()
public idx: string;
public get currentComponent(): object {
public get currentComponent(): any {
const type = this.item.type;
// noinspection TypeScriptCheckImport (import fait au runtime)
return () => import(`@/front/components/${type}/${type}`);
......
......@@ -16,7 +16,7 @@ export default class ScreenFooter extends Vue {
public hasPrevious: boolean;
@Prop()
public progress: object;
public progress: any;
@Inject('frontFormService')
private frontFormService: () => FrontFormService;
......
......@@ -3,6 +3,7 @@ import Component from 'vue-class-component';
import ScreenHeader from '@/front/screen/screen-header.vue';
import ScreenFooter from '@/front/screen/screen-footer.vue';
import Item from '@/front/item/item.vue';
import { IScreen } from '@/shared/model/screen.model';
@Component({
components: {
......@@ -12,11 +13,11 @@ import Item from '@/front/item/item.vue';
},
})
export default class Screen extends Vue {
public get currentScreen(): object {
public get currentScreen(): IScreen {
return this.$store.getters.currentScreen;
}
public get progress(): object {
public get progress(): any {
return this.$store.getters.progress;
}
}
......@@ -4,10 +4,10 @@ import { Store } from 'vuex';
import { BUILD_TIMESTAMP } from '@/constants';
export default class TranslationService {
private store: Store<{}>;
private store: Store<any>;
private i18n: VueI18n;
constructor(store: Store<{}>, i18n: VueI18n) {
constructor(store: Store<any>, i18n: VueI18n) {
this.store = store;
this.i18n = i18n;
}
......
import { Store } from 'vuex';
export default class JhiAlertService {
private store: Store<{}>;
private store: Store<any>;
constructor(store: Store<{}>) {
constructor(store: Store<any>) {
this.store = store;
this.store.commit('initAlert');
}
......
......@@ -81,10 +81,10 @@ export default class JhiDataUtils extends Vue {
*/
clearInputImage(entity, elementRef, field, fieldContentType, idInput) {
if (entity && field && fieldContentType) {
if (entity.hasOwnProperty(field)) {
if (Object.prototype.hasOwnProperty.call(entity, field)) {
entity[field] = null;
}
if (entity.hasOwnProperty(fieldContentType)) {
if (Object.prototype.hasOwnProperty.call(entity, fieldContentType)) {
entity[fieldContentType] = null;
}
if (elementRef && idInput && elementRef.nativeElement.querySelector('#' + idInput)) {
......
......@@ -9,7 +9,6 @@ export default class JhiItemCountComponent extends Vue {
total: number;
@Prop()
itemsPerPage: number;
i18nEnabled = true;
get first() {
return (this.page - 1) * this.itemsPerPage === 0 ? 1 : (this.page - 1) * this.itemsPerPage + 1;
......
<template>
<div class="info jhi-item-count">
<span v-if="i18nEnabled" v-text="$t('global.item-count', { first, second, total })"
>Showing {{ first }} - {{ second }} of {{ total }} items.</span
>
<span v-if="!i18nEnabled">
Showing {{ (page - 1) * itemsPerPage === 0 ? 1 : (page - 1) * itemsPerPage + 1 }} -
{{ page * itemsPerPage < total ? page * itemsPerPage : total }}
of {{ total }} items.
</span>
<span>{{ $t('global.item-count', { first, second, total }) }} </span>
</div>
</template>
......
......@@ -17,7 +17,7 @@ export default class HeaderService {
}
public updateTabsForWorkspaceId(workspaceId: number, currentKey: string): void {
const tabs: Object[] = [
const tabs: any[] = [
{
title: this.i18n.t('onglets.parametrages'),
link: `/admin/workspace/${workspaceId}/settings`,
......@@ -33,7 +33,7 @@ export default class HeaderService {
}
public updateTabsForFormId(workspaceId: number, formId: number, currentKey: string): void {
const tabs: Object[] = [
const tabs: any[] = [
{
title: this.i18n.t('onglets.parametrages'),
link: `/admin/workspace/${workspaceId}/form/${formId}/settings`,
......@@ -54,7 +54,7 @@ export default class HeaderService {
}
public updateTabsForAdmin(currentTab: string): void {
const tabs: Object[] = [
const tabs: any[] = [
{
title: this.i18n.t('onglets.workspaces'),
link: '/admin/workspace',
......
<template></template>
<template>
<div></div>
</template>
<script lang="ts" src="./form-list.component.ts" />
<template></template>
<template>
<div></div>
</template>
<script lang="ts" src="./form-preview.component.ts" />
<template></template>
<template>
<div></div>
</template>
<script lang="ts" src="./form-results.component.ts" />
......@@ -28,11 +28,11 @@ export default class FormSettings extends Vue {
public form: IForm = new Form();
private currentIdForm: number = -1;
private currentIdForm = -1;
private isSaving = false;
public authorizedUsers: Object[] = [];
public authorizedUsers: IUser[] = [];
beforeRouteEnter(to, from, next) {
next(vm => {
......
<template></template>
<template>
<div></div>
</template>
<script lang="ts" src="./form-share.component.ts" />
<template></template>
<template>
<div></div>
</template>
<script lang="ts" src="./form-variables.component.ts" />
......@@ -32,7 +32,7 @@ export default class ScreenEdit extends Vue {
public screen: IScreen = new Screen();
public newItemType: string = '';
public newItemType = '';
beforeRouteEnter(to, from, next) {
next(vm => {
......
......@@ -23,7 +23,7 @@ export default class VariableEdit extends Vue {
@Inject('headerService')
private headerService: () => HeaderService;
public idVariable: String = '';
public idVariable = '';
public variable: IVariable;
......@@ -35,7 +35,7 @@ export default class VariableEdit extends Vue {
beforeRouteEnter(to, from, next) {
next(vm => {
vm.headerService().updateTabsForFormId(to.params.idWorkspace, to.params.idForm, TABS.KEY_VARIABLE);
let idVariable = to.params.idVariable;
const idVariable = to.params.idVariable;
vm.variable.formId = to.params.idForm;
if (idVariable) {
vm.idVariable = idVariable;
......
......@@ -25,9 +25,9 @@ export default class VariableList extends Vue {
public variables: IVariable[] = [];
public idForm: string = '';
public idForm = '';
public idWorkspace: string = '';
public idWorkspace = '';
beforeRouteEnter(to, from, next) {
next(vm => {
......@@ -46,7 +46,7 @@ export default class VariableList extends Vue {
});
}
public getVariableEditLink(idVariable: String) {
public getVariableEditLink(idVariable: string) {
return `/admin/workspace/${this.idWorkspace}/form/${this.idForm}/variable/${idVariable}/edit`;
}
......
......@@ -5,6 +5,7 @@ import Card from '@/components/card/card.vue';
import Toolbar from '@/components/toolbar/toolbar.vue';
import HeaderService from '@/shared/service/header-service';
import { TABS } from '@/shared/service/tabs-constants';
import { IWorkspace } from '@/shared/model/workspace.model';
@Component({
components: {
......@@ -28,7 +29,7 @@ export default class WorkspaceList extends Vue {
/**
* Liste des workspaces.
*/
public workspaces: Object[] = [];
public workspaces: IWorkspace[] = [];
/**
* Récupération des workspaces avant de faire l'affichage.
......
......@@ -28,11 +28,11 @@ export default class WorkspaceSettings extends Vue {
public workspace: IWorkspace = new Workspace();
public authorizedUsers: Object[] = [];
public authorizedUsers: IUser[] = [];
private isSaving = false;
private currentWorkspaceId: number = -1;
private currentWorkspaceId = -1;
beforeRouteEnter(to, from, next) {
next(vm => {
......
......@@ -5,7 +5,7 @@ import Card from '@/components/card/card.vue';
import Toolbar from '@/components/toolbar/toolbar.vue';
import FormService from '@/entities/form/form.service';
import HeaderService from '@/shared/service/header-service';
import { TABS } from '@/shared/service/tabs-constants';
import { IForm } from '@/shared/model/form.model';
@Component({
components: {
......@@ -27,9 +27,9 @@ export default class WorkspaceView extends Vue {
private headerService: () => HeaderService;
/**
* Liste des workspaces.
* Liste des forms.
*/
public forms: Object[] = [];
public forms: IForm[] = [];
public idWorkspace = -1;
......
/* eslint-disable @typescript-eslint/no-var-requires */
const tailwindcssLineClamp = require('@tailwindcss/line-clamp');
module.exports = {
purge: ['./src/webapp/**.html', './src/webapp/app/**/*.{vue,js,ts,jsx,tsx}'],
......
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