@@ -58,6 +62,8 @@ import ErrorSpan from "@/components/ErrorSpan.vue";
import CalendarString from "@/components/CalendarString.vue";
import type { HintedString } from "primevue/ts-helpers";
+import InputNumber from "primevue/inputnumber";
+import { userTypes } from "@/utils/validation-schema";
const props = defineProps({
label: {
@@ -100,7 +106,8 @@ const props = defineProps({
const emit = defineEmits(['update:value']);
const stringInputs = ['text', 'textarea'];
-const numberInputs = ['currency', 'percentage', 'number'];
+
+const numberInputs = ['currency', 'number', 'usertype', 'percentage'];
const booleanInputs = ['boolean'];
const initialValue = () => {
diff --git a/apps/dashboard/src/locales/en.json b/apps/dashboard/src/locales/en.json
index 403504a4..43575ef2 100644
--- a/apps/dashboard/src/locales/en.json
+++ b/apps/dashboard/src/locales/en.json
@@ -275,7 +275,8 @@
"pointOfSaleCreated": "Successfully created point of sale.",
"waiveFinesSuccess": "Successfully waived fines.",
"waiveFinesRejected": "Canceled waiving fines.",
- "canceled": "Canceled"
+ "canceled": "Canceled",
+ "userUpdated": "Successfully updated user."
},
"termsOfService": {
"acceptFirst": "Accept the Terms of Service",
@@ -324,7 +325,8 @@
"Usertype": "Usertype",
"passwordUpdated": "Password successfully updated",
"updatedUserInfo": "Succesfully updated user info.",
- "userInfoUpdated": "User information successfully updated"
+ "userInfoUpdated": "User information successfully updated",
+ "userInformation": "User information"
},
"contact": {
"Contact": "Contact",
diff --git a/apps/dashboard/src/locales/nl.json b/apps/dashboard/src/locales/nl.json
index 810108ba..f6d8e0df 100644
--- a/apps/dashboard/src/locales/nl.json
+++ b/apps/dashboard/src/locales/nl.json
@@ -276,7 +276,8 @@
"pointOfSaleCreated": "Point of sale is successvol aangemaakt.",
"waiveFinesSuccess": "Boetes zijn succesvol kwijtgescholden.",
"waiveFinesRejected": "Boetes zijn succesvol afgewezen.",
- "canceled": "Geannuleerd"
+ "canceled": "Geannuleerd",
+ "userUpdated": "Gebruiker is succesvol geüpdatet."
},
"termsOfService": {
"acceptFirst": "Accepteer de Voorwaarden",
@@ -325,7 +326,8 @@
"Usertype": "Gebruikerstype",
"passwordUpdated": "Wachtwoord is succesvol geüpdatet",
"updatedUserInfo": "Profiel is succesvol geüpdatet.",
- "userInfoUpdated": "Profiel is succesvol aangepast"
+ "userInfoUpdated": "Profiel is succesvol aangepast",
+ "userInformation": "Gebruikersinformatie"
},
"validation": {
"number": {
diff --git a/apps/dashboard/src/main.ts b/apps/dashboard/src/main.ts
index 8dcb4687..71c4c433 100644
--- a/apps/dashboard/src/main.ts
+++ b/apps/dashboard/src/main.ts
@@ -81,6 +81,7 @@ app.component('ToggleButton', ToggleButton);
app.component('Steps', Steps);
app.component('Calendar', Calendar);
app.component('ConfirmDialog', ConfirmDialog);
+app.component('InputSwitch', InputSwitch);
populateStoresFromToken(apiService).then(() => {
app.mount('#app');
diff --git a/apps/dashboard/src/mixins/pendingPayoutsMixin.ts b/apps/dashboard/src/mixins/pendingPayoutsMixin.ts
index d8acaf5e..bbb3f2ca 100644
--- a/apps/dashboard/src/mixins/pendingPayoutsMixin.ts
+++ b/apps/dashboard/src/mixins/pendingPayoutsMixin.ts
@@ -1,5 +1,5 @@
// src/mixins/pendingPayoutsMixin.ts
-import { computed, type ComputedRef, watch } from 'vue';
+import { computed, watch } from 'vue';
import { usePayoutStore } from '@/stores/payout.store';
import { useUserStore } from '@sudosos/sudosos-frontend-common';
import { UserRole } from '@/utils/rbacUtils';
diff --git a/apps/dashboard/src/modules/admin/components/users/AdminUserInfoCard.vue b/apps/dashboard/src/modules/admin/components/users/AdminUserInfoCard.vue
new file mode 100644
index 00000000..cd33f350
--- /dev/null
+++ b/apps/dashboard/src/modules/admin/components/users/AdminUserInfoCard.vue
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/apps/dashboard/src/modules/admin/components/users/forms/UserEditForm.vue b/apps/dashboard/src/modules/admin/components/users/forms/UserEditForm.vue
new file mode 100644
index 00000000..1cdac105
--- /dev/null
+++ b/apps/dashboard/src/modules/admin/components/users/forms/UserEditForm.vue
@@ -0,0 +1,118 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/apps/dashboard/src/modules/admin/views/AdminSingleUserView.vue b/apps/dashboard/src/modules/admin/views/AdminSingleUserView.vue
index 1cf9b5d7..4a466fa2 100644
--- a/apps/dashboard/src/modules/admin/views/AdminSingleUserView.vue
+++ b/apps/dashboard/src/modules/admin/views/AdminSingleUserView.vue
@@ -1,118 +1,52 @@
-
-
{{ `${currentUser ? currentUser.firstName : ''}'s profile` }}
-
-
+s
\ No newline at end of file
+
diff --git a/apps/dashboard/src/router/index.ts b/apps/dashboard/src/router/index.ts
index 55712667..ea0de77c 100644
--- a/apps/dashboard/src/router/index.ts
+++ b/apps/dashboard/src/router/index.ts
@@ -75,7 +75,8 @@ router.beforeEach((to, from, next) => {
} else {
if(to.meta?.rolesAllowed) {
// Test overlapping roles between the allowed roles and the roles the user has
- const rolesUnion = [...new Set([...to.meta.rolesAllowed, ...userStore.current.rolesWithPermissions.map(r => r.name)])];
+ const rolesUnion =
+ [...new Set([...to.meta.rolesAllowed, ...userStore.current.rolesWithPermissions.map(r => r.name)])];
// No overlapping roles -> No correct permissions -> Back to home
if(rolesUnion.length == 0) ({ name: 'home' });
diff --git a/apps/dashboard/src/utils/validation-schema.ts b/apps/dashboard/src/utils/validation-schema.ts
index 68ac3239..a41f8684 100644
--- a/apps/dashboard/src/utils/validation-schema.ts
+++ b/apps/dashboard/src/utils/validation-schema.ts
@@ -55,6 +55,17 @@ export const updateInvoiceAddressingObject = yup.object({
country: yup.string().required(),
});
+export const updateUserDetailsObject = yup.object({
+ firstName: yup.string().required(),
+ lastName: yup.string(),
+ email: yup.string().email(),
+ nickname: yup.string().nullable(),
+ userType: yup.number().required(),
+ isActive: yup.boolean().required().default(true),
+ ofAge: yup.boolean().required().default(false),
+ canGoIntoDebt: yup.boolean().required().default(false),
+});
+
export const editPinSchema = toTypedSchema(
yup.object({
pin: yup.string().required()
diff --git a/apps/point-of-sale/package.json b/apps/point-of-sale/package.json
index 3316ee7a..87e2ec62 100644
--- a/apps/point-of-sale/package.json
+++ b/apps/point-of-sale/package.json
@@ -44,6 +44,7 @@
"@vue/eslint-config-prettier": "^9.0.0",
"@vue/eslint-config-typescript": "^12.0.0",
"@vue/tsconfig": "^0.5.1",
+ "axios": "^1.6.8",
"eslint": "^8.50.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-vue": "^9.15.1",
@@ -55,7 +56,6 @@
"sass": "^1.69.7",
"typescript": "^5.3.3",
"vite": "^5.0.11",
- "vue-tsc": "^2.0.29",
- "axios": "^1.6.8"
+ "vue-tsc": "^2.0.29"
}
}
diff --git a/yarn.lock b/yarn.lock
index 9e952bd2..71874320 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -5583,6 +5583,7 @@ __metadata:
"@vue/eslint-config-prettier": "npm:^9.0.0"
"@vue/eslint-config-typescript": "npm:^12.0.0"
"@vue/tsconfig": "npm:^0.5.1"
+ axios: "npm:^1.6.8"
dinero.js: "npm:^1.9.1"
eslint: "npm:^8.50.0"
eslint-plugin-github-commit-hash: "npm:^1.0.3"
@@ -5632,6 +5633,7 @@ __metadata:
"@vue/eslint-config-prettier": "npm:^9.0.0"
"@vue/eslint-config-typescript": "npm:^12.0.0"
"@vue/tsconfig": "npm:^0.5.1"
+ axios: "npm:^1.6.8"
bootstrap: "npm:^5.3.0"
dinero: "npm:^1.0.1"
dinero.js: "npm:^1.9.1"