diff --git a/src/app/components/inline-items-list/inline-items-list.component.html b/src/app/components/inline-items-list/inline-items-list.component.html new file mode 100644 index 0000000..36b862d --- /dev/null +++ b/src/app/components/inline-items-list/inline-items-list.component.html @@ -0,0 +1,73 @@ +
{{ 'NO_SUBCATEGORIES' | translate }}
} + } diff --git a/src/app/pages/category-editor/category-editor.component.scss b/src/app/pages/category-editor/category-editor.component.scss index d0b8ed0..1c9aaac 100644 --- a/src/app/pages/category-editor/category-editor.component.scss +++ b/src/app/pages/category-editor/category-editor.component.scss @@ -124,12 +124,29 @@ } } - mat-list-item { - cursor: pointer; - border-bottom: 1px solid #f0f0f0; + mat-accordion { + display: block; - &:hover { - background-color: #f5f5f5; + mat-expansion-panel { + margin-bottom: 0.25rem; + + .sub-icon { + margin-right: 0.5rem; + font-size: 20px; + width: 20px; + height: 20px; + color: #666; + } + } + + mat-panel-description { + align-items: center; + justify-content: flex-end; + gap: 0.5rem; + + button { + margin-right: -8px; + } } } diff --git a/src/app/pages/category-editor/category-editor.component.ts b/src/app/pages/category-editor/category-editor.component.ts index 0f45bc2..b439500 100644 --- a/src/app/pages/category-editor/category-editor.component.ts +++ b/src/app/pages/category-editor/category-editor.component.ts @@ -11,6 +11,7 @@ import { MatIconModule } from '@angular/material/icon'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatListModule } from '@angular/material/list'; import { MatTooltipModule } from '@angular/material/tooltip'; +import { MatExpansionModule } from '@angular/material/expansion'; import { MatDialog, MatDialogModule } from '@angular/material/dialog'; import { ApiService } from '../../services'; import { ToastService } from '../../services/toast.service'; @@ -18,6 +19,7 @@ import { Category } from '../../models'; import { LoadingSkeletonComponent } from '../../components/loading-skeleton/loading-skeleton.component'; import { CreateDialogComponent } from '../../components/create-dialog/create-dialog.component'; import { ConfirmDialogComponent } from '../../components/confirm-dialog/confirm-dialog.component'; +import { InlineItemsListComponent } from '../../components/inline-items-list/inline-items-list.component'; import { LanguageService } from '../../services/language.service'; import { TranslatePipe } from '../../pipes/translate.pipe'; @@ -36,7 +38,9 @@ import { TranslatePipe } from '../../pipes/translate.pipe'; MatListModule, MatDialogModule, MatTooltipModule, + MatExpansionModule, LoadingSkeletonComponent, + InlineItemsListComponent, TranslatePipe ], templateUrl: './category-editor.component.html', diff --git a/src/app/pages/item-editor/item-editor.component.html b/src/app/pages/item-editor/item-editor.component.html index 6c8d48e..cd2a91c 100644 --- a/src/app/pages/item-editor/item-editor.component.html +++ b/src/app/pages/item-editor/item-editor.component.html @@ -395,7 +395,7 @@ - + } diff --git a/src/app/pages/item-editor/item-editor.component.ts b/src/app/pages/item-editor/item-editor.component.ts index 3c4f34e..1c8b7a4 100644 --- a/src/app/pages/item-editor/item-editor.component.ts +++ b/src/app/pages/item-editor/item-editor.component.ts @@ -113,6 +113,11 @@ export class ItemEditorComponent implements OnInit { this.loading.set(true); this.apiService.getItem(this.itemId()).subscribe({ next: (item) => { + if (!item) { + this.toast.error(this.lang.t('ITEM_NOT_FOUND')); + this.loading.set(false); + return; + } this.item.set(item); // Initialise Russian translation buffers const ru = item.translations?.['ru']; diff --git a/src/app/pages/subcategory-editor/subcategory-editor.component.html b/src/app/pages/subcategory-editor/subcategory-editor.component.html index 4b194e9..9df872f 100644 --- a/src/app/pages/subcategory-editor/subcategory-editor.component.html +++ b/src/app/pages/subcategory-editor/subcategory-editor.component.html @@ -99,19 +99,21 @@