Browse Source

Move middleware from layout to page

pull/2208/head
Hironsan 1 year ago
parent
commit
c219ce9752
15 changed files with 18 additions and 12 deletions
  1. 2
      frontend/layouts/project.vue
  2. 2
      frontend/pages/projects/_id/comments/index.vue
  3. 2
      frontend/pages/projects/_id/dataset/_example_id/edit.vue
  4. 2
      frontend/pages/projects/_id/dataset/export.vue
  5. 2
      frontend/pages/projects/_id/dataset/import.vue
  6. 2
      frontend/pages/projects/_id/dataset/index.vue
  7. 2
      frontend/pages/projects/_id/guideline/index.vue
  8. 2
      frontend/pages/projects/_id/index.vue
  9. 2
      frontend/pages/projects/_id/labels/_label_id/edit.vue
  10. 2
      frontend/pages/projects/_id/labels/add.vue
  11. 2
      frontend/pages/projects/_id/labels/import.vue
  12. 2
      frontend/pages/projects/_id/labels/index.vue
  13. 2
      frontend/pages/projects/_id/members/index.vue
  14. 2
      frontend/pages/projects/_id/metrics/index.vue
  15. 2
      frontend/pages/projects/_id/settings/index.vue

2
frontend/layouts/project.vue

@ -33,8 +33,6 @@ export default {
TheHeader
},
middleware: ['check-auth', 'auth', 'setCurrentProject'],
data() {
return {
drawerLeft: null,

2
frontend/pages/projects/_id/comments/index.vue

@ -42,7 +42,7 @@ export default Vue.extend({
layout: 'project',
middleware: ['isProjectAdmin'],
middleware: ['check-auth', 'auth', 'setCurrentProject', 'isProjectAdmin'],
validate({ params }) {
return /^\d+$/.test(params.id)

2
frontend/pages/projects/_id/dataset/_example_id/edit.vue

@ -27,7 +27,7 @@ import { ExampleDTO } from '~/services/application/example/exampleData'
export default Vue.extend({
layout: 'project',
middleware: ['isProjectAdmin'],
middleware: ['check-auth', 'auth', 'setCurrentProject', 'isProjectAdmin'],
validate({ params, app }) {
if (/^\d+$/.test(params.id) && /^\d+$/.test(params.example_id)) {

2
frontend/pages/projects/_id/dataset/export.vue

@ -44,7 +44,7 @@ import { Format } from '~/domain/models/download/format'
export default Vue.extend({
layout: 'project',
middleware: ['isProjectAdmin'],
middleware: ['check-auth', 'auth', 'setCurrentProject', 'isProjectAdmin'],
validate({ params }) {
return /^\d+$/.test(params.id)

2
frontend/pages/projects/_id/dataset/import.vue

@ -105,7 +105,7 @@ export default {
layout: 'project',
middleware: ['isProjectAdmin'],
middleware: ['check-auth', 'auth', 'setCurrentProject', 'isProjectAdmin'],
validate({ params }) {
return /^\d+$/.test(params.id)

2
frontend/pages/projects/_id/dataset/index.vue

@ -90,6 +90,8 @@ export default Vue.extend({
layout: 'project',
middleware: ['check-auth', 'auth', 'setCurrentProject'],
validate({ params, query }) {
// @ts-ignore
return /^\d+$/.test(params.id) && /^\d+|$/.test(query.limit) && /^\d+|$/.test(query.offset)

2
frontend/pages/projects/_id/guideline/index.vue

@ -24,7 +24,7 @@ export default {
layout: 'project',
middleware: ['isProjectAdmin'],
middleware: ['check-auth', 'auth', 'setCurrentProject', 'isProjectAdmin'],
validate({ params }) {
return /^\d+$/.test(params.id)

2
frontend/pages/projects/_id/index.vue

@ -28,6 +28,8 @@
export default {
layout: 'project',
middleware: ['check-auth', 'auth', 'setCurrentProject'],
validate({ params }) {
return /^\d+$/.test(params.id)
},

2
frontend/pages/projects/_id/labels/_label_id/edit.vue

@ -19,7 +19,7 @@ export default Vue.extend({
layout: 'project',
middleware: ['isProjectAdmin'],
middleware: ['check-auth', 'auth', 'setCurrentProject', 'isProjectAdmin'],
validate({ params, query, app }) {
if (!['category', 'span', 'relation'].includes(query.type as string)) {

2
frontend/pages/projects/_id/labels/add.vue

@ -29,6 +29,8 @@ export default Vue.extend({
layout: 'project',
middleware: ['check-auth', 'auth', 'setCurrentProject'],
validate({ params, query, app }) {
if (!['category', 'span', 'relation'].includes(query.type as string)) {
return false

2
frontend/pages/projects/_id/labels/import.vue

@ -14,7 +14,7 @@ export default Vue.extend({
layout: 'project',
middleware: ['isProjectAdmin'],
middleware: ['check-auth', 'auth', 'setCurrentProject', 'isProjectAdmin'],
validate({ params, query, app }) {
if (!['category', 'span', 'relation'].includes(query.type as string)) {

2
frontend/pages/projects/_id/labels/index.vue

@ -58,6 +58,8 @@ export default Vue.extend({
layout: 'project',
middleware: ['check-auth', 'auth', 'setCurrentProject'],
validate({ params, app }) {
if (/^\d+$/.test(params.id)) {
return app.$services.project.findById(params.id).then((project: Project) => {

2
frontend/pages/projects/_id/members/index.vue

@ -44,7 +44,7 @@ export default Vue.extend({
layout: 'project',
middleware: ['isProjectAdmin'],
middleware: ['check-auth', 'auth', 'setCurrentProject', 'isProjectAdmin'],
validate({ params }) {
return /^\d+$/.test(params.id)

2
frontend/pages/projects/_id/metrics/index.vue

@ -39,7 +39,7 @@ export default {
layout: 'project',
middleware: ['isProjectAdmin'],
middleware: ['check-auth', 'auth', 'setCurrentProject', 'isProjectAdmin'],
validate({ params }) {
return /^\d+$/.test(params.id)

2
frontend/pages/projects/_id/settings/index.vue

@ -31,7 +31,7 @@ export default Vue.extend({
layout: 'project',
middleware: ['isProjectAdmin'],
middleware: ['check-auth', 'auth', 'setCurrentProject', 'isProjectAdmin'],
validate({ params }) {
return /^\d+$/.test(params.id)

Loading…
Cancel
Save