-
Notifications
You must be signed in to change notification settings - Fork 7
Simplify the file conflict dialog #2540
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
Open
jancborchardt
wants to merge
1
commit into
main
Choose a base branch
from
feat/simplify-conflict-dialog
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,142 @@ | ||||||
| <!-- | ||||||
| - SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| - SPDX-License-Identifier: AGPL-3.0-or-later | ||||||
| --> | ||||||
|
|
||||||
| <script setup lang="ts"> | ||||||
| import { mdiFile, mdiFolder } from '@mdi/js' | ||||||
| import { formatFileSize } from '@nextcloud/files' | ||||||
| import { computed, ref, watch } from 'vue' | ||||||
| import NcDateTime from '@nextcloud/vue/components/NcDateTime' | ||||||
| import NcIconSvgWrapper from '@nextcloud/vue/components/NcIconSvgWrapper' | ||||||
| import { t } from '../../utils/l10n.ts' | ||||||
|
|
||||||
| const props = defineProps<{ | ||||||
| /** | ||||||
| * Preview URL, if available | ||||||
| */ | ||||||
| preview?: string | ||||||
|
|
||||||
| /** | ||||||
| * Modification time, if available | ||||||
| */ | ||||||
| mtime?: Date | ||||||
|
|
||||||
| /** | ||||||
| * File size in bytes, if available | ||||||
| */ | ||||||
| size?: number | ||||||
|
|
||||||
| /** | ||||||
| * Whether the node is a folder (changes the fallback icon) | ||||||
| */ | ||||||
| isFolder: boolean | ||||||
|
|
||||||
| /** | ||||||
| * Visually hidden label describing this side ("Existing version"/"New version"). | ||||||
| * Kept for screen readers as the column heading already labels it visually. | ||||||
| */ | ||||||
| label: string | ||||||
|
|
||||||
| /** | ||||||
| * Bold the modification time (it is the more recent one) | ||||||
| */ | ||||||
| boldDate?: boolean | ||||||
|
|
||||||
| /** | ||||||
| * Bold the size (it is the larger one) | ||||||
| */ | ||||||
| boldSize?: boolean | ||||||
| }>() | ||||||
|
|
||||||
| // Previews can 404, fall back to the icon instead of a broken image | ||||||
| const previewFailed = ref(false) | ||||||
| watch(() => props.preview, () => { | ||||||
| previewFailed.value = false | ||||||
| }) | ||||||
| const showPreview = computed(() => !!props.preview && !previewFailed.value) | ||||||
| </script> | ||||||
|
|
||||||
| <template> | ||||||
| <span :class="$style.card"> | ||||||
| <!-- Icon or preview --> | ||||||
| <NcIconSvgWrapper | ||||||
| v-if="!showPreview" | ||||||
| :class="[$style.cardIcon, { [$style.cardIcon_folder]: isFolder }]" | ||||||
| :path="isFolder ? mdiFolder : mdiFile" | ||||||
| :size="48" /> | ||||||
| <img | ||||||
| v-else | ||||||
| :class="$style.cardPreview" | ||||||
| :src="preview" | ||||||
| alt="" | ||||||
| loading="lazy" | ||||||
| @error="previewFailed = true"> | ||||||
|
|
||||||
| <!-- Description --> | ||||||
| <span :class="$style.cardDescription"> | ||||||
| <NcDateTime | ||||||
| v-if="mtime" | ||||||
| :class="{ [$style.bold]: boldDate }" | ||||||
| :timestamp="mtime" | ||||||
| :relativeTime="false" | ||||||
| :format="{ timeStyle: 'short', dateStyle: 'medium' }" /> | ||||||
| <span v-else> | ||||||
| {{ t('Last modified date unknown') }} | ||||||
| </span> | ||||||
| <span v-if="size !== undefined" :class="{ [$style.bold]: boldSize }"> | ||||||
| {{ formatFileSize(size) }} | ||||||
| </span> | ||||||
| </span> | ||||||
|
|
||||||
| <span class="hidden-visually">{{ label }}</span> | ||||||
| </span> | ||||||
| </template> | ||||||
|
|
||||||
| <style module lang="scss"> | ||||||
| $height: 64px; | ||||||
|
|
||||||
| .card { | ||||||
| display: flex; | ||||||
| align-items: center; | ||||||
| height: $height; | ||||||
| } | ||||||
|
|
||||||
| .cardIcon, | ||||||
| .cardPreview { | ||||||
| height: $height; | ||||||
| width: $height; | ||||||
| margin: 0 var(--secondary-margin); | ||||||
| display: block; | ||||||
| flex: 0 0 $height; | ||||||
| } | ||||||
|
|
||||||
| .cardIcon { | ||||||
| color: var(--color-text-maxcontrast); | ||||||
| } | ||||||
|
|
||||||
| .cardIcon_folder { | ||||||
| color: var(--color-primary-element); | ||||||
| } | ||||||
|
|
||||||
| .cardPreview { | ||||||
| overflow: hidden; | ||||||
| border-radius: calc(var(--border-radius) * 2); | ||||||
| object-fit: cover; | ||||||
| } | ||||||
|
|
||||||
| .cardDescription { | ||||||
| display: flex; | ||||||
| flex-direction: column; | ||||||
| min-width: 0; | ||||||
|
|
||||||
| span, | ||||||
| :deep(time) { | ||||||
| white-space: nowrap; | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| .bold { | ||||||
| font-weight: bold; | ||||||
| } | ||||||
| </style> | ||||||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit confusing, what does "will be deleted" mean?
In which case are files deleted?