Initial Nuxt frontend import
Some checks failed
continuous-integration/drone/push Build is failing

- Complete GGZ Ecademy Nuxt.js user portal
- Learning products browser and management
- Member management interface
- User authentication and roles
- Multi-language support (NL/EN)
- Vuex store for state management
- Component-based architecture
This commit is contained in:
Joris Slagter
2025-12-02 17:48:48 +01:00
parent 0f691e83e3
commit 791aebc346
290 changed files with 113801 additions and 0 deletions

53
store/utils.js Normal file
View File

@@ -0,0 +1,53 @@
import isEqual from 'lodash.isequal';
// export const state = () => ({});
export const getters = {
// console.log(this.$store.getters['utils/areEquals'](1, 1)) // It works
areEquals: (state) => (input1, input2) => isEqual(input1, input2),
isNotEmptyObj: (state) => (obj) => Object.keys(obj).length > 0,
filterArrayObjsByArrayOfProperties: (state) => (arrayObjs, arrayProperties) => {
const filteredData = arrayObjs.map((row) => {
const obj = {}
arrayProperties.forEach(property => obj[property] = row[property]);
return obj;
})
return filteredData;
},
arrayOfObjectToCsv: (state) => (data) => {
const headers = Object.keys(data[0])
const csvRows = []
for (const row of data) {
const values = headers.map((header) => {
const tmpArray = []
if (row[header]) {
// Replacing commas with whitespaces
tmpArray.push(row[header].replace(/,/g, ""))
return tmpArray
}
return '-'
})
csvRows.push([values.join(',')])
}
const csvString = [
[...headers],
...csvRows,
]
.map(e => e.join(","))
.join("\n");
return csvString
},
}