diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fedb0c0838a5d4b1a9b1c5952a58d0190a0f7db5..4e51607704ebc6a8e0299856620db6366892d1f4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,6 @@ image: docker:stable -# Pour l'utilisation de testcontainers +# For using Testcontainers : # https://www.testcontainers.org/supported_docker_environment/continuous_integration/gitlab_ci/ services: &dind_definition - name: docker:dind @@ -125,10 +125,16 @@ production: deployment: stage: trigger + variables: + TRIGGERED_BY_PARENT: 'true' + TRIGGERED_PROJECT_NAME: "$CI_PROJECT_NAME" + TRIGGERED_USER_NAME: "$GITLAB_USER_NAME" + TRIGGERED_PROJECT_COMMIT: "$CI_PROJECT_URL/-/commit/$CI_COMMIT_SHA" + TRIGGERED_PROJECT_COMMIT_TITLE: "$CI_COMMIT_TITLE" + TRIGGERED_PROJECT_BRANCH: "$CI_COMMIT_REF_NAME" rules: - if: '$CI_COMMIT_REF_SLUG == "develop"' # Development Env variables: - TRIGGERED_BY_PARENT: 'true' ENV: 'development' OA_FRONTEND_VERSION: '$CI_COMMIT_REF_SLUG' # develop branch INIT_DB_USER: true @@ -136,7 +142,6 @@ deployment: when: on_success - if: '$CI_COMMIT_REF_SLUG == "main"' # Preprod Env variables: - TRIGGERED_BY_PARENT: 'true' ENV: 'preprod' OA_FRONTEND_VERSION: '$CI_COMMIT_REF_SLUG' # main branch INIT_DB_USER: true @@ -144,7 +149,6 @@ deployment: when: on_success - if: '$CI_COMMIT_TAG' # Production Env variables: - TRIGGERED_BY_PARENT: 'true' ENV: "production" OA_FRONTEND_VERSION: '$CI_COMMIT_TAG' INIT_DB_USER: false @@ -154,7 +158,6 @@ deployment: when: never - when: manual # Trigger manually if needed ( Feature Dev branch ) variables: - TRIGGERED_BY_PARENT: 'true' ENV: "development" OA_FRONTEND_VERSION: '$CI_COMMIT_REF_SLUG' INIT_DB_USER: true diff --git a/src/components/common/TitleAndDescription.vue b/src/components/common/TitleAndDescription.vue index 60658e20e87bc06d4ab9a689424750ddfc9d8001..6c5fb0d5a0adb6809d902052f599e48a11fffb5c 100644 --- a/src/components/common/TitleAndDescription.vue +++ b/src/components/common/TitleAndDescription.vue @@ -1,4 +1,6 @@ <script> +import app from "@/main"; + export default { name: "TitleAndDescription", props: { @@ -6,6 +8,35 @@ export default { localName: String, localDescription: String, localTitle: String, + applicationName: { + type: String, + required: false, + }, + withAuth: { + type: Boolean, + required: false, + }, + canCreateApplication: { + type: Boolean, + required: false, + }, + canManagerApplication: { + type: Boolean, + required: false, + }, + canManagerUser: { + type: Boolean, + required: false, + }, + }, + setup(props) { + function consultAuthorization() { + app.$router.push(`/applications/${props.applicationName}/authorizations`); + } + + return { + consultAuthorization, + }; }, }; </script> @@ -15,7 +46,7 @@ export default { <slot name="label" v-bind:option="application"> {{ localTitle || localName }} </slot> - <slot name="description" v-bind:option="application" v-if="localDescription"> + <slot v-if="localDescription" name="description" v-bind:option="application"> <sup style="font-size: 1.5em"> <b-tooltip :label="$t('applications.description', { localDescription: localDescription })" @@ -25,10 +56,24 @@ export default { </b-tooltip> </sup> </slot> + <slot + v-if="canCreateApplication || canManagerApplication || canManagerUser" + class="btn_auth_tooltip" + > + <b-tooltip :label="$t('dataTypesManagement.consult-authorization')" position="is-top"> + <b-button + icon-left="key" + outlined + rounded + type="is-warning" + @click="consultAuthorization" + /> + </b-tooltip> + </slot> </h1> </template> -<style scoped lang="scss"> +<style lang="scss" scoped> .icon { vertical-align: text-top; } diff --git a/src/components/common/provider/FilterNumberOrDate.vue b/src/components/common/provider/FilterNumberOrDate.vue index f17ca8fef89711bec05d844d747f4e2db07479a0..7de4322946882770366b7435e9eb37f145e69b2f 100644 --- a/src/components/common/provider/FilterNumberOrDate.vue +++ b/src/components/common/provider/FilterNumberOrDate.vue @@ -1,13 +1,24 @@ <template> <div class="inputStyle"> <b-tooltip :label="$t('dataTypeAuthorizations.interval')" position="is-right"> - <b-switch - v-model="isInterval" - size="is-small" - @click.native="changeValueSizeHeight(isInterval, isInterval ? -6 : 6)" - > - {{ isInterval ? $t("rules.for-interval") : $t("rules.for-value") }} - </b-switch> + <b-field style="margin-bottom: 1rem"> + <b-radio-button + v-model="isInterval" + :native-value="false" + size="is-small" + type="is-primary is-outlined" + > + <span>{{ $t("rules.for-value") }}</span> + </b-radio-button> + <b-radio-button + v-model="isInterval" + :native-value="true" + size="is-small" + type="is-primary is-outlined" + > + <span>{{ $t("rules.for-interval") }}</span> + </b-radio-button> + </b-field> </b-tooltip> <div v-if="isInterval" class="rows"> <InputDateInterval @@ -76,7 +87,7 @@ export default { components: { InputNumber, InputNumberInterval, InputDateInterval, InputDate }, emits: ["update:modelValue", "sizeHeight"], props: { - modelValue: Object, + modelValue: Object }, setup(props, ctx) { watch( @@ -132,7 +143,7 @@ export default { y: { pattern: "\\d", type: "date" }, M: { pattern: "\\d", type: "date" }, Z: { pattern: "[+-]\\d{4}", type: "date" }, - G: { pattern: "[AB]D", type: "date" }, + G: { pattern: "[AB]D", type: "date" } }); const { refText: inputType, doChangeText: changeInputType } = useText("text"); const { refRegex: pattern, doChangeRegex: changePattern } = useRegex(); @@ -189,14 +200,14 @@ export default { } let value = isInterval.value ? { - intervalValues: { - from: from.value, - to: to.value, - }, + intervalValues: { + from: from.value, + to: to.value } + } : { - simpleValue: from.value, - }; + simpleValue: from.value + }; ctx.emit("update:modelValue", { ...props.modelValue, type: type.value, @@ -204,7 +215,7 @@ export default { format: format.value, intervalValues: value.intervalValues, simpleValue: value.simpleValue, - isInterval: isInterval.value, + isInterval: isInterval.value }); } @@ -212,7 +223,7 @@ export default { isInterval.value = collapside; if (event) { ctx.emit("sizeHeight", { - value: event, + value: event }); } return isInterval.value; @@ -233,9 +244,9 @@ export default { fromDate, min, max, - isInterval, + isInterval }; - }, + } }; </script> diff --git a/src/components/common/provider/FiltersDataCollapse.vue b/src/components/common/provider/FiltersDataCollapse.vue index 10b5f9a97431f9cdb9a42e3e91fa1942b381d156..cb0f1c6258c52616968878210bfbe9e639415310 100644 --- a/src/components/common/provider/FiltersDataCollapse.vue +++ b/src/components/common/provider/FiltersDataCollapse.vue @@ -3,7 +3,8 @@ <template #trigger="props"> <div class="card-header" role="button"> <p class="card-header-title" style="text-transform: capitalize"> - {{ $t("applications.advancedFilter") }} + <b-icon icon="sliders-h"></b-icon> + <span>{{ $t("applications.advancedFilter") }}</span> </p> <a class="card-header-icon"> <b-icon :icon="props.open ? 'chevron-up' : 'chevron-down'"></b-icon> diff --git a/src/locales/en.json b/src/locales/en.json index ad4c4992a673bc1cf64530483b4727ceb8e18149..f15588959f3c289a20309be5d378b7f260dd3c4f 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -120,7 +120,7 @@ "applications": { "actions": "Actions", "additionalFile": "Additional files", - "advancedFilter": "Advanced search", + "advancedFilter": "Filter", "app_version": "Current version of {name} is: {version}", "app_update_version": "Version of {name} proposed is: {version}", "change": "Update", diff --git a/src/locales/fr.json b/src/locales/fr.json index c2c675108f0d3691984cb51708d1c6bd50f7b263..8b54fd9baf331eabd6d83f6b7ef0f6e3ce52c71a 100644 --- a/src/locales/fr.json +++ b/src/locales/fr.json @@ -120,7 +120,7 @@ "applications": { "actions": "Actions", "additionalFile": "Fichiers additionnels", - "advancedFilter": "Recherche avancée", + "advancedFilter": "Filtrer", "app_version": "Version actuelle de {name} est : {version}", "app_update_version": "Version de {name} proposée est : {version}", "change": "Mise à jour", @@ -971,7 +971,7 @@ "integer": "Le champ doit correspondre à une valeur entière", "regexp": "Le champ doit correspondre à l'expression régulière {pattern}", "not-null": "Le champ ne doit pas être vide", - "for-interval": "par interval", + "for-interval": "par intervalle", "for-value": "par valeur" }, "tags": { diff --git a/src/main.js b/src/main.js index db8801a46c8c4344adada51b7c1871df21546249..5cc374f6593fced6c4fe5dd0382e3e90f3ac3b7e 100644 --- a/src/main.js +++ b/src/main.js @@ -82,7 +82,7 @@ import { faArrowRight, faExchangeAlt, faUserShield, - faCity, + faCity, faArrowsAltV, faArrowsAltH, faSlidersH, faUsers } from "@fortawesome/free-solid-svg-icons"; import { faCalendar as farCalendar, @@ -117,6 +117,10 @@ library.add( farTimesCircle ); library.add( + faArrowsAltV, + faArrowsAltH, + faUsers, + faSlidersH, faUsersCog, faUserShield, faLink, diff --git a/src/views/authorizations/DataTypeAuthorizationsView.vue b/src/views/authorizations/DataTypeAuthorizationsView.vue index ea6054af732e0f781dcf5ad17673b9b8d77216cb..8295e675cd2012a06edf2429647978397a9a4b23 100644 --- a/src/views/authorizations/DataTypeAuthorizationsView.vue +++ b/src/views/authorizations/DataTypeAuthorizationsView.vue @@ -22,19 +22,28 @@ <div class="row"> <div class="columns" style="margin: 0"> <div class="column is-2"> - <b-switch - v-model="hasAuthorizationsByUsers" - :disabled="hasPublicAuthorizations" - passive-type="is-dark" - type="is-primary" - @input="updateTableAuthorizations" - > - {{ - hasAuthorizationsByUsers - ? $t("dataTypeAuthorizations.table-auth-users") - : $t("dataTypeAuthorizations.table-auth-name") - }} - </b-switch> + <b-field> + <b-radio-button + v-model="hasAuthorizationsByUsers" + :disabled="hasPublicAuthorizations" + :native-value="true" + type="is-primary is-outlined" + @input="updateTableAuthorizations" + > + <b-icon icon="users"></b-icon> + <span>{{ $t("dataTypeAuthorizations.table-auth-users") }}</span> + </b-radio-button> + <b-radio-button + v-model="hasAuthorizationsByUsers" + :disabled="hasPublicAuthorizations" + :native-value="false" + type="is-primary is-outlined" + @input="updateTableAuthorizations" + > + <b-icon icon="key"></b-icon> + <span>{{ $t("dataTypeAuthorizations.table-auth-name") }}</span> + </b-radio-button> + </b-field> </div> <div class="column is-2"> <b-checkbox diff --git a/src/views/data/DataTableView.vue b/src/views/data/DataTableView.vue index 9d3f8384851de44f8acefd09b8b9ae18b513f135..2c3a595368ca705784c2dae09d853dc627b92211 100644 --- a/src/views/data/DataTableView.vue +++ b/src/views/data/DataTableView.vue @@ -8,9 +8,9 @@ /> <TitleAndDescription :application="application" + :local-title="$t('titles.references-data', { refName: application.localRefName })" :localDescription="application.localRefDescription" :localName="application.localRefName" - :local-title="$t('titles.references-data', { refName: application.localRefName })" /> <div id="tagsCollapsereal" class="column"> <TagsCollapse @@ -33,22 +33,35 @@ /> <LoadingAnimate v-if="isLoading" :size="'is-large'"></LoadingAnimate> <div v-if="data && dataColumnsToBeShown && !isLoading && totalRows > 0"> - <b-switch v-if="canHorizontalize" v-model="horizontalDisplay" @input="changeDisplay"> - {{ - horizontalDisplay - ? $t("dataTypesManagement.horizontalized") - : $t("dataTypesManagement.verticalized") - }} - </b-switch> + <b-field v-if="canHorizontalize"> + <b-radio-button + v-model="horizontalDisplay" + :native-value="true" + type="is-dark" + @input="changeDisplay" + > + <b-icon icon="arrows-alt-h"></b-icon> + <span>{{ $t("dataTypesManagement.horizontalized") }}</span> + </b-radio-button> + <b-radio-button + v-model="horizontalDisplay" + :native-value="false" + type="is-dark" + @input="changeDisplay" + > + <b-icon icon="arrows-alt-v"></b-icon> + <span>{{ $t("dataTypesManagement.verticalized") }}</span> + </b-radio-button> + </b-field> <b-table id="filtreTable" :current-page="currentPage" :data="rows" + :height="tableHeight" :is-focusable="true" :is-hoverable="true" :per-page="params.limit" :sticky-header="true" - :height="tableHeight" striped style="padding-bottom: 20px; position: relative; z-index: 2" > @@ -56,8 +69,8 @@ v-for="column in dataColumnsToBeShown" :key="column.id" :field="column.id" - style="padding-bottom: 20px; position: relative; z-index: 2" sortable + style="padding-bottom: 20px; position: relative; z-index: 2" > <template v-slot:header> <div v-if="column.tags" class="column" style="padding: 0"> @@ -68,28 +81,28 @@ </TagsInfos> <DatasPatternLink v-if="'PatternComponent' === column.type" - :with-qualifier="horizontalDisplay" - :info="column.type === 'PatternComponent'" :application="application" - :value=" + :column-id="column.id" + :column-title="column.id" + :data-id="dataId" + :info="column.type === 'PatternComponent'" + :info-values=" column.getColumnQualifiersMap( application, column.horizontalDisplay ? dataId : column.componentKey, rows[0] ) " - :column-id="column.id" - :column-title="column.id" - :info-values=" + :loaded-references-by-key="{}" + :pattern-checker-date-ref="patternCheckerDateRef" + :value=" column.getColumnQualifiersMap( application, column.horizontalDisplay ? dataId : column.componentKey, rows[0] ) " - :loaded-references-by-key="{}" - :pattern-checker-date-ref="patternCheckerDateRef" - :data-id="dataId" + :with-qualifier="horizontalDisplay" ></DatasPatternLink> <div v-else-if="'patternQualifierComponent' === column.type"> {{ column.getHeader(application, dataId) }} @@ -127,8 +140,8 @@ :column="column" :column-id="column.id" :component="props.row" - :info-values="props.row.values[column.id]" :displays-for-row="props.row.displaysForRow" + :info-values="props.row.values[column.id]" :loaded-references-by-key="{}" :multiplicity="multiplicity(column.id, props.row.values[column.id])" :reference-type="addRefLinkedTo(column.id, column.linkedTo)" @@ -168,7 +181,7 @@ </b-table> </div> <div v-else> - <b-message type="is-primary" :closable="false" size="is-medium" has-icon> + <b-message :closable="false" has-icon size="is-medium" type="is-primary"> {{ $tc("applications.register-rows", totalRows, { totalRows: totalRows }) }} </b-message> </div> @@ -176,17 +189,17 @@ <div class="buttons" style="margin-top: 16px"> <!-- <b-button @click="loadExampleData">Afficher un exemple</b-button>--> <b-button + icon-left="download" style="margin-bottom: 15px; float: right" type="is-primary" - icon-left="download" @click.prevent="downloadResultSearch" - >{{ $t("dataTable.donwload-result") }} + >{{ $t("dataTable.donwload-result") }} </b-button> </div> </div> <div v-else-if="state === 'NO-RIGHTS'"> - <b-message type="is-danger" :closable="false" size="is-medium" has-icon> + <b-message :closable="false" has-icon size="is-medium" type="is-danger"> {{ $t("applications.no-right-for-application") }} </b-message> <b-button @@ -198,7 +211,7 @@ </b-button> </div> <div v-else> - <b-message type="is-primary" :closable="false" size="is-medium" has-icon> + <b-message :closable="false" has-icon size="is-medium" type="is-primary"> {{ $tc("applications.register-rows", totalRows, { totalRows: totalRows }) }} </b-message> </div> @@ -239,7 +252,7 @@ export default { name: "DataTableView", props: { applicationName: String, - dataId: String, + dataId: String }, components: { TitleAndDescription, @@ -252,7 +265,7 @@ export default { TagsCollapse, DatasLink, DatasManyLink, - DatasDynamicLink, + DatasDynamicLink }, setup(props) { const loadExample = ref(true); @@ -334,7 +347,7 @@ export default { }); const hasTags = useBoolean(false).refBoolean; - const changeTags = function (tagsToChange) { + const changeTags = function(tagsToChange) { _changeTags({ ...tagsToChange }); hasTags.value = tags.value && @@ -397,7 +410,7 @@ export default { `/applications/${props.applicationName}/${dataIsType}/${props.dataId}` ), () => app.$router.push(`/applications/${props.applicationName}/${dataIsType}`) - ), + ) ]); changeColumns(services.tagService.toBeShown(tags.value, columns.value)); changeTags(buildTagsColumns(application, columns.value, tags.value)); @@ -409,14 +422,14 @@ export default { changeApplication( await services.applicationService.getApplication(props.applicationName, [ "CONFIGURATION", - "REFERENCETYPE", + "REFERENCETYPE" ]) ); changeApplication({ ...services.internationalisationService.mergeInternationalization(application), localRefName: application.configuration.i18n.data[props.dataId].i18n.title[locale], localRefDescription: - application.configuration.i18n.data[props.dataId].i18n.description[locale], + application.configuration.i18n.data[props.dataId].i18n.description[locale] }); totalRows.value = application.referenceSynthesis.find( @@ -428,7 +441,7 @@ export default { { horizontalDisplay: horizontalDisplay.value, offset: params.offset, - limit: params.limit, + limit: params.limit }, loadExample.value ); @@ -533,7 +546,7 @@ export default { .reduce((accumulator, component) => { accumulator.push(component); return accumulator; - }, []), + }, []) ]; changeColumns(localColumns); if (rows.value) { @@ -737,9 +750,9 @@ export default { tableHeight, loader, canHorizontalize, - horizontalDisplay, + horizontalDisplay }; - }, + } }; </script> <style lang="scss" scoped> diff --git a/src/views/data/DatasManagementView.vue b/src/views/data/DatasManagementView.vue index 59c67ea74d1cdd8108c022d7f864781f47098572..bc73506140da17eae32378ecc3892f49b586f3ba 100644 --- a/src/views/data/DatasManagementView.vue +++ b/src/views/data/DatasManagementView.vue @@ -19,21 +19,12 @@ " :localDescription="application.localDescription" :localName="application.localName" + :with-auth="true" + :can-create-application="canCreateApplication" + :can-manager-application="canManagerApplication" + :can-manager-user="canManagerUser" + :application-name="applicationName" /> - <div - v-if="canCreateApplication || canManagerApplication || canManagerUser" - class="btn_auth_tooltip" - > - <b-tooltip :label="$t('dataTypesManagement.consult-authorization')" position="is-top"> - <b-button - icon-left="key" - outlined - rounded - type="is-warning" - @click="consultAuthorization" - /> - </b-tooltip> - </div> <div v-if="errorsMessages.length !== 0" style="margin: 10px"> <ShowErrors :errors-messages="errorsMessages"