Skip to content

Commit fdd28f2

Browse files
committed
wip
1 parent e288f8f commit fdd28f2

9 files changed

Lines changed: 29 additions & 16 deletions

File tree

lang/de.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,6 @@
600600
"Icon": "Icon",
601601
"Icon Set": "Icon-Set",
602602
"ID": "ID",
603-
"ID not found": "ID nicht gefunden",
604603
"ID regenerated and Stache cleared": "ID neu generiert und Stache geleert",
605604
"If you're having trouble clicking the \":actionText\" button, copy and paste the URL below\ninto your web browser:": "Falls das Klicken auf den „:actionText“-Button nicht funktioniert, kopiere die folgende URL in deinen Webbrowser:",
606605
"Ignoring Section|Ignoring Sections": "Abschnitt wird ignoriert|Abschnitte werden ignoriert",

lang/de_CH.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,6 @@
600600
"Icon": "Icon",
601601
"Icon Set": "Icon-Set",
602602
"ID": "ID",
603-
"ID not found": "ID nicht gefunden",
604603
"ID regenerated and Stache cleared": "ID neu generiert und Stache geleert",
605604
"If you're having trouble clicking the \":actionText\" button, copy and paste the URL below\ninto your web browser:": "Falls das Klicken auf den «:actionText»-Button nicht funktioniert, kopiere die folgende URL in deinen Webbrowser:",
606605
"Ignoring Section|Ignoring Sections": "Abschnitt wird ignoriert|Abschnitte werden ignoriert",

lang/fr.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,6 @@
601601
"Icon": "Icône",
602602
"Icon Set": "Jeu d'icônes",
603603
"ID": "ID",
604-
"ID not found": "ID non trouvée",
605604
"ID regenerated and Stache cleared": "ID regénéré et Stache effacé",
606605
"If you're having trouble clicking the \":actionText\" button, copy and paste the URL below\ninto your web browser:": "Si vous ne parvenez pas à cliquer sur le bouton \":actionText\", copiez et collez l'URL ci-dessous dans votre navigateur Web :",
607606
"Ignoring Section|Ignoring Sections": "Ignorer la section|Ignorer les sections",

lang/nl.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,6 @@
585585
"Icon": "Icoon",
586586
"Icon Set": "pictogram set",
587587
"ID": "ID",
588-
"ID not found": "ID niet gevonden",
589588
"ID regenerated and Stache cleared": "ID's opnieuw gegenereerd en Stache geleegd",
590589
"If you're having trouble clicking the \":actionText\" button, copy and paste the URL below\ninto your web browser:": "Als je problemen ondervindt bij het klikken op de knop \":actionText\", kopieer en plak de onderstaande URL dan in je webbrowser:",
591590
"Image": "Afbeelding",

lang/ru.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,6 @@
623623
"Icon": "Иконка",
624624
"Icon Set": "Набор иконок",
625625
"ID": "ID",
626-
"ID not found": "ID не найден",
627626
"ID regenerated and Stache cleared": "ID обновлён, а Stache очищен",
628627
"If you're having trouble clicking the \":actionText\" button, copy and paste the URL below\ninto your web browser:": "Если у вас возникли проблемы с нажатием кнопки \":actionText\" скопируйте и вставьте URL ниже\nв свой веб-браузер:",
629628
"Image": "Изображения",

resources/js/components/fieldtypes/assets/Asset.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,18 @@ export default {
5050
},
5151

5252
label() {
53-
return this.asset.basename;
53+
return this.asset.invalid ? this.asset.id : this.asset.basename;
5454
},
5555

5656
needsAlt() {
57+
if (this.asset.invalid) return false;
58+
5759
return (this.asset.isImage || this.asset.isSvg) && !this.asset.values.alt;
5860
},
61+
62+
invalidLabel() {
63+
return __('messages.relationship_item_unavailable');
64+
},
5965
},
6066

