From de58dcbb0e3bac432774c66a0531486bff9ec4b9 Mon Sep 17 00:00:00 2001 From: MxMarx Date: Fri, 6 Oct 2023 16:22:26 -0700 Subject: [PATCH] highlight changes when matching Highlight values that will be updated when matching. Also removed some dynamic class names to keep tailwind from missing things https://tailwindcss.com/docs/content-configuration#dynamic-class-names --- client/components/app/BookShelfToolbar.vue | 6 +- client/components/modals/item/tabs/Match.vue | 190 ++++++------------ .../modals/podcast/RemoveEpisode.vue | 2 +- client/components/ui/Checkbox.vue | 4 +- client/pages/batch/index.vue | 2 +- 5 files changed, 64 insertions(+), 140 deletions(-) diff --git a/client/components/app/BookShelfToolbar.vue b/client/components/app/BookShelfToolbar.vue index 9b79bc0f0..5c685854f 100644 --- a/client/components/app/BookShelfToolbar.vue +++ b/client/components/app/BookShelfToolbar.vue @@ -49,7 +49,7 @@ {{ numShowing }}
- + @@ -65,7 +65,7 @@
- -
- -
- -

{{ $strings.LabelCurrently }} {{ mediaMetadata.title || '' }}

-
-
- -
- -

{{ $strings.LabelCurrently }} {{ mediaMetadata.subtitle || '' }}

-
-
-
- -
- -

{{ $strings.LabelCurrently }} {{ mediaMetadata.authorName || '' }}

-
-
-
- -
- -

{{ $strings.LabelCurrently }} {{ mediaMetadata.narratorName || '' }}

-
-
-
- -
- -

{{ $strings.LabelCurrently }} {{ mediaMetadata.description.substr(0, 100) + (mediaMetadata.description.length > 100 ? '...' : '') }}

-
-
-
- -
- -

{{ $strings.LabelCurrently }} {{ mediaMetadata.publisher || '' }}

-
-
-
- -
- -

{{ $strings.LabelCurrently }} {{ mediaMetadata.publishedYear || '' }}

-
-
-
- -
- -

{{ $strings.LabelCurrently }} {{ mediaMetadata.seriesName || '' }}

-
-
-
- -
- -

{{ $strings.LabelCurrently }} {{ mediaMetadata.genres.join(', ') }}

-
-
-
- -
- -

{{ $strings.LabelCurrently }} {{ media.tags.join(', ') }}

-
-
-
- -
- -

{{ $strings.LabelCurrently }} {{ mediaMetadata.language || '' }}

-
-
-
- -
- -

{{ $strings.LabelCurrently }} {{ mediaMetadata.isbn || '' }}

-
-
-
- -
- -

{{ $strings.LabelCurrently }} {{ mediaMetadata.asin || '' }}

-
-
- -
- -
- -

{{ $strings.LabelCurrently }} {{ mediaMetadata.itunesId || '' }}

-
-
-
- -
- -

{{ $strings.LabelCurrently }} {{ mediaMetadata.feedUrl || '' }}

-
-
-
- -
- -

{{ $strings.LabelCurrently }} {{ mediaMetadata.itunesPageUrl || '' }}

-
-
-
- -
- -

{{ $strings.LabelCurrently }} {{ mediaMetadata.releaseDate || '' }}

-
-
-
- -
- -

{{ $strings.LabelCurrently }} {{ mediaMetadata.explicit ? 'Explicit (checked)' : 'Not Explicit (unchecked)' }}

-
-
-
- -
- -

{{ $strings.LabelCurrently }} {{ mediaMetadata.abridged ? 'Abridged (checked)' : 'Unabridged (unchecked)' }}

+
+
+ +
+ +

{{ $strings.LabelCurrently }} {{ item.originalValueLabel || valueToString(item.originalValue, item.key) }}

+
@@ -309,6 +207,28 @@ export default { } }, methods: { + valueToString(value, key) { + if (Array.isArray(value) && key === 'series') { + return value.map(item => item.displayName).join(",") + } else if (Array.isArray(value)) { + return value.join(', ') + } else if (typeof value == "boolean") { + return value + } else { + // strip html tags for rich text descriptions + return value.replace(/(<([^>]+)>)/gi, "") || '' + } + }, + shouldRender(value) { + if (typeof value == "boolean") { + return value != null + } else { + return value && value.length + } + }, + isChanged(originalValue, key) { + return this.valueToString(originalValue, key) != this.valueToString(this.selectedMatch[key], key) + }, selectAllToggled(val) { for (const key in this.selectedMatchUsage) { this.selectedMatchUsage[key] = val @@ -576,7 +496,7 @@ export default { } - diff --git a/client/components/modals/podcast/RemoveEpisode.vue b/client/components/modals/podcast/RemoveEpisode.vue index 0083228d2..c6dbe6052 100644 --- a/client/components/modals/podcast/RemoveEpisode.vue +++ b/client/components/modals/podcast/RemoveEpisode.vue @@ -14,7 +14,7 @@

Note: This does not delete the audio file unless toggling "Hard delete file"

- + {{ btnText }}
diff --git a/client/components/ui/Checkbox.vue b/client/components/ui/Checkbox.vue index 439d6c7d5..1323d26a3 100644 --- a/client/components/ui/Checkbox.vue +++ b/client/components/ui/Checkbox.vue @@ -25,7 +25,7 @@ export default { }, checkColor: { type: String, - default: 'green-500' + default: 'text-green-500' }, labelClass: { type: String, @@ -62,7 +62,7 @@ export default { return classes.join(' ') }, svgClass() { - var classes = [`text-${this.checkColor}`] + var classes = [this.checkColor] if (this.small) classes.push('w-3 h-3') else if (this.medium) classes.push('w-3.5 h-3.5') else classes.push('w-4 h-4') diff --git a/client/pages/batch/index.vue b/client/pages/batch/index.vue index 15675fb8f..5353bd1b3 100644 --- a/client/pages/batch/index.vue +++ b/client/pages/batch/index.vue @@ -65,7 +65,7 @@ :label="$strings.LabelExplicit" :disabled="!selectedBatchUsage.explicit" :checkbox-bg="!selectedBatchUsage.explicit ? 'bg' : 'primary'" - :check-color="!selectedBatchUsage.explicit ? 'gray-600' : 'green-500'" + :check-color="!selectedBatchUsage.explicit ? 'text-gray-600' : 'text-green-500'" border-color="gray-600" :label-class="!selectedBatchUsage.explicit ? 'pl-2 text-base text-gray-400 font-semibold' : 'pl-2 text-base font-semibold'" />