Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text editor file path label #4391

Merged
merged 3 commits into from
Nov 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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