6167
methods: {
@@ -67,6 +73,7 @@ export default {
6773

6874
edit() {
6975
if (this.readOnly) return;
76+
if (this.asset.invalid) return;
7077

7178
this.editing = true;
7279
},

resources/js/components/fieldtypes/assets/AssetRow.vue

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,20 @@
1919
:alt="asset.basename"
2020
v-if="thumbnail"
2121
/>
22-
<file-icon :extension="asset.extension" v-else class="size-7" />
22+
<file-icon :extension="asset.extension ?? 'generic'" v-else class="size-7" />
2323
</button>
2424
<button
2525
v-if="showFilename"
2626
@click="editOrOpen"
27-
class="min-w-0 flex-1 truncate text-start text-sm leading-5 text-gray-600 dark:text-gray-400"
28-
:title="__('Edit')"
27+
class="min-w-0 flex-1 truncate text-start text-sm leading-5"
28+
:class="{
29+
'text-gray-600 dark:text-gray-300': !asset.invalid,
30+
'text-gray-500 dark:text-gray-400': asset.invalid
31+
}"
32+
:title="asset.invalid ? invalidLabel : __('Edit')"
2933
:aria-label="__('Edit Asset')"
3034
>
31-
{{ asset.basename }}
35+
{{ label }}
3236
</button>
3337
<div v-if="readOnly" v-text="asset.size" class="asset-filesize hidden shrink-0 px-2 text-sm leading-5 text-gray-600 dark:text-gray-400 @xs:block" />
3438
</td>

resources/js/components/fieldtypes/assets/AssetTile.vue

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
'is-svg': canShowSvg,
77
'is-file': !isImage && !canShowSvg,
88
}"
9-
:title="label"
9+
:title="asset.invalid ? invalidLabel : label"
1010
>
1111
<asset-editor
1212
v-if="editing"
@@ -35,7 +35,7 @@
3535
<template v-else>
3636
<img :src="thumbnail" v-if="thumbnail" :title="label" class="rounded-md relative" />
3737

38-
<file-icon v-else :extension="asset.extension" class="h-full w-full p-4 relative" />
38+
<file-icon v-else :extension="asset.extension ?? 'generic'" class="h-full w-full p-4 relative" />
3939
</template>
4040
</template>
4141

@@ -66,7 +66,15 @@
6666
</div>
6767

6868
<div class="flex items-center justify-between w-full px-1" v-if="showFilename">
69-
<div class="truncate w-18 text-xs text-gray-600 dark:text-gray-400 flex-1 px-2 py-1" v-tooltip="label" :class="{ 'text-center': !needsAlt }">
69+
<div
70+
class="truncate w-18 text-xs flex-1 px-2 py-1"
71+
:class="{
72+
'text-center': !needsAlt,
73+
'text-gray-600 dark:text-gray-300': !asset.invalid,
74+
'text-gray-500 dark:text-gray-400': asset.invalid,
75+
}"
76+
v-tooltip="asset.invalid ? invalidLabel : label"
77+
>
7078
{{ label }}
7179
</div>
7280
<ui-badge as="button" size="sm" color="sky" @click="editOrOpen" v-if="asset.isEditable && showSetAlt && needsAlt" :text="asset.values.alt ? '✅' : __('Set Alt')" />

resources/js/components/inputs/relationship/Item.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
<template>
22
<div
33
class="shadow-ui-sm relative z-(--z-index-above) flex w-full h-full items-center gap-2 rounded-lg border border-gray-300 bg-white px-3 [&:has(.cursor-grab)]:px-1.5 py-1.5 mb-1.5 last:mb-0 text-base dark:border-gray-700 dark:with-contrast:border-gray-500 dark:bg-gray-900"
4-
:class="{ invalid: item.invalid }"
54
>
65
<ui-icon name="handles" class="item-move sortable-handle size-4 cursor-grab text-gray-300 dark:text-gray-700" v-if="sortable" />
76
<div class="flex flex-1 items-center line-clamp-1 text-sm text-gray-600 dark:text-gray-300">
87
<ui-status-indicator v-if="item.status" :status="item.status" class="me-2" />
98

109
<div
1110
v-if="item.invalid"
12-
v-tooltip.top="__('ID not found')"
11+
v-tooltip.top="__('messages.relationship_item_unavailable')"
1312
v-text="__(item.title)"
14-
class="line-clamp-1 text-sm text-gray-600 dark:text-gray-300"
13+
class="line-clamp-1 text-sm text-gray-500 dark:text-gray-400"
1514
/>
1615

1716
<a

0 commit comments

Comments
 (0)