@snteam/amplify-angular-core 1.0.33 → 1.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -27,6 +27,8 @@ import { MatDialogRef, MAT_DIALOG_DATA, MatDialogTitle, MatDialogContent, MatDia
|
|
|
27
27
|
import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
|
|
28
28
|
import * as i4$2 from '@angular/router';
|
|
29
29
|
import { ActivatedRoute, Router } from '@angular/router';
|
|
30
|
+
import * as i5$2 from '@angular/material/tooltip';
|
|
31
|
+
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
30
32
|
import * as i1$1 from '@angular/material/expansion';
|
|
31
33
|
import { MatExpansionModule } from '@angular/material/expansion';
|
|
32
34
|
import * as i3$4 from '@angular/material/card';
|
|
@@ -2079,14 +2081,19 @@ class ListViewComponent {
|
|
|
2079
2081
|
ams = inject(AmplifyModelService);
|
|
2080
2082
|
route = inject(ActivatedRoute);
|
|
2081
2083
|
router = inject(Router);
|
|
2084
|
+
snackBar = inject(MatSnackBar);
|
|
2082
2085
|
modelName = '';
|
|
2083
2086
|
customItemTemplate;
|
|
2084
2087
|
hideNewButton = false;
|
|
2085
2088
|
title;
|
|
2086
2089
|
useRouter = true;
|
|
2090
|
+
showRowActions = false;
|
|
2091
|
+
showDeleteAction = false;
|
|
2092
|
+
customRowActions = [];
|
|
2087
2093
|
itemClick = new EventEmitter();
|
|
2088
2094
|
newClick = new EventEmitter();
|
|
2089
2095
|
itemsLoaded = new EventEmitter();
|
|
2096
|
+
itemDeleted = new EventEmitter();
|
|
2090
2097
|
itemsArr = [];
|
|
2091
2098
|
loading = true;
|
|
2092
2099
|
error = null;
|
|
@@ -2127,7 +2134,12 @@ class ListViewComponent {
|
|
|
2127
2134
|
}
|
|
2128
2135
|
}
|
|
2129
2136
|
}
|
|
2130
|
-
onItemClick(item) {
|
|
2137
|
+
onItemClick(item, event) {
|
|
2138
|
+
// Prevent navigation if clicking on action buttons
|
|
2139
|
+
if (event && event.target.closest('.row-actions')) {
|
|
2140
|
+
event.stopPropagation();
|
|
2141
|
+
return;
|
|
2142
|
+
}
|
|
2131
2143
|
console.log('ListViewComponent itemClick', item);
|
|
2132
2144
|
this.itemClick.emit(item);
|
|
2133
2145
|
// Navigate to form view if useRouter is enabled
|
|
@@ -2144,6 +2156,36 @@ class ListViewComponent {
|
|
|
2144
2156
|
this.newClick.emit();
|
|
2145
2157
|
}
|
|
2146
2158
|
}
|
|
2159
|
+
async onDeleteItem(item, event) {
|
|
2160
|
+
event.stopPropagation();
|
|
2161
|
+
try {
|
|
2162
|
+
console.log('ListViewComponent: Deleting item:', item);
|
|
2163
|
+
const result = await this.ams.deleteItemForModel(this.modelName, item.id);
|
|
2164
|
+
if (result && result.data) {
|
|
2165
|
+
console.log('ListViewComponent: Successfully deleted item:', result.data);
|
|
2166
|
+
this.snackBar.open(`${this.modelName} deleted successfully`, 'Dismiss', {
|
|
2167
|
+
duration: 3000
|
|
2168
|
+
});
|
|
2169
|
+
this.itemDeleted.emit(item);
|
|
2170
|
+
}
|
|
2171
|
+
else {
|
|
2172
|
+
console.error('ListViewComponent: Failed to delete item:', result);
|
|
2173
|
+
this.snackBar.open(`Failed to delete ${this.modelName}`, 'Dismiss', {
|
|
2174
|
+
duration: 3000
|
|
2175
|
+
});
|
|
2176
|
+
}
|
|
2177
|
+
}
|
|
2178
|
+
catch (error) {
|
|
2179
|
+
console.error('ListViewComponent: Error deleting item:', error);
|
|
2180
|
+
this.snackBar.open(`Error deleting ${this.modelName}: ${error}`, 'Dismiss', {
|
|
2181
|
+
duration: 5000
|
|
2182
|
+
});
|
|
2183
|
+
}
|
|
2184
|
+
}
|
|
2185
|
+
onCustomAction(action, item, event) {
|
|
2186
|
+
event.stopPropagation();
|
|
2187
|
+
action.action(item);
|
|
2188
|
+
}
|
|
2147
2189
|
getDisplayText(item) {
|
|
2148
2190
|
// Try common display fields
|
|
2149
2191
|
return item.name || item.title || item.label || item.id || 'Unnamed Item';
|
|
@@ -2152,11 +2194,11 @@ class ListViewComponent {
|
|
|
2152
2194
|
this.listItems();
|
|
2153
2195
|
}
|
|
2154
2196
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ListViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2155
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: ListViewComponent, isStandalone: true, selector: "snteam-list-view", inputs: { modelName: "modelName", customItemTemplate: "customItemTemplate", hideNewButton: "hideNewButton", title: "title", useRouter: "useRouter" }, outputs: { itemClick: "itemClick", newClick: "newClick", itemsLoaded: "itemsLoaded" }, ngImport: i0, template: "<div class=\"list-view-container\">\n <div class=\"header\">\n <h2>{{ title || modelName }}</h2>\n @if (!hideNewButton) {\n <button mat-raised-button color=\"primary\" (click)=\"onNewClick()\">\n <mat-icon>add</mat-icon>\n New {{ modelName }}\n </button>\n }\n </div>\n\n @if (loading) {\n <div class=\"loading\">Loading {{ modelName }}...</div>\n }\n\n @if (error) {\n <div class=\"error\">\n {{ error }}\n <button mat-button (click)=\"refresh()\">Retry</button>\n </div>\n }\n\n @if (!loading && !error && itemsArr.length === 0) {\n <div class=\"empty-state\">\n <p>No {{ modelName }} found</p>\n @if (!hideNewButton) {\n <button mat-raised-button color=\"primary\" (click)=\"onNewClick()\">\n Create First {{ modelName }}\n </button>\n }\n </div>\n }\n\n @if (!loading && !error && itemsArr.length > 0) {\n <mat-list class=\"items-list\">\n @for (item of itemsArr; track item.id) {\n <mat-list-item (click)=\"onItemClick(item)\" class=\"clickable-item\">\n @if (customItemTemplate) {\n <ng-container [ngTemplateOutlet]=\"customItemTemplate\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n } @else {\n <span matListItemTitle>{{ getDisplayText(item) }}</span>\n
|
|
2197
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: ListViewComponent, isStandalone: true, selector: "snteam-list-view", inputs: { modelName: "modelName", customItemTemplate: "customItemTemplate", hideNewButton: "hideNewButton", title: "title", useRouter: "useRouter", showRowActions: "showRowActions", showDeleteAction: "showDeleteAction", customRowActions: "customRowActions" }, outputs: { itemClick: "itemClick", newClick: "newClick", itemsLoaded: "itemsLoaded", itemDeleted: "itemDeleted" }, ngImport: i0, template: "<div class=\"list-view-container\">\n <div class=\"header\">\n <h2>{{ title || modelName }}</h2>\n @if (!hideNewButton) {\n <button mat-raised-button color=\"primary\" (click)=\"onNewClick()\">\n <mat-icon>add</mat-icon>\n New {{ modelName }}\n </button>\n }\n </div>\n\n @if (loading) {\n <div class=\"loading\">Loading {{ modelName }}...</div>\n }\n\n @if (error) {\n <div class=\"error\">\n {{ error }}\n <button mat-button (click)=\"refresh()\">Retry</button>\n </div>\n }\n\n @if (!loading && !error && itemsArr.length === 0) {\n <div class=\"empty-state\">\n <p>No {{ modelName }} found</p>\n @if (!hideNewButton) {\n <button mat-raised-button color=\"primary\" (click)=\"onNewClick()\">\n Create First {{ modelName }}\n </button>\n }\n </div>\n }\n\n @if (!loading && !error && itemsArr.length > 0) {\n <mat-list class=\"items-list\">\n @for (item of itemsArr; track item.id) {\n <mat-list-item (click)=\"onItemClick(item, $event)\" class=\"clickable-item\">\n @if (customItemTemplate) {\n <ng-container [ngTemplateOutlet]=\"customItemTemplate\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n } @else {\n <div class=\"item-content\">\n <div class=\"item-text\">\n <span matListItemTitle>{{ getDisplayText(item) }}</span>\n <span matListItemLine>{{ item.description || (item.createdAt | date) }}</span>\n </div>\n @if (showRowActions || showDeleteAction || customRowActions.length > 0) {\n <div class=\"row-actions\">\n @if (showDeleteAction) {\n <button mat-icon-button color=\"warn\" (click)=\"onDeleteItem(item, $event)\" \n matTooltip=\"Delete\" class=\"action-button\">\n <mat-icon>delete</mat-icon>\n </button>\n }\n @for (action of customRowActions; track action.label) {\n <button mat-icon-button [color]=\"action.color || 'primary'\" \n (click)=\"onCustomAction(action, item, $event)\"\n [matTooltip]=\"action.label\" class=\"action-button\">\n <mat-icon>{{ action.icon }}</mat-icon>\n </button>\n }\n </div>\n }\n </div>\n }\n </mat-list-item>\n }\n </mat-list>\n }\n</div>", styles: [".list-view-container{padding:20px;width:100%}.header{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}.header h2{margin:0;color:#333}.loading,.error,.empty-state{padding:40px 20px;text-align:center;color:#666}.error{color:#d32f2f}.empty-state p{margin-bottom:20px;font-size:16px}.items-list{border:1px solid #e0e0e0;border-radius:4px}.clickable-item{cursor:pointer;transition:background-color .2s}.clickable-item:hover{background-color:#f5f5f5}.clickable-item:not(:last-child){border-bottom:1px solid #e0e0e0}.item-content{display:flex;justify-content:space-between;align-items:center;width:100%;padding:8px 0}.item-text{flex:1;display:flex;flex-direction:column}.row-actions{display:flex;gap:4px;margin-left:16px}.action-button{width:32px;height:32px;line-height:32px}.action-button mat-icon{font-size:18px;width:18px;height:18px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: MatListModule }, { kind: "component", type: i5$1.MatList, selector: "mat-list", exportAs: ["matList"] }, { kind: "component", type: i5$1.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "directive", type: i5$1.MatListItemLine, selector: "[matListItemLine]" }, { kind: "directive", type: i5$1.MatListItemTitle, selector: "[matListItemTitle]" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3$3.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i3$3.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatSnackBarModule }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i5$2.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "pipe", type: i3$1.DatePipe, name: "date" }] });
|
|
2156
2198
|
}
|
|
2157
2199
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ListViewComponent, decorators: [{
|
|
2158
2200
|
type: Component,
|
|
2159
|
-
args: [{ selector: 'snteam-list-view', standalone: true, imports: [CommonModule, MatListModule, MatButtonModule, MatIconModule], template: "<div class=\"list-view-container\">\n <div class=\"header\">\n <h2>{{ title || modelName }}</h2>\n @if (!hideNewButton) {\n <button mat-raised-button color=\"primary\" (click)=\"onNewClick()\">\n <mat-icon>add</mat-icon>\n New {{ modelName }}\n </button>\n }\n </div>\n\n @if (loading) {\n <div class=\"loading\">Loading {{ modelName }}...</div>\n }\n\n @if (error) {\n <div class=\"error\">\n {{ error }}\n <button mat-button (click)=\"refresh()\">Retry</button>\n </div>\n }\n\n @if (!loading && !error && itemsArr.length === 0) {\n <div class=\"empty-state\">\n <p>No {{ modelName }} found</p>\n @if (!hideNewButton) {\n <button mat-raised-button color=\"primary\" (click)=\"onNewClick()\">\n Create First {{ modelName }}\n </button>\n }\n </div>\n }\n\n @if (!loading && !error && itemsArr.length > 0) {\n <mat-list class=\"items-list\">\n @for (item of itemsArr; track item.id) {\n <mat-list-item (click)=\"onItemClick(item)\" class=\"clickable-item\">\n @if (customItemTemplate) {\n <ng-container [ngTemplateOutlet]=\"customItemTemplate\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n } @else {\n <span matListItemTitle>{{ getDisplayText(item) }}</span>\n
|
|
2201
|
+
args: [{ selector: 'snteam-list-view', standalone: true, imports: [CommonModule, MatListModule, MatButtonModule, MatIconModule, MatSnackBarModule, MatTooltipModule], template: "<div class=\"list-view-container\">\n <div class=\"header\">\n <h2>{{ title || modelName }}</h2>\n @if (!hideNewButton) {\n <button mat-raised-button color=\"primary\" (click)=\"onNewClick()\">\n <mat-icon>add</mat-icon>\n New {{ modelName }}\n </button>\n }\n </div>\n\n @if (loading) {\n <div class=\"loading\">Loading {{ modelName }}...</div>\n }\n\n @if (error) {\n <div class=\"error\">\n {{ error }}\n <button mat-button (click)=\"refresh()\">Retry</button>\n </div>\n }\n\n @if (!loading && !error && itemsArr.length === 0) {\n <div class=\"empty-state\">\n <p>No {{ modelName }} found</p>\n @if (!hideNewButton) {\n <button mat-raised-button color=\"primary\" (click)=\"onNewClick()\">\n Create First {{ modelName }}\n </button>\n }\n </div>\n }\n\n @if (!loading && !error && itemsArr.length > 0) {\n <mat-list class=\"items-list\">\n @for (item of itemsArr; track item.id) {\n <mat-list-item (click)=\"onItemClick(item, $event)\" class=\"clickable-item\">\n @if (customItemTemplate) {\n <ng-container [ngTemplateOutlet]=\"customItemTemplate\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n } @else {\n <div class=\"item-content\">\n <div class=\"item-text\">\n <span matListItemTitle>{{ getDisplayText(item) }}</span>\n <span matListItemLine>{{ item.description || (item.createdAt | date) }}</span>\n </div>\n @if (showRowActions || showDeleteAction || customRowActions.length > 0) {\n <div class=\"row-actions\">\n @if (showDeleteAction) {\n <button mat-icon-button color=\"warn\" (click)=\"onDeleteItem(item, $event)\" \n matTooltip=\"Delete\" class=\"action-button\">\n <mat-icon>delete</mat-icon>\n </button>\n }\n @for (action of customRowActions; track action.label) {\n <button mat-icon-button [color]=\"action.color || 'primary'\" \n (click)=\"onCustomAction(action, item, $event)\"\n [matTooltip]=\"action.label\" class=\"action-button\">\n <mat-icon>{{ action.icon }}</mat-icon>\n </button>\n }\n </div>\n }\n </div>\n }\n </mat-list-item>\n }\n </mat-list>\n }\n</div>", styles: [".list-view-container{padding:20px;width:100%}.header{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}.header h2{margin:0;color:#333}.loading,.error,.empty-state{padding:40px 20px;text-align:center;color:#666}.error{color:#d32f2f}.empty-state p{margin-bottom:20px;font-size:16px}.items-list{border:1px solid #e0e0e0;border-radius:4px}.clickable-item{cursor:pointer;transition:background-color .2s}.clickable-item:hover{background-color:#f5f5f5}.clickable-item:not(:last-child){border-bottom:1px solid #e0e0e0}.item-content{display:flex;justify-content:space-between;align-items:center;width:100%;padding:8px 0}.item-text{flex:1;display:flex;flex-direction:column}.row-actions{display:flex;gap:4px;margin-left:16px}.action-button{width:32px;height:32px;line-height:32px}.action-button mat-icon{font-size:18px;width:18px;height:18px}\n"] }]
|
|
2160
2202
|
}], propDecorators: { modelName: [{
|
|
2161
2203
|
type: Input
|
|
2162
2204
|
}], customItemTemplate: [{
|
|
@@ -2167,12 +2209,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
2167
2209
|
type: Input
|
|
2168
2210
|
}], useRouter: [{
|
|
2169
2211
|
type: Input
|
|
2212
|
+
}], showRowActions: [{
|
|
2213
|
+
type: Input
|
|
2214
|
+
}], showDeleteAction: [{
|
|
2215
|
+
type: Input
|
|
2216
|
+
}], customRowActions: [{
|
|
2217
|
+
type: Input
|
|
2170
2218
|
}], itemClick: [{
|
|
2171
2219
|
type: Output
|
|
2172
2220
|
}], newClick: [{
|
|
2173
2221
|
type: Output
|
|
2174
2222
|
}], itemsLoaded: [{
|
|
2175
2223
|
type: Output
|
|
2224
|
+
}], itemDeleted: [{
|
|
2225
|
+
type: Output
|
|
2176
2226
|
}] } });
|
|
2177
2227
|
|
|
2178
2228
|
class ConfigurationsComponent {
|
|
@@ -2185,14 +2235,8 @@ class ConfigurationsComponent {
|
|
|
2185
2235
|
hasFormView = false;
|
|
2186
2236
|
hasListView = false;
|
|
2187
2237
|
hasFieldConfig = false;
|
|
2188
|
-
// Track if model field config exists
|
|
2189
|
-
hasModelFieldConfig = false;
|
|
2190
|
-
checkingModelFieldConfig = false;
|
|
2191
2238
|
ngOnInit() {
|
|
2192
2239
|
this.checkAvailableModels();
|
|
2193
|
-
if (this.hasFieldConfig) {
|
|
2194
|
-
this.checkModelFieldConfig();
|
|
2195
|
-
}
|
|
2196
2240
|
}
|
|
2197
2241
|
get outputs() {
|
|
2198
2242
|
return this.amplifyOutputs || this.qcs.outputs;
|
|
@@ -2215,79 +2259,6 @@ class ConfigurationsComponent {
|
|
|
2215
2259
|
FieldConfig: this.hasFieldConfig
|
|
2216
2260
|
});
|
|
2217
2261
|
}
|
|
2218
|
-
async checkModelFieldConfig() {
|
|
2219
|
-
this.checkingModelFieldConfig = true;
|
|
2220
|
-
try {
|
|
2221
|
-
// Check if there's already a FieldConfig for the model field
|
|
2222
|
-
const observable = this.ams.listItemsForModel('FieldConfig');
|
|
2223
|
-
if (observable) {
|
|
2224
|
-
observable.subscribe({
|
|
2225
|
-
next: ({ items }) => {
|
|
2226
|
-
this.hasModelFieldConfig = items.some((config) => config.model === 'FieldConfig' && config.field === 'model');
|
|
2227
|
-
this.checkingModelFieldConfig = false;
|
|
2228
|
-
console.log('ConfigurationsComponent: Model field config exists:', this.hasModelFieldConfig);
|
|
2229
|
-
},
|
|
2230
|
-
error: (error) => {
|
|
2231
|
-
console.error('ConfigurationsComponent: Error checking model field config:', error);
|
|
2232
|
-
this.checkingModelFieldConfig = false;
|
|
2233
|
-
}
|
|
2234
|
-
});
|
|
2235
|
-
}
|
|
2236
|
-
}
|
|
2237
|
-
catch (error) {
|
|
2238
|
-
console.error('ConfigurationsComponent: Error in checkModelFieldConfig:', error);
|
|
2239
|
-
this.checkingModelFieldConfig = false;
|
|
2240
|
-
}
|
|
2241
|
-
}
|
|
2242
|
-
async generateModelFieldConfig() {
|
|
2243
|
-
try {
|
|
2244
|
-
console.log('ConfigurationsComponent: Starting generateModelFieldConfig');
|
|
2245
|
-
// Get all available models from the schema
|
|
2246
|
-
const models = this.outputs.data.model_introspection.models;
|
|
2247
|
-
const modelNames = Object.keys(models);
|
|
2248
|
-
// Create a FieldConfig for the "model" field on FieldConfig model
|
|
2249
|
-
const modelFieldConfig = {
|
|
2250
|
-
name: 'Model Selector Config',
|
|
2251
|
-
description: 'Configuration for the model selector dropdown in FieldConfig forms',
|
|
2252
|
-
model: 'FieldConfig',
|
|
2253
|
-
field: 'model',
|
|
2254
|
-
field_type: 'select',
|
|
2255
|
-
label: 'Model Name'
|
|
2256
|
-
};
|
|
2257
|
-
// Create the FieldConfig record first
|
|
2258
|
-
const configResult = await this.ams.createItemPromise('FieldConfig', modelFieldConfig);
|
|
2259
|
-
if (configResult && configResult.data) {
|
|
2260
|
-
console.log('ConfigurationsComponent: Successfully created FieldConfig:', configResult.data);
|
|
2261
|
-
// Now create FieldChoice records for each model
|
|
2262
|
-
const choices = modelNames.map((modelName, index) => ({
|
|
2263
|
-
value: modelName,
|
|
2264
|
-
label: this.formatModelLabel(modelName),
|
|
2265
|
-
order: index,
|
|
2266
|
-
fieldConfigId: configResult.data.id
|
|
2267
|
-
}));
|
|
2268
|
-
// Create all choices
|
|
2269
|
-
const choicePromises = choices.map(choice => this.ams.createItemPromise('FieldChoice', choice));
|
|
2270
|
-
const choiceResults = await Promise.all(choicePromises);
|
|
2271
|
-
const successfulChoices = choiceResults.filter(result => result && result.data);
|
|
2272
|
-
console.log('ConfigurationsComponent: Created', successfulChoices.length, 'field choices');
|
|
2273
|
-
this.snackBar.open(`Model field configuration created with ${successfulChoices.length} model options!`, 'Dismiss', { duration: 3000 });
|
|
2274
|
-
// Refresh the check
|
|
2275
|
-
this.checkModelFieldConfig();
|
|
2276
|
-
}
|
|
2277
|
-
else {
|
|
2278
|
-
console.error('ConfigurationsComponent: Failed to create FieldConfig:', configResult);
|
|
2279
|
-
this.snackBar.open('Failed to create model field configuration', 'Dismiss', {
|
|
2280
|
-
duration: 3000
|
|
2281
|
-
});
|
|
2282
|
-
}
|
|
2283
|
-
}
|
|
2284
|
-
catch (error) {
|
|
2285
|
-
console.error('ConfigurationsComponent: Error in generateModelFieldConfig:', error);
|
|
2286
|
-
this.snackBar.open('Error creating model field configuration: ' + error, 'Dismiss', {
|
|
2287
|
-
duration: 5000
|
|
2288
|
-
});
|
|
2289
|
-
}
|
|
2290
|
-
}
|
|
2291
2262
|
formatModelLabel(modelName) {
|
|
2292
2263
|
// Convert PascalCase to readable format
|
|
2293
2264
|
return modelName
|
|
@@ -2383,10 +2354,7 @@ return fields;
|
|
|
2383
2354
|
const successfulDeletes = deleteResults.filter(result => result && result.data);
|
|
2384
2355
|
console.log(`ConfigurationsComponent: Successfully deleted ${successfulDeletes.length} ${modelName} records`);
|
|
2385
2356
|
this.snackBar.open(`Deleted ${successfulDeletes.length} ${modelName} records`, 'Dismiss', { duration: 3000 });
|
|
2386
|
-
//
|
|
2387
|
-
if (modelName === 'FieldConfig') {
|
|
2388
|
-
this.checkModelFieldConfig();
|
|
2389
|
-
}
|
|
2357
|
+
// No need to refresh model field config check since we removed that functionality
|
|
2390
2358
|
}
|
|
2391
2359
|
catch (deleteError) {
|
|
2392
2360
|
console.error(`ConfigurationsComponent: Error deleting ${modelName} records:`, deleteError);
|
|
@@ -2423,7 +2391,7 @@ return fields;
|
|
|
2423
2391
|
await this.deleteAllConfigs('FieldConfig');
|
|
2424
2392
|
}
|
|
2425
2393
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ConfigurationsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2426
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: ConfigurationsComponent, isStandalone: true, selector: "snteam-configurations", inputs: { amplifyOutputs: "amplifyOutputs" }, ngImport: i0, template: "<div class=\"configurations-container\">\n <h2>System Configurations</h2>\n \n <mat-accordion multi=\"true\">\n \n <!-- Table Configs Section -->\n <mat-expansion-panel>\n <mat-expansion-panel-header>\n <mat-panel-title>\n <mat-icon>table_chart</mat-icon>\n <span class=\"panel-title\">Table Configs</span>\n </mat-panel-title>\n <mat-panel-description>\n Manage table configurations and settings\n </mat-panel-description>\n </mat-expansion-panel-header>\n \n <div class=\"panel-content\">\n @if (hasTableConfig) {\n <div class=\"section-actions\">\n <button mat-raised-button color=\"warn\" (click)=\"deleteTableConfigs()\" class=\"delete-button\">\n <mat-icon>delete</mat-icon>\n Delete All Table Configs\n </button>\n </div>\n <snteam-list-view \n [modelName]=\"'TableConfig'\"\n [useRouter]=\"true\">\n </snteam-list-view>\n } @else {\n <mat-card class=\"error-card\">\n <mat-card-content>\n <mat-icon class=\"error-icon\">error_outline</mat-icon>\n <h3>TableConfig Model Not Found</h3>\n <p>The TableConfig model is not available in your Amplify schema. Please add it to your data model to manage table configurations.</p>\n <button mat-raised-button color=\"primary\" class=\"help-button\">\n <mat-icon>help</mat-icon>\n View Documentation\n </button>\n </mat-card-content>\n </mat-card>\n }\n </div>\n </mat-expansion-panel>\n\n <!-- Form Views Section -->\n <mat-expansion-panel>\n <mat-expansion-panel-header>\n <mat-panel-title>\n <mat-icon>dynamic_form</mat-icon>\n <span class=\"panel-title\">Form Views</span>\n </mat-panel-title>\n <mat-panel-description>\n Configure custom form layouts and field selections\n </mat-panel-description>\n </mat-expansion-panel-header>\n \n <div class=\"panel-content\">\n @if (hasFormView) {\n <div class=\"section-actions\">\n <button mat-raised-button color=\"warn\" (click)=\"deleteFormViews()\" class=\"delete-button\">\n <mat-icon>delete</mat-icon>\n Delete All Form Views\n </button>\n </div>\n <snteam-list-view \n [modelName]=\"'FormView'\"\n [useRouter]=\"true\">\n </snteam-list-view>\n } @else {\n <mat-card class=\"error-card\">\n <mat-card-content>\n <mat-icon class=\"error-icon\">error_outline</mat-icon>\n <h3>FormView Model Not Found</h3>\n <p>The FormView model is not available in your Amplify schema. Please add it to your data model to create custom form configurations.</p>\n <button mat-raised-button color=\"primary\" class=\"help-button\">\n <mat-icon>help</mat-icon>\n View Documentation\n </button>\n </mat-card-content>\n </mat-card>\n }\n </div>\n </mat-expansion-panel>\n\n <!-- List Views Section -->\n <mat-expansion-panel>\n <mat-expansion-panel-header>\n <mat-panel-title>\n <mat-icon>view_list</mat-icon>\n <span class=\"panel-title\">List Views</span>\n </mat-panel-title>\n <mat-panel-description>\n Customize list displays and column configurations\n </mat-panel-description>\n </mat-expansion-panel-header>\n \n <div class=\"panel-content\">\n @if (hasListView) {\n <div class=\"section-actions\">\n <button mat-raised-button color=\"warn\" (click)=\"deleteListViews()\" class=\"delete-button\">\n <mat-icon>delete</mat-icon>\n Delete All List Views\n </button>\n </div>\n <snteam-list-view \n [modelName]=\"'ListView'\"\n [useRouter]=\"true\">\n </snteam-list-view>\n } @else {\n <mat-card class=\"error-card\">\n <mat-card-content>\n <mat-icon class=\"error-icon\">error_outline</mat-icon>\n <h3>ListView Model Not Found</h3>\n <p>The ListView model is not available in your Amplify schema. Please add it to your data model to create custom list view configurations.</p>\n <button mat-raised-button color=\"primary\" class=\"help-button\">\n <mat-icon>help</mat-icon>\n View Documentation\n </button>\n </mat-card-content>\n </mat-card>\n }\n </div>\n </mat-expansion-panel>\n\n <!-- Field Configs Section -->\n <mat-expansion-panel>\n <mat-expansion-panel-header>\n <mat-panel-title>\n <mat-icon>settings</mat-icon>\n <span class=\"panel-title\">Field Configs</span>\n </mat-panel-title>\n <mat-panel-description>\n Configure field behavior, validation, and choices\n </mat-panel-description>\n </mat-expansion-panel-header>\n \n <div class=\"panel-content\">\n @if (hasFieldConfig) {\n <div class=\"section-actions\">\n @if (!hasModelFieldConfig && !checkingModelFieldConfig) {\n <button mat-raised-button color=\"primary\" (click)=\"generateModelFieldConfig()\" class=\"generate-button\">\n <mat-icon>auto_awesome</mat-icon>\n Generate Configs\n </button>\n }\n @if (checkingModelFieldConfig) {\n <button mat-raised-button disabled class=\"generate-button\">\n <mat-icon>hourglass_empty</mat-icon>\n Checking...\n </button>\n }\n <button mat-raised-button color=\"accent\" (click)=\"populateDefaultFieldConfigs()\" class=\"populate-button\">\n <mat-icon>auto_fix_high</mat-icon>\n Populate Default Field Configs\n </button>\n <button mat-raised-button color=\"warn\" (click)=\"deleteFieldConfigs()\" class=\"delete-button\">\n <mat-icon>delete</mat-icon>\n Delete All Field Configs\n </button>\n </div>\n <snteam-list-view \n [modelName]=\"'FieldConfig'\"\n [useRouter]=\"true\">\n </snteam-list-view>\n } @else {\n <mat-card class=\"error-card\">\n <mat-card-content>\n <mat-icon class=\"error-icon\">error_outline</mat-icon>\n <h3>FieldConfig Model Not Found</h3>\n <p>The FieldConfig model is not available in your Amplify schema. Please add it to your data model to configure field behavior and validation.</p>\n <button mat-raised-button color=\"primary\" class=\"help-button\">\n <mat-icon>help</mat-icon>\n View Documentation\n </button>\n </mat-card-content>\n </mat-card>\n }\n </div>\n </mat-expansion-panel>\n\n </mat-accordion>\n</div>", styles: [".configurations-container{padding:20px;max-width:1200px;margin:0 auto}.configurations-container h2{margin-bottom:24px;color:#333;font-weight:500}.mat-expansion-panel{margin-bottom:16px;border-radius:8px;box-shadow:0 2px 4px #0000001a}.mat-expansion-panel-header{padding:16px 24px}.panel-title{margin-left:12px;font-weight:500;font-size:16px}.mat-panel-description{color:#666;font-size:14px}.panel-content{padding:16px 24px 24px;background-color:#fafafa}.error-card{text-align:center;padding:24px;background-color:#fff;border:2px dashed #ddd;border-radius:8px}.error-card mat-card-content{padding:0}.error-icon{font-size:48px;width:48px;height:48px;color:#ff9800;margin-bottom:16px}.error-card h3{margin:0 0 12px;color:#333;font-weight:500}.error-card p{color:#666;line-height:1.5;max-width:500px;margin:0 auto 20px}.help-button{margin-top:8px}.help-button mat-icon{margin-right:8px}.section-actions{margin-bottom:16px;padding-bottom:16px;border-bottom:1px solid #e0e0e0;display:flex;gap:12px;flex-wrap:wrap}.generate-button{background-color:#2196f3;color:#fff}.generate-button mat-icon{margin-right:8px}.delete-button{background-color:#f44336;color:#fff}.delete-button mat-icon{margin-right:8px}.populate-button mat-icon{margin-right:8px}@media (max-width: 768px){.configurations-container{padding:16px}.panel-content{padding:12px 16px 16px}.error-card{padding:16px}.error-icon{font-size:36px;width:36px;height:36px}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatExpansionModule }, { kind: "directive", type: i1$1.MatAccordion, selector: "mat-accordion", inputs: ["hideToggle", "displayMode", "togglePosition"], exportAs: ["matAccordion"] }, { kind: "component", type: i1$1.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i1$1.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["expandedHeight", "collapsedHeight", "tabIndex"] }, { kind: "directive", type: i1$1.MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "directive", type: i1$1.MatExpansionPanelDescription, selector: "mat-panel-description" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatCardModule }, { kind: "component", type: i3$4.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i3$4.MatCardContent, selector: "mat-card-content" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3$3.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatSnackBarModule }, { kind: "component", type: ListViewComponent, selector: "snteam-list-view", inputs: ["modelName", "customItemTemplate", "hideNewButton", "title", "useRouter"], outputs: ["itemClick", "newClick", "itemsLoaded"] }] });
|
|
2394
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: ConfigurationsComponent, isStandalone: true, selector: "snteam-configurations", inputs: { amplifyOutputs: "amplifyOutputs" }, ngImport: i0, template: "<div class=\"configurations-container\">\n <h2>System Configurations</h2>\n \n <mat-accordion multi=\"true\">\n \n <!-- Table Configs Section -->\n <mat-expansion-panel>\n <mat-expansion-panel-header>\n <mat-panel-title>\n <mat-icon>table_chart</mat-icon>\n <span class=\"panel-title\">Table Configs</span>\n </mat-panel-title>\n <mat-panel-description>\n Manage table configurations and settings\n </mat-panel-description>\n </mat-expansion-panel-header>\n \n <div class=\"panel-content\">\n @if (hasTableConfig) {\n <div class=\"section-actions\">\n <button mat-raised-button color=\"warn\" (click)=\"deleteTableConfigs()\" class=\"delete-button\">\n <mat-icon>delete</mat-icon>\n Delete All Table Configs\n </button>\n </div>\n <snteam-list-view \n [modelName]=\"'TableConfig'\"\n [useRouter]=\"true\"\n [showDeleteAction]=\"true\">\n </snteam-list-view>\n } @else {\n <mat-card class=\"error-card\">\n <mat-card-content>\n <mat-icon class=\"error-icon\">error_outline</mat-icon>\n <h3>TableConfig Model Not Found</h3>\n <p>The TableConfig model is not available in your Amplify schema. Please add it to your data model to manage table configurations.</p>\n <button mat-raised-button color=\"primary\" class=\"help-button\">\n <mat-icon>help</mat-icon>\n View Documentation\n </button>\n </mat-card-content>\n </mat-card>\n }\n </div>\n </mat-expansion-panel>\n\n <!-- Form Views Section -->\n <mat-expansion-panel>\n <mat-expansion-panel-header>\n <mat-panel-title>\n <mat-icon>dynamic_form</mat-icon>\n <span class=\"panel-title\">Form Views</span>\n </mat-panel-title>\n <mat-panel-description>\n Configure custom form layouts and field selections\n </mat-panel-description>\n </mat-expansion-panel-header>\n \n <div class=\"panel-content\">\n @if (hasFormView) {\n <div class=\"section-actions\">\n <button mat-raised-button color=\"warn\" (click)=\"deleteFormViews()\" class=\"delete-button\">\n <mat-icon>delete</mat-icon>\n Delete All Form Views\n </button>\n </div>\n <snteam-list-view \n [modelName]=\"'FormView'\"\n [useRouter]=\"true\"\n [showDeleteAction]=\"true\">\n </snteam-list-view>\n } @else {\n <mat-card class=\"error-card\">\n <mat-card-content>\n <mat-icon class=\"error-icon\">error_outline</mat-icon>\n <h3>FormView Model Not Found</h3>\n <p>The FormView model is not available in your Amplify schema. Please add it to your data model to create custom form configurations.</p>\n <button mat-raised-button color=\"primary\" class=\"help-button\">\n <mat-icon>help</mat-icon>\n View Documentation\n </button>\n </mat-card-content>\n </mat-card>\n }\n </div>\n </mat-expansion-panel>\n\n <!-- List Views Section -->\n <mat-expansion-panel>\n <mat-expansion-panel-header>\n <mat-panel-title>\n <mat-icon>view_list</mat-icon>\n <span class=\"panel-title\">List Views</span>\n </mat-panel-title>\n <mat-panel-description>\n Customize list displays and column configurations\n </mat-panel-description>\n </mat-expansion-panel-header>\n \n <div class=\"panel-content\">\n @if (hasListView) {\n <div class=\"section-actions\">\n <button mat-raised-button color=\"warn\" (click)=\"deleteListViews()\" class=\"delete-button\">\n <mat-icon>delete</mat-icon>\n Delete All List Views\n </button>\n </div>\n <snteam-list-view \n [modelName]=\"'ListView'\"\n [useRouter]=\"true\"\n [showDeleteAction]=\"true\">\n </snteam-list-view>\n } @else {\n <mat-card class=\"error-card\">\n <mat-card-content>\n <mat-icon class=\"error-icon\">error_outline</mat-icon>\n <h3>ListView Model Not Found</h3>\n <p>The ListView model is not available in your Amplify schema. Please add it to your data model to create custom list view configurations.</p>\n <button mat-raised-button color=\"primary\" class=\"help-button\">\n <mat-icon>help</mat-icon>\n View Documentation\n </button>\n </mat-card-content>\n </mat-card>\n }\n </div>\n </mat-expansion-panel>\n\n <!-- Field Configs Section -->\n <mat-expansion-panel>\n <mat-expansion-panel-header>\n <mat-panel-title>\n <mat-icon>settings</mat-icon>\n <span class=\"panel-title\">Field Configs</span>\n </mat-panel-title>\n <mat-panel-description>\n Configure field behavior, validation, and choices\n </mat-panel-description>\n </mat-expansion-panel-header>\n \n <div class=\"panel-content\">\n @if (hasFieldConfig) {\n <div class=\"section-actions\">\n <button mat-raised-button color=\"accent\" (click)=\"populateDefaultFieldConfigs()\" class=\"populate-button\">\n <mat-icon>auto_fix_high</mat-icon>\n Populate Default Field Configs\n </button>\n <button mat-raised-button color=\"warn\" (click)=\"deleteFieldConfigs()\" class=\"delete-button\">\n <mat-icon>delete</mat-icon>\n Delete All Field Configs\n </button>\n </div>\n <snteam-list-view \n [modelName]=\"'FieldConfig'\"\n [useRouter]=\"true\"\n [showDeleteAction]=\"true\">\n </snteam-list-view>\n } @else {\n <mat-card class=\"error-card\">\n <mat-card-content>\n <mat-icon class=\"error-icon\">error_outline</mat-icon>\n <h3>FieldConfig Model Not Found</h3>\n <p>The FieldConfig model is not available in your Amplify schema. Please add it to your data model to configure field behavior and validation.</p>\n <button mat-raised-button color=\"primary\" class=\"help-button\">\n <mat-icon>help</mat-icon>\n View Documentation\n </button>\n </mat-card-content>\n </mat-card>\n }\n </div>\n </mat-expansion-panel>\n\n </mat-accordion>\n</div>", styles: [".configurations-container{padding:20px;max-width:1200px;margin:0 auto}.configurations-container h2{margin-bottom:24px;color:#333;font-weight:500}.mat-expansion-panel{margin-bottom:16px;border-radius:8px;box-shadow:0 2px 4px #0000001a}.mat-expansion-panel-header{padding:16px 24px}.panel-title{margin-left:12px;font-weight:500;font-size:16px}.mat-panel-description{color:#666;font-size:14px}.panel-content{padding:16px 24px 24px;background-color:#fafafa}.error-card{text-align:center;padding:24px;background-color:#fff;border:2px dashed #ddd;border-radius:8px}.error-card mat-card-content{padding:0}.error-icon{font-size:48px;width:48px;height:48px;color:#ff9800;margin-bottom:16px}.error-card h3{margin:0 0 12px;color:#333;font-weight:500}.error-card p{color:#666;line-height:1.5;max-width:500px;margin:0 auto 20px}.help-button{margin-top:8px}.help-button mat-icon{margin-right:8px}.section-actions{margin-bottom:16px;padding-bottom:16px;border-bottom:1px solid #e0e0e0;display:flex;gap:12px;flex-wrap:wrap}.generate-button{background-color:#2196f3;color:#fff}.generate-button mat-icon{margin-right:8px}.delete-button{background-color:#f44336;color:#fff}.delete-button mat-icon{margin-right:8px}.populate-button mat-icon{margin-right:8px}@media (max-width: 768px){.configurations-container{padding:16px}.panel-content{padding:12px 16px 16px}.error-card{padding:16px}.error-icon{font-size:36px;width:36px;height:36px}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatExpansionModule }, { kind: "directive", type: i1$1.MatAccordion, selector: "mat-accordion", inputs: ["hideToggle", "displayMode", "togglePosition"], exportAs: ["matAccordion"] }, { kind: "component", type: i1$1.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i1$1.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["expandedHeight", "collapsedHeight", "tabIndex"] }, { kind: "directive", type: i1$1.MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "directive", type: i1$1.MatExpansionPanelDescription, selector: "mat-panel-description" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatCardModule }, { kind: "component", type: i3$4.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i3$4.MatCardContent, selector: "mat-card-content" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3$3.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatSnackBarModule }, { kind: "component", type: ListViewComponent, selector: "snteam-list-view", inputs: ["modelName", "customItemTemplate", "hideNewButton", "title", "useRouter", "showRowActions", "showDeleteAction", "customRowActions"], outputs: ["itemClick", "newClick", "itemsLoaded", "itemDeleted"] }] });
|
|
2427
2395
|
}
|
|
2428
2396
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ConfigurationsComponent, decorators: [{
|
|
2429
2397
|
type: Component,
|
|
@@ -2435,7 +2403,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
2435
2403
|
MatButtonModule,
|
|
2436
2404
|
MatSnackBarModule,
|
|
2437
2405
|
ListViewComponent
|
|
2438
|
-
], template: "<div class=\"configurations-container\">\n <h2>System Configurations</h2>\n \n <mat-accordion multi=\"true\">\n \n <!-- Table Configs Section -->\n <mat-expansion-panel>\n <mat-expansion-panel-header>\n <mat-panel-title>\n <mat-icon>table_chart</mat-icon>\n <span class=\"panel-title\">Table Configs</span>\n </mat-panel-title>\n <mat-panel-description>\n Manage table configurations and settings\n </mat-panel-description>\n </mat-expansion-panel-header>\n \n <div class=\"panel-content\">\n @if (hasTableConfig) {\n <div class=\"section-actions\">\n <button mat-raised-button color=\"warn\" (click)=\"deleteTableConfigs()\" class=\"delete-button\">\n <mat-icon>delete</mat-icon>\n Delete All Table Configs\n </button>\n </div>\n <snteam-list-view \n [modelName]=\"'TableConfig'\"\n [useRouter]=\"true\">\n </snteam-list-view>\n } @else {\n <mat-card class=\"error-card\">\n <mat-card-content>\n <mat-icon class=\"error-icon\">error_outline</mat-icon>\n <h3>TableConfig Model Not Found</h3>\n <p>The TableConfig model is not available in your Amplify schema. Please add it to your data model to manage table configurations.</p>\n <button mat-raised-button color=\"primary\" class=\"help-button\">\n <mat-icon>help</mat-icon>\n View Documentation\n </button>\n </mat-card-content>\n </mat-card>\n }\n </div>\n </mat-expansion-panel>\n\n <!-- Form Views Section -->\n <mat-expansion-panel>\n <mat-expansion-panel-header>\n <mat-panel-title>\n <mat-icon>dynamic_form</mat-icon>\n <span class=\"panel-title\">Form Views</span>\n </mat-panel-title>\n <mat-panel-description>\n Configure custom form layouts and field selections\n </mat-panel-description>\n </mat-expansion-panel-header>\n \n <div class=\"panel-content\">\n @if (hasFormView) {\n <div class=\"section-actions\">\n <button mat-raised-button color=\"warn\" (click)=\"deleteFormViews()\" class=\"delete-button\">\n <mat-icon>delete</mat-icon>\n Delete All Form Views\n </button>\n </div>\n <snteam-list-view \n [modelName]=\"'FormView'\"\n [useRouter]=\"true\">\n </snteam-list-view>\n } @else {\n <mat-card class=\"error-card\">\n <mat-card-content>\n <mat-icon class=\"error-icon\">error_outline</mat-icon>\n <h3>FormView Model Not Found</h3>\n <p>The FormView model is not available in your Amplify schema. Please add it to your data model to create custom form configurations.</p>\n <button mat-raised-button color=\"primary\" class=\"help-button\">\n <mat-icon>help</mat-icon>\n View Documentation\n </button>\n </mat-card-content>\n </mat-card>\n }\n </div>\n </mat-expansion-panel>\n\n <!-- List Views Section -->\n <mat-expansion-panel>\n <mat-expansion-panel-header>\n <mat-panel-title>\n <mat-icon>view_list</mat-icon>\n <span class=\"panel-title\">List Views</span>\n </mat-panel-title>\n <mat-panel-description>\n Customize list displays and column configurations\n </mat-panel-description>\n </mat-expansion-panel-header>\n \n <div class=\"panel-content\">\n @if (hasListView) {\n <div class=\"section-actions\">\n <button mat-raised-button color=\"warn\" (click)=\"deleteListViews()\" class=\"delete-button\">\n <mat-icon>delete</mat-icon>\n Delete All List Views\n </button>\n </div>\n <snteam-list-view \n [modelName]=\"'ListView'\"\n [useRouter]=\"true\">\n </snteam-list-view>\n } @else {\n <mat-card class=\"error-card\">\n <mat-card-content>\n <mat-icon class=\"error-icon\">error_outline</mat-icon>\n <h3>ListView Model Not Found</h3>\n <p>The ListView model is not available in your Amplify schema. Please add it to your data model to create custom list view configurations.</p>\n <button mat-raised-button color=\"primary\" class=\"help-button\">\n <mat-icon>help</mat-icon>\n View Documentation\n </button>\n </mat-card-content>\n </mat-card>\n }\n </div>\n </mat-expansion-panel>\n\n <!-- Field Configs Section -->\n <mat-expansion-panel>\n <mat-expansion-panel-header>\n <mat-panel-title>\n <mat-icon>settings</mat-icon>\n <span class=\"panel-title\">Field Configs</span>\n </mat-panel-title>\n <mat-panel-description>\n Configure field behavior, validation, and choices\n </mat-panel-description>\n </mat-expansion-panel-header>\n \n <div class=\"panel-content\">\n @if (hasFieldConfig) {\n <div class=\"section-actions\">\n
|
|
2406
|
+
], template: "<div class=\"configurations-container\">\n <h2>System Configurations</h2>\n \n <mat-accordion multi=\"true\">\n \n <!-- Table Configs Section -->\n <mat-expansion-panel>\n <mat-expansion-panel-header>\n <mat-panel-title>\n <mat-icon>table_chart</mat-icon>\n <span class=\"panel-title\">Table Configs</span>\n </mat-panel-title>\n <mat-panel-description>\n Manage table configurations and settings\n </mat-panel-description>\n </mat-expansion-panel-header>\n \n <div class=\"panel-content\">\n @if (hasTableConfig) {\n <div class=\"section-actions\">\n <button mat-raised-button color=\"warn\" (click)=\"deleteTableConfigs()\" class=\"delete-button\">\n <mat-icon>delete</mat-icon>\n Delete All Table Configs\n </button>\n </div>\n <snteam-list-view \n [modelName]=\"'TableConfig'\"\n [useRouter]=\"true\"\n [showDeleteAction]=\"true\">\n </snteam-list-view>\n } @else {\n <mat-card class=\"error-card\">\n <mat-card-content>\n <mat-icon class=\"error-icon\">error_outline</mat-icon>\n <h3>TableConfig Model Not Found</h3>\n <p>The TableConfig model is not available in your Amplify schema. Please add it to your data model to manage table configurations.</p>\n <button mat-raised-button color=\"primary\" class=\"help-button\">\n <mat-icon>help</mat-icon>\n View Documentation\n </button>\n </mat-card-content>\n </mat-card>\n }\n </div>\n </mat-expansion-panel>\n\n <!-- Form Views Section -->\n <mat-expansion-panel>\n <mat-expansion-panel-header>\n <mat-panel-title>\n <mat-icon>dynamic_form</mat-icon>\n <span class=\"panel-title\">Form Views</span>\n </mat-panel-title>\n <mat-panel-description>\n Configure custom form layouts and field selections\n </mat-panel-description>\n </mat-expansion-panel-header>\n \n <div class=\"panel-content\">\n @if (hasFormView) {\n <div class=\"section-actions\">\n <button mat-raised-button color=\"warn\" (click)=\"deleteFormViews()\" class=\"delete-button\">\n <mat-icon>delete</mat-icon>\n Delete All Form Views\n </button>\n </div>\n <snteam-list-view \n [modelName]=\"'FormView'\"\n [useRouter]=\"true\"\n [showDeleteAction]=\"true\">\n </snteam-list-view>\n } @else {\n <mat-card class=\"error-card\">\n <mat-card-content>\n <mat-icon class=\"error-icon\">error_outline</mat-icon>\n <h3>FormView Model Not Found</h3>\n <p>The FormView model is not available in your Amplify schema. Please add it to your data model to create custom form configurations.</p>\n <button mat-raised-button color=\"primary\" class=\"help-button\">\n <mat-icon>help</mat-icon>\n View Documentation\n </button>\n </mat-card-content>\n </mat-card>\n }\n </div>\n </mat-expansion-panel>\n\n <!-- List Views Section -->\n <mat-expansion-panel>\n <mat-expansion-panel-header>\n <mat-panel-title>\n <mat-icon>view_list</mat-icon>\n <span class=\"panel-title\">List Views</span>\n </mat-panel-title>\n <mat-panel-description>\n Customize list displays and column configurations\n </mat-panel-description>\n </mat-expansion-panel-header>\n \n <div class=\"panel-content\">\n @if (hasListView) {\n <div class=\"section-actions\">\n <button mat-raised-button color=\"warn\" (click)=\"deleteListViews()\" class=\"delete-button\">\n <mat-icon>delete</mat-icon>\n Delete All List Views\n </button>\n </div>\n <snteam-list-view \n [modelName]=\"'ListView'\"\n [useRouter]=\"true\"\n [showDeleteAction]=\"true\">\n </snteam-list-view>\n } @else {\n <mat-card class=\"error-card\">\n <mat-card-content>\n <mat-icon class=\"error-icon\">error_outline</mat-icon>\n <h3>ListView Model Not Found</h3>\n <p>The ListView model is not available in your Amplify schema. Please add it to your data model to create custom list view configurations.</p>\n <button mat-raised-button color=\"primary\" class=\"help-button\">\n <mat-icon>help</mat-icon>\n View Documentation\n </button>\n </mat-card-content>\n </mat-card>\n }\n </div>\n </mat-expansion-panel>\n\n <!-- Field Configs Section -->\n <mat-expansion-panel>\n <mat-expansion-panel-header>\n <mat-panel-title>\n <mat-icon>settings</mat-icon>\n <span class=\"panel-title\">Field Configs</span>\n </mat-panel-title>\n <mat-panel-description>\n Configure field behavior, validation, and choices\n </mat-panel-description>\n </mat-expansion-panel-header>\n \n <div class=\"panel-content\">\n @if (hasFieldConfig) {\n <div class=\"section-actions\">\n <button mat-raised-button color=\"accent\" (click)=\"populateDefaultFieldConfigs()\" class=\"populate-button\">\n <mat-icon>auto_fix_high</mat-icon>\n Populate Default Field Configs\n </button>\n <button mat-raised-button color=\"warn\" (click)=\"deleteFieldConfigs()\" class=\"delete-button\">\n <mat-icon>delete</mat-icon>\n Delete All Field Configs\n </button>\n </div>\n <snteam-list-view \n [modelName]=\"'FieldConfig'\"\n [useRouter]=\"true\"\n [showDeleteAction]=\"true\">\n </snteam-list-view>\n } @else {\n <mat-card class=\"error-card\">\n <mat-card-content>\n <mat-icon class=\"error-icon\">error_outline</mat-icon>\n <h3>FieldConfig Model Not Found</h3>\n <p>The FieldConfig model is not available in your Amplify schema. Please add it to your data model to configure field behavior and validation.</p>\n <button mat-raised-button color=\"primary\" class=\"help-button\">\n <mat-icon>help</mat-icon>\n View Documentation\n </button>\n </mat-card-content>\n </mat-card>\n }\n </div>\n </mat-expansion-panel>\n\n </mat-accordion>\n</div>", styles: [".configurations-container{padding:20px;max-width:1200px;margin:0 auto}.configurations-container h2{margin-bottom:24px;color:#333;font-weight:500}.mat-expansion-panel{margin-bottom:16px;border-radius:8px;box-shadow:0 2px 4px #0000001a}.mat-expansion-panel-header{padding:16px 24px}.panel-title{margin-left:12px;font-weight:500;font-size:16px}.mat-panel-description{color:#666;font-size:14px}.panel-content{padding:16px 24px 24px;background-color:#fafafa}.error-card{text-align:center;padding:24px;background-color:#fff;border:2px dashed #ddd;border-radius:8px}.error-card mat-card-content{padding:0}.error-icon{font-size:48px;width:48px;height:48px;color:#ff9800;margin-bottom:16px}.error-card h3{margin:0 0 12px;color:#333;font-weight:500}.error-card p{color:#666;line-height:1.5;max-width:500px;margin:0 auto 20px}.help-button{margin-top:8px}.help-button mat-icon{margin-right:8px}.section-actions{margin-bottom:16px;padding-bottom:16px;border-bottom:1px solid #e0e0e0;display:flex;gap:12px;flex-wrap:wrap}.generate-button{background-color:#2196f3;color:#fff}.generate-button mat-icon{margin-right:8px}.delete-button{background-color:#f44336;color:#fff}.delete-button mat-icon{margin-right:8px}.populate-button mat-icon{margin-right:8px}@media (max-width: 768px){.configurations-container{padding:16px}.panel-content{padding:12px 16px 16px}.error-card{padding:16px}.error-icon{font-size:36px;width:36px;height:36px}}\n"] }]
|
|
2439
2407
|
}], propDecorators: { amplifyOutputs: [{
|
|
2440
2408
|
type: Input
|
|
2441
2409
|
}] } });
|