diff --git a/backend/functions/src/index.ts b/backend/functions/src/index.ts
index a87f6ea..2177e90 100644
--- a/backend/functions/src/index.ts
+++ b/backend/functions/src/index.ts
@@ -60,6 +60,7 @@ env.pusher && initializePusher(env.pusher);
initializeJomql(app, jomqlOptions);
app.get("/schema.ts", function (req, res, next) {
+ res.header("Content-Type", "text/plain");
const tsSchemaGenerator = new CustomSchemaGenerator(jomqlOptions);
tsSchemaGenerator.buildSchema();
tsSchemaGenerator.processSchema();
diff --git a/frontend/layouts/default.vue b/frontend/layouts/default.vue
index 2f9df9a..c5f6ec7 100644
--- a/frontend/layouts/default.vue
+++ b/frontend/layouts/default.vue
@@ -59,9 +59,9 @@
-
+
- this.canSee(item.roles, item.permissions)
- )
- },
-
visibleNavItems() {
return this.navItems.filter(
(item) => this.$store.getters['auth/user'] || !item.loginRequired
@@ -393,6 +346,25 @@ export default {
? '/user?id=' + this.$store.getters['auth/user'].id
: null
},
+ isAdmin() {
+ return this.$store.getters['auth/user']?.role === 'ADMIN'
+ },
+ adminItems() {
+ return [
+ {
+ action: 'mdi-star',
+ active: false,
+ title: 'Administration',
+ permissions: [],
+ items: Object.values(models).map((recordInfo) => ({
+ title: capitalizeString(recordInfo.pluralName),
+ to: '/admin/' + recordInfo.pluralType,
+ roles: ['ADMIN'],
+ permissions: [],
+ })),
+ },
+ ]
+ },
},
methods: {
diff --git a/frontend/models/event.ts b/frontend/models/event.ts
index ec081cb..c7dfcd4 100644
--- a/frontend/models/event.ts
+++ b/frontend/models/event.ts
@@ -3,6 +3,7 @@ import TimeagoColumn from '~/components/table/common/timeagoColumn.vue'
export const Event = >{
type: 'event',
+ pluralType: 'events',
name: 'Event',
pluralName: 'Events',
icon: 'mdi-view-grid',
diff --git a/frontend/models/personalBest.ts b/frontend/models/personalBest.ts
index 1f74d9c..9030f3e 100644
--- a/frontend/models/personalBest.ts
+++ b/frontend/models/personalBest.ts
@@ -11,6 +11,7 @@ import { serializeTime } from '~/services/common'
export const PersonalBest = >{
type: 'personalBest',
+ pluralType: 'personalBests',
name: 'Personal Best',
pluralName: 'Personal Bests',
// viewRecordRoute: '/pb',
diff --git a/frontend/models/personalBestClass.ts b/frontend/models/personalBestClass.ts
index 9925e8b..768fef0 100644
--- a/frontend/models/personalBestClass.ts
+++ b/frontend/models/personalBestClass.ts
@@ -3,6 +3,7 @@ import TimeagoColumn from '~/components/table/common/timeagoColumn.vue'
export const PersonalBestClass = >{
type: 'personalBestClass',
+ pluralType: 'personalBestClasses',
name: 'Personal Best Type',
pluralName: 'Personal Best Types',
icon: 'mdi-content-copy',
diff --git a/frontend/models/product.ts b/frontend/models/product.ts
index fe005ec..0f99521 100644
--- a/frontend/models/product.ts
+++ b/frontend/models/product.ts
@@ -3,6 +3,7 @@ import TimeagoColumn from '~/components/table/common/timeagoColumn.vue'
export const Product = >{
type: 'product',
+ pluralType: 'products',
name: 'Product',
pluralName: 'Products',
icon: 'mdi-dots-grid',
diff --git a/frontend/models/user.ts b/frontend/models/user.ts
index a1acfad..83d80c2 100644
--- a/frontend/models/user.ts
+++ b/frontend/models/user.ts
@@ -6,6 +6,7 @@ import { getBooleanOptions, getUserRoles } from '~/services/dropdown'
export const User = >{
type: 'user',
+ pluralType: 'users',
name: 'User',
pluralName: 'Users',
icon: 'mdi-account',
diff --git a/frontend/types/index.ts b/frontend/types/index.ts
index 64f16d6..c7c8466 100644
--- a/frontend/types/index.ts
+++ b/frontend/types/index.ts
@@ -3,6 +3,7 @@ import { InputTypes, MainTypes, FilterByField } from '~/types/schema'
export type RecordInfo = {
// name of the type
type: T
+ pluralType: string
name: string
pluralName: string
// route that shareUrl and enterItem should be based off