diff --git a/fittrackee_client/src/components/Administration/AdminMenu.vue b/fittrackee_client/src/components/Administration/AdminMenu.vue index 45d92ef8..30ad25b0 100644 --- a/fittrackee_client/src/components/Administration/AdminMenu.vue +++ b/fittrackee_client/src/components/Administration/AdminMenu.vue @@ -24,14 +24,18 @@
- + {{ capitalize($t('workouts.SPORT', 0)) }}
{{ $t('admin.ENABLE_DISABLE_SPORTS') }}
-
{{ capitalize($t('admin.USER', 0)) }}
+
+ + {{ capitalize($t('admin.USER', 0)) }} + +
{{ $t('admin.ADMIN_RIGHTS_DELETE_USER_ACCOUNT') }}
diff --git a/fittrackee_client/src/components/Administration/AdminSports.vue b/fittrackee_client/src/components/Administration/AdminSports.vue index dc665741..99859d9e 100644 --- a/fittrackee_client/src/components/Administration/AdminSports.vue +++ b/fittrackee_client/src/components/Administration/AdminSports.vue @@ -17,7 +17,7 @@ {{ $t('admin.SPORTS.TABLE.ACTIVE') }} - {{ $t('admin.SPORTS.TABLE.ACTION') }} + {{ $t('admin.ACTION') }} @@ -123,9 +123,6 @@ font-size: 1.1em; } } - .center-text { - text-align: center; - } .sport-img { height: 35px; width: 35px; diff --git a/fittrackee_client/src/components/Administration/AdminUsers.vue b/fittrackee_client/src/components/Administration/AdminUsers.vue new file mode 100644 index 00000000..21189054 --- /dev/null +++ b/fittrackee_client/src/components/Administration/AdminUsers.vue @@ -0,0 +1,209 @@ + + + + + diff --git a/fittrackee_client/src/components/Common/Pagination.vue b/fittrackee_client/src/components/Common/Pagination.vue new file mode 100644 index 00000000..d27532aa --- /dev/null +++ b/fittrackee_client/src/components/Common/Pagination.vue @@ -0,0 +1,120 @@ + + + + + diff --git a/fittrackee_client/src/locales/en/administration.json b/fittrackee_client/src/locales/en/administration.json index 0f91c416..4ec4a019 100644 --- a/fittrackee_client/src/locales/en/administration.json +++ b/fittrackee_client/src/locales/en/administration.json @@ -1,4 +1,5 @@ { + "ACTION": "Action", "ADMIN_RIGHTS_DELETE_USER_ACCOUNT": "Add/remove admin rights, delete user account.", "ADMIN": "Admin", "ADMINISTRATION": "Administration", @@ -17,7 +18,6 @@ "REGISTRATION_ENABLED": "Registration is currently enabled.", "SPORTS": { "TABLE": { - "ACTION": "Action", "ACTIVE": "Active", "HAS_WORKOUTS": "workouts exist", "IMAGE": "Image", @@ -26,5 +26,11 @@ "TITLE": "Sports administration" }, "UPDATE_APPLICATION_DESCRIPTION": "Update application configuration (maximum number of registered users, maximum files size).", - "USER": "user | users" + "USER": "user | users", + "USERS": { + "TABLE": { + "ADD_ADMIN_RIGHTS": "Add admin rights", + "REMOVE_ADMIN_RIGHTS": "Remove admin rights" + } + } } diff --git a/fittrackee_client/src/locales/en/api.json b/fittrackee_client/src/locales/en/api.json index 56a6ab6b..026ecd42 100644 --- a/fittrackee_client/src/locales/en/api.json +++ b/fittrackee_client/src/locales/en/api.json @@ -16,5 +16,9 @@ "Signature expired, Please log in again": "Signature expired. Please log in again.", "Username: 3 to 12 characters required": "Username: 3 to 12 characters required.", "Valid email must be provided": "Valid email must be provided." + }, + "PAGINATION": { + "PREVIOUS": "previous", + "NEXT": "next" } } \ No newline at end of file diff --git a/fittrackee_client/src/locales/en/user.json b/fittrackee_client/src/locales/en/user.json index a1d4ff0c..877cd41f 100644 --- a/fittrackee_client/src/locales/en/user.json +++ b/fittrackee_client/src/locales/en/user.json @@ -1,4 +1,5 @@ { + "ADMIN": "Admin", "CONFIRM_ACCOUNT_DELETION": "Are you sure you want to delete your account? All data will be deleted, this cannot be undone", "EMAIL": "Email", "ENTER_EMAIL": "Enter an email address", diff --git a/fittrackee_client/src/locales/fr/administration.json b/fittrackee_client/src/locales/fr/administration.json index 78131348..1efa4590 100644 --- a/fittrackee_client/src/locales/fr/administration.json +++ b/fittrackee_client/src/locales/fr/administration.json @@ -1,4 +1,5 @@ { + "ACTION": "Action", "ADMIN_RIGHTS_DELETE_USER_ACCOUNT": "Ajouter/retirer des droits d'adminsitration, supprimer des comptes utilisateurs.", "ADMIN": "Admin", "ADMINISTRATION": "Administration", @@ -17,7 +18,6 @@ "REGISTRATION_ENABLED": "Les inscriptions sont actuellement activées.", "SPORTS": { "TABLE": { - "ACTION": "Action", "ACTIVE": "Actif", "HAS_WORKOUTS": "des séances existent", "IMAGE": "Image", @@ -26,5 +26,11 @@ "TITLE": "Administration - Sports" }, "UPDATE_APPLICATION_DESCRIPTION": "Configurer l'application (nombre maximum d'utilisateurs inscrits, taille maximale des fichers).", - "USER": "utilisateur | utilisateurs" + "USER": "utilisateur | utilisateurs", + "USERS": { + "TABLE": { + "ADD_ADMIN_RIGHTS": "Ajouter les drois d'admin", + "REMOVE_ADMIN_RIGHTS": "Retirer les drois d'admin" + } + } } diff --git a/fittrackee_client/src/locales/fr/api.json b/fittrackee_client/src/locales/fr/api.json index 0a842b69..d8d1ecb9 100644 --- a/fittrackee_client/src/locales/fr/api.json +++ b/fittrackee_client/src/locales/fr/api.json @@ -16,5 +16,9 @@ "Signature expired, Please log in again": "Signature expirée. Merci de vous reconnecter.", "Username: 3 to 12 characters required": "3 à 12 caractères requis pour le nom.", "Valid email must be provided": "L'email fourni n'est pas valide." + }, + "PAGINATION": { + "PREVIOUS": "précédent", + "NEXT": "suivant" } } \ No newline at end of file diff --git a/fittrackee_client/src/locales/fr/user.json b/fittrackee_client/src/locales/fr/user.json index a07b83ae..686ec4fa 100644 --- a/fittrackee_client/src/locales/fr/user.json +++ b/fittrackee_client/src/locales/fr/user.json @@ -1,4 +1,5 @@ { + "ADMIN": "Admin", "CONFIRM_ACCOUNT_DELETION": "Etes-vous sûr de vouloir supprimer votre compte ? Toutes les données seront définitivement effacés.", "EMAIL": "Email", "ENTER_EMAIL": "Saisir une adresse email", diff --git a/fittrackee_client/src/router/index.ts b/fittrackee_client/src/router/index.ts index 76171985..47fde7de 100644 --- a/fittrackee_client/src/router/index.ts +++ b/fittrackee_client/src/router/index.ts @@ -3,6 +3,7 @@ import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router' import AdminApplication from '@/components/Administration/AdminApplication.vue' import AdminMenu from '@/components/Administration/AdminMenu.vue' import AdminSports from '@/components/Administration/AdminSports.vue' +import AdminUsers from '@/components/Administration/AdminUsers.vue' import Profile from '@/components/User/ProfileDisplay/index.vue' import UserInfos from '@/components/User/ProfileDisplay/UserInfos.vue' import UserPreferences from '@/components/User/ProfileDisplay/UserPreferences.vue' @@ -192,6 +193,11 @@ const routes: Array = [ name: 'SportsAdministration', component: AdminSports, }, + { + path: 'users', + name: 'UsersAdministration', + component: AdminUsers, + }, ], }, { diff --git a/fittrackee_client/src/scss/base.scss b/fittrackee_client/src/scss/base.scss index 6d92bbda..8d6a7489 100644 --- a/fittrackee_client/src/scss/base.scss +++ b/fittrackee_client/src/scss/base.scss @@ -232,6 +232,10 @@ button { } } +.center-text { + text-align: center; +} + .responsive-table { margin-bottom: 15px; /* responsive table, adapted from: */ diff --git a/fittrackee_client/src/store/modules/users/actions.ts b/fittrackee_client/src/store/modules/users/actions.ts index b6410df2..ac77ae7b 100644 --- a/fittrackee_client/src/store/modules/users/actions.ts +++ b/fittrackee_client/src/store/modules/users/actions.ts @@ -24,7 +24,7 @@ export const actions: ActionTree & IUsersActions = { ) context.commit( USERS_STORE.MUTATIONS.UPDATE_USERS_PAGINATION, - res.data.data.pagination + res.data.pagination ) } else { handleError(context, null)