diff --git a/packages/frontend/src/components/dialogs/BranchEditDialog.vue b/packages/frontend/src/components/dialogs/BranchEditDialog.vue index 45260a8ef..824646ce0 100644 --- a/packages/frontend/src/components/dialogs/BranchEditDialog.vue +++ b/packages/frontend/src/components/dialogs/BranchEditDialog.vue @@ -14,7 +14,9 @@ mdi-close - + + {{ error }} + +

+ Tip: you can create nested branches by using "/" as a separator in their names. E.g., + "mep/stage-1" or "arch/sketch-design". +

@@ -79,7 +85,8 @@ export default { ], isEdit: false, pendingDelete: false, - allBranchNames: [] + allBranchNames: [], + error: null } }, apollo: { @@ -125,6 +132,7 @@ export default { methods: { async deleteBranch() { this.loading = true + this.error = null this.$matomo && this.$matomo.trackPageView('branch/delete') try { await this.$apollo.mutate({ @@ -141,16 +149,18 @@ export default { } }) } catch (e) { - console.log(e) + this.error = e.message } this.loading = false - - this.resolve({ - result: true, - deleted: true - }) - this.dialog = false + this.showDelete = false + if (!this.error) { + this.resolve({ + result: true, + deleted: true + }) + this.dialog = false + } }, open(branch) { this.dialog = true diff --git a/packages/frontend/src/components/dialogs/BranchNewDialog.vue b/packages/frontend/src/components/dialogs/BranchNewDialog.vue index 8a788c99a..b8ff26519 100644 --- a/packages/frontend/src/components/dialogs/BranchNewDialog.vue +++ b/packages/frontend/src/components/dialogs/BranchNewDialog.vue @@ -22,6 +22,10 @@ required autofocus > +

+ Tip: you can create nested branches by using "/" as a separator in their names. E.g., + "mep/stage-1" or "arch/sketch-design". +

@@ -45,7 +49,7 @@ export default { reservedBranchNames: ['main', 'globals'], valid: false, loading: false, - name: null, + name: '', nameRules: [ (v) => !!v || 'Branches need a name too!', (v) => diff --git a/packages/frontend/src/views/stream/Branch.vue b/packages/frontend/src/views/stream/Branch.vue index 4a0f9df98..6a2d5d3f0 100644 --- a/packages/frontend/src/views/stream/Branch.vue +++ b/packages/frontend/src/views/stream/Branch.vue @@ -6,9 +6,9 @@ {{ stream.branch.name }} {{ stream.branch.description }} mdi-source-commit {{ stream.branch.commits.totalCount }} @@ -17,7 +17,6 @@ mdi-pencil @@ -44,11 +44,11 @@ -
+
- + - -

Branch "{{stream.branch.name}}" has no commits.

+

Branch "{{ stream.branch.name }}" has no commits.

{{ error || `Branch "${$route.params.branchName}" does not exist.` }}

@@ -162,6 +161,10 @@ export default { else return null } }, + mounted() { + if (this.$route.params.branchName === 'globals') + this.$router.push(`/streams/${this.$route.params.streamId}/globals`) + }, methods: { editBranch() { this.$refs.editBranchDialog.open(this.stream.branch).then((dialog) => { @@ -181,11 +184,6 @@ export default { } }) } - }, - mounted() { - console.log(this.$route.params) - if (this.$route.params.branchName === 'globals') - this.$router.push(`/streams/${this.$route.params.streamId}/globals`) } } diff --git a/packages/frontend/src/views/stream/Stream.vue b/packages/frontend/src/views/stream/Stream.vue index 334efd162..37b7c15ce 100644 --- a/packages/frontend/src/views/stream/Stream.vue +++ b/packages/frontend/src/views/stream/Stream.vue @@ -106,7 +106,7 @@ - + mdi-home @@ -117,7 +117,6 @@ -