Skip to content

Commit

Permalink
Merge pull request #4391 from owncloud/text-editor-file-path-label
Browse files Browse the repository at this point in the history
Text editor file path label
  • Loading branch information
kulmann authored Nov 26, 2020
2 parents fd28141 + e275b28 commit 7eae026
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
4 changes: 2 additions & 2 deletions apps/markdown-editor/src/MarkdownEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
name="input"
full-width
:value="currentContent"
:label="$gettext('Editor')"
class="uk-height-1-1"
:rows="20"
@input="onType"
>
</oc-textarea>
/>
</div>
<div class="uk-container uk-width-1-2">
<!-- eslint-disable-next-line vue/no-v-html -->
Expand Down
9 changes: 6 additions & 3 deletions apps/markdown-editor/src/MarkdownEditorAppBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<oc-button :disabled="!isTouched" @click="saveContent">
<oc-icon name="save" aria-hidden="true" />
</oc-button>
<oc-spinner v-if="isLoading" />
<oc-spinner v-if="isLoading" :aria-label="$gettext('Loading editor content')" />
</div>
<div class="uk-width-expand uk-text-center">
<span>{{ activeFile.path.substr(1) }}</span>
<span>{{ activeFilePath }}</span>
</div>
<div class="uk-width-auto uk-text-right">
<oc-button @click="closeApp">
Expand All @@ -24,7 +24,10 @@ import { mapGetters, mapActions } from 'vuex'
export default {
computed: {
...mapGetters(['activeFile']),
...mapGetters('MarkdownEditor', ['isTouched', 'isLoading'])
...mapGetters('MarkdownEditor', ['isTouched', 'isLoading']),
activeFilePath() {
return this.activeFile.path.replace(/^(\/|\\)+/, '')
}
},
methods: {
...mapActions('MarkdownEditor', ['saveFile']),
Expand Down
5 changes: 5 additions & 0 deletions changelog/unreleased/text-editor-file-path-label
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Don't break file/folder names in text editor

The label in the text editor that displays the path of the active file was removing the first character instead of trimming leading slashes. This might have lead to situations where actual characters were removed. We fixed this by only removing leading slahes instead of blindly removing the first character.

https://github.com/owncloud/phoenix/pull/4391

0 comments on commit 7eae026

Please sign in to comment.