File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 142142 box-shadow : 0 0 0 1px theme ('colors.blue.DEFAULT' );
143143}
144144
145+ .asset-tile .is-invalid {
146+ @apply bg-gray-100 dark:bg-dark-650 border-gray-300 dark:border-dark-200 text-gray-600 dark:text-gray-400 cursor-default;
147+ }
148+
145149.asset-thumbnail {
146150 @apply border border-white dark:border-dark-950;
147151}
Original file line number Diff line number Diff line change 1818
1919 & .invalid {
2020 .item-inner {
21- @apply border-red -300 dark:border-dark-red bg-red -100 dark:bg-red-400 text-red-500 dark:text-red-950 ;
21+ @apply border-gray -300 dark:border-dark-200 bg-gray -100 dark:bg-dark-650 text-gray-600 dark:text-gray-400 ;
2222 }
2323 }
2424
Original file line number Diff line number Diff line change @@ -53,11 +53,17 @@ export default {
5353 } ,
5454
5555 label ( ) {
56- return this . asset . basename ;
56+ return this . asset . invalid ? this . asset . id : this . asset . basename ;
5757 } ,
5858
5959 needsAlt ( ) {
60+ if ( this . asset . invalid ) return false ;
61+
6062 return ( this . asset . isImage || this . asset . isSvg ) && ! this . asset . values . alt ;
63+ } ,
64+
65+ invalidLabel ( ) {
66+ return __ ( 'This item is unavailable. It may have been deleted, or you may not have permission to view it.' ) ;
6167 }
6268 } ,
6369
@@ -66,6 +72,7 @@ export default {
6672
6773 edit ( ) {
6874 if ( this . readOnly ) return ;
75+ if ( this . asset . invalid ) return ;
6976
7077 this . editing = true ;
7178 } ,
Original file line number Diff line number Diff line change 11<template >
2- <tr class =" cursor-grab bg-white dark:bg-dark-750 hover:bg-gray-100 dark:hover:bg-dark-700" >
2+ <tr class =" cursor-grab bg-white dark:bg-dark-750 hover:bg-gray-100 dark:hover:bg-dark-700" :class = " { 'is-invalid': asset.invalid } " >
33 <td class =" flex items-center h-full" >
44 <div
55 v-if =" canShowSvg"
2424 v-if =" showFilename"
2525 @click =" editOrOpen"
2626 class =" flex items-center flex-1 rtl:mr-3 ltr:ml-3 text-xs rtl:text-right ltr:text-left truncate w-full"
27- :title =" __('Edit')"
27+ :class =" { 'text-gray-600 dark:text-gray-400': asset.invalid }"
28+ :title =" asset.invalid ? invalidLabel : __('Edit')"
2829 :aria-label =" __('Edit Asset')"
2930 >
30- {{ asset.basename }}
31+ {{ label }}
3132 </button >
3233
3334 <button
@@ -71,6 +72,8 @@ export default {
7172
7273 methods: {
7374 editOrOpen () {
75+ if (this .asset .invalid ) return ;
76+
7477 return this .readOnly ? this .open () : this .edit ();
7578 }
7679 },
Original file line number Diff line number Diff line change 55 'is-image': isImage && !canShowSvg,
66 'is-svg': canShowSvg,
77 'is-file': !isImage && !canShowSvg,
8+ 'is-invalid': asset.invalid,
89 }"
9- :title =" label"
10+ :title =" asset.invalid ? invalidLabel : label"
1011 >
1112 <asset-editor
1213 v-if =" editing"
4142 <div class =" asset-controls" >
4243 <div class =" flex items-center justify-center space-x-1 rtl:space-x-reverse" >
4344 <template v-if =" ! readOnly " >
44- <button @click =" edit" class =" btn btn-icon" :title =" __('Edit')" >
45+ <button v-if = " !asset.invalid " @click =" edit" class =" btn btn-icon" :title =" __('Edit')" >
4546 <svg-icon name =" micro/sharp-pencil" class =" h-4 my-2" />
4647 </button >
4748
Original file line number Diff line number Diff line change 1010
1111 <div
1212 v-if =" item.invalid"
13- v-tooltip.top =" __('An item with this ID could not be found')"
13+ v-tooltip.top =" __('This item is unavailable. It may have been deleted, or you may not have permission to view it.')"
14+ class =" truncate"
1415 v-text =" __(item.title)" />
1516
1617 <a v-if =" !item.invalid && editable" @click.prevent =" edit" v-text =" __(item.title)" class =" truncate" v-tooltip =" item.title" :href =" item.edit_url" />
You can’t perform that action at this time.
0 commit comments