feat(frontend): cleans up filenames & adds extra validation for branch names

This commit is contained in:
Dimitrie Stefanescu
2021-10-10 11:56:01 +01:00
parent 2a49e00f0f
commit 9a85ca0bdb
5 changed files with 7 additions and 9 deletions
@@ -42,18 +42,16 @@ export default {
showError: false,
error: null,
streamId: null,
branchNames: ['main', 'globals'],
reservedBranchNames: ['main', 'globals'],
valid: false,
loading: false,
name: null,
nameRules: [
(v) => !!v || 'Branches need a name too!',
(v) => !(v.startsWith('#') || v.startsWith('/')) || 'Branch names cannot start with "#" or "/"',
(v) =>
(v && !v.startsWith('globals')) ||
'Globals is a reserved branch name. Please choose a different name.',
(v) =>
(v && this.branchNames.findIndex((e) => e === v) === -1) ||
'A branch with this name already exists',
(v && this.reservedBranchNames.findIndex((e) => e === v) === -1) ||
'This is a reserved branch name',
(v) => (v && v.length <= 100) || 'Name must be less than 100 characters',
(v) => (v && v.length >= 3) || 'Name must be at least 3 characters'
],
+3 -3
View File
@@ -57,7 +57,7 @@ const routes = [
meta: {
title: 'Home | Speckle'
},
component: () => import('@/views/Frontend_re.vue'),
component: () => import('@/views/Frontend.vue'),
children: [
{
path: '',
@@ -80,7 +80,7 @@ const routes = [
meta: {
title: 'Stream | Speckle'
},
component: () => import('@/views/stream/Stream_re_re.vue'),
component: () => import('@/views/stream/Stream.vue'),
children: [
{
path: '',
@@ -88,7 +88,7 @@ const routes = [
meta: {
title: 'Stream | Speckle'
},
component: () => import('@/views/stream/Details_re.vue')
component: () => import('@/views/stream/Details.vue')
},
{