From 84e93334ac1dfc45a52a3933df61e48f7ca886aa Mon Sep 17 00:00:00 2001 From: pabois <pierreandre.boissinot@noesya.coop> Date: Mon, 2 May 2022 16:53:08 +0200 Subject: [PATCH] wip mapping --- .../server/universities/_sso_mapping.html.erb | 24 +++++++++---------- config/locales/en.yml | 1 + config/locales/fr.yml | 1 + config/locales/university/en.yml | 2 ++ config/locales/university/fr.yml | 2 ++ 5 files changed, 17 insertions(+), 13 deletions(-) diff --git a/app/views/server/universities/_sso_mapping.html.erb b/app/views/server/universities/_sso_mapping.html.erb index 01b947c85..b1d1c249e 100644 --- a/app/views/server/universities/_sso_mapping.html.erb +++ b/app/views/server/universities/_sso_mapping.html.erb @@ -5,38 +5,32 @@ <div class="spinner-border text-primary" role="status"> <span class="sr-only"><%= t 'loading' %></span> </div> - <a v-on:click="fields.push({sso_key: '', internal_key: '', roles: {}})"> - <%= t '.add_field' %> - </a> - <draggable :list="fields" handle=".dragHandle"> + <draggable :list="fields" > <div v-for="(field, index) in fields"> <div class="card"> <div class="card-header d-flex justify-content-between pb-0"> - <a class="btn ps-0 pt-0 dragHandle"> - <i class="fa fa-bars handle"></i> - </a> - <a class="btn btn-sm btn-danger ms-3" + 1. {{ field.sso_key }} -> {{ field.internal_key}} + <a v-on:click="fields.splice(fields.indexOf(field), 1)" title="Remove field"> - Supprimer - <i class="fas fa-times"></i> + <i class="far fa-trash-alt"></i> </a> </div> <div class="card-body"> <div class="form-group"> - <label for="" class="form-control-label">SSO Key *</label> + <label for="" class="form-control-label"><%= t('university.sso_key') %> <abbr title="required">*</abbr></label> <input v-model="field.sso_key" type="text" class="form-control"> </div> <div class="form-group"> - <label for="" class="form-control-label">Internal Key *</label> + <label for="" class="form-control-label"><%= t('university.internal_key') %> <abbr title="required">*</abbr></label> <select v-model="field.internal_key" id="" class="form-select" required> <option value="email">Email</option> <option value="first_name">First Name</option> <option value="last_name">Last Name</option> - <option value="role">Role*</option> + <option value="role">Role</option> <option value="phone">Phone</option> <option value="language">Language</option> <option value="picture_url">Picture URL</option> @@ -55,6 +49,10 @@ </div> </draggable> + <a v-on:click="fields.push({sso_key: 'email', internal_key: 'key', roles: {}})" class="btn btn-primary btn-sm"> + <%= t 'add_field' %> + </a> + <textarea name="university[sso_mapping]" id="university_sso_mapping" rows="20" cols="200" class="d-none"> {{ JSON.stringify(fields) }} </textarea> diff --git a/config/locales/en.yml b/config/locales/en.yml index aeaae6cf5..49071105a 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -38,6 +38,7 @@ en: one: User other: Users add: Add + add_field: Add field admin: attachment_not_available: Attachment not available dashboard: Dashboard diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 98572ab51..ab257fa73 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -38,6 +38,7 @@ fr: one: Utilisateur·rice other: Utilisateur·rice·s add: Ajouter + add_field: Ajouter un champ admin: attachment_not_available: Impossible d'accéder à l'élément dashboard: Tableau de bord diff --git a/config/locales/university/en.yml b/config/locales/university/en.yml index 63a83a4e1..d70f1e241 100644 --- a/config/locales/university/en.yml +++ b/config/locales/university/en.yml @@ -125,8 +125,10 @@ en: non_profit: Association government: Government university: + internal_key: Internal Key invoice_informations: Invoice informations person: administrator_roles: Administrator roles taught_programs: Taught programs sso: SSO + sso_key: SSO Key diff --git a/config/locales/university/fr.yml b/config/locales/university/fr.yml index f263aead1..0b2c3c7ab 100644 --- a/config/locales/university/fr.yml +++ b/config/locales/university/fr.yml @@ -125,8 +125,10 @@ fr: non_profit: Association government: Structure gouvernementale university: + internal_key: Clé interne invoice_informations: Données de facturation person: administrator_roles: Rôles administratifs taught_programs: Formations enseignées sso: SSO + sso_key: Clé sur le SSO -- GitLab