Skip to content

Commit

Permalink
fix(ui): move document status to the bottom
Browse files Browse the repository at this point in the history
Signed-off-by: Max <[email protected]>
  • Loading branch information
max-nextcloud committed Feb 13, 2025
1 parent 70bff88 commit af40cfd
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/components/CollisionResolveDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

<template>
<div id="resolve-conflicts" class="collision-resolve-dialog" :class="{'icon-loading': clicked }">
<NcButton :disabled="clicked" data-cy="resolveThisVersion" @click="resolveThisVersion">
<NcButton size="large" :disabled="clicked" data-cy="resolveThisVersion" @click="resolveThisVersion">

Check failure on line 8 in src/components/CollisionResolveDialog.vue

View workflow job for this annotation

GitHub Actions / NPM lint

'@click' should be on a new line
{{ t('text', 'Use current version') }}
</NcButton>
<NcButton :disabled="clicked" data-cy="resolveServerVersion" @click="resolveServerVersion">
<NcButton size="large" :disabled="clicked" data-cy="resolveServerVersion" @click="resolveServerVersion">

Check failure on line 11 in src/components/CollisionResolveDialog.vue

View workflow job for this annotation

GitHub Actions / NPM lint

'@click' should be on a new line
{{ t('text', 'Use the saved version') }}
</NcButton>
</div>
Expand Down
17 changes: 9 additions & 8 deletions src/components/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@
class="text-editor"
tabindex="-1"
@keydown.stop="onKeyDown">
<DocumentStatus v-if="displayedStatus"
:idle="idle"
:lock="lock"
:is-resolving-conflict="isResolvingConflict"
:sync-error="syncError"
:has-connection-issue="hasConnectionIssue"
@reconnect="reconnect" />

<SkeletonLoading v-if="showLoadingSkeleton" />
<Wrapper v-if="displayed"
:is-resolving-conflict="isResolvingConflict"
Expand Down Expand Up @@ -62,6 +54,13 @@
<Reader v-if="isResolvingConflict"
:content="syncError.data.outsideChange"
:is-rich-editor="isRichEditor" />
<CollisionResolveDialog v-if="isResolvingConflict" :sync-error="syncError" />
<DocumentStatus v-if="displayedStatus"
:idle="idle"
:lock="lock"
:sync-error="syncError"
:has-connection-issue="hasConnectionIssue"
@reconnect="reconnect" />
</Wrapper>
<Assistant v-if="hasEditor" />
<Translate :show="translateModal"
Expand Down Expand Up @@ -124,12 +123,14 @@ import Wrapper from './Editor/Wrapper.vue'
import SkeletonLoading from './SkeletonLoading.vue'
import Assistant from './Assistant.vue'
import Translate from './Modal/Translate.vue'
import CollisionResolveDialog from './CollisionResolveDialog.vue'

Check warning on line 126 in src/components/Editor.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Editor.vue#L126

Added line #L126 was not covered by tests
import { generateRemoteUrl } from '@nextcloud/router'
import { fetchNode } from '../services/WebdavClient.ts'

export default {
name: 'Editor',
components: {
CollisionResolveDialog,

Check warning on line 133 in src/components/Editor.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Editor.vue#L133

Added line #L133 was not covered by tests
SkeletonLoading,
DocumentStatus,
Wrapper,
Expand Down
12 changes: 5 additions & 7 deletions src/components/Editor/DocumentStatus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
{{ t('text', 'This file is opened read-only as it is currently locked by {user}.', { user: lock.displayName }) }}
</p>
</NcNoteCard>

<CollisionResolveDialog v-if="isResolvingConflict" :sync-error="syncError" />
</div>
</template>

Expand All @@ -43,13 +41,11 @@
import { ERROR_TYPE, IDLE_TIMEOUT } from './../../services/SyncService.js'
import Lock from 'vue-material-design-icons/Lock.vue'
import { NcNoteCard } from '@nextcloud/vue'
import CollisionResolveDialog from '../CollisionResolveDialog.vue'

export default {
name: 'DocumentStatus',

components: {
CollisionResolveDialog,
Lock,
NcNoteCard,
},
Expand Down Expand Up @@ -110,12 +106,14 @@ export default {

<style scoped lang="scss">
.document-status {
position: sticky;
top: 16px;
position: absolute;
bottom: 34px;
z-index: 100000;
// max-height: 50px;
max-width: var(--text-editor-max-width);
margin: auto;
background-color: var(--color-main-background);
display: flex;
width: 100%;
justify-content: center;
}
</style>
1 change: 1 addition & 0 deletions src/components/Editor/Wrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ export default {
display: flex;
width: 100%;
height: 100%;
overflow: auto;

.ProseMirror {
margin-top: 0 !important;
Expand Down
1 change: 0 additions & 1 deletion src/components/ViewerComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ export default {
</script>
<style lang="scss" scoped>
.text-editor:not(.viewer__file--hidden) {
overflow: scroll;
top: 0;
width: 100%;
max-width: 100%;
Expand Down

0 comments on commit af40cfd

Please sign in to comment.