Browse Source

Refactoring/angular (#740)

* References updated.

* Styling fixes.

* Style fixes.

* Fix selector.
pull/743/head
Sebastian Stehle 4 years ago
committed by GitHub
parent
commit
26f6a9e66f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      frontend/app/features/administration/pages/restore/restore-page.component.ts
  2. 22
      frontend/app/features/administration/pages/users/user-page.component.ts
  3. 2
      frontend/app/features/apps/pages/app.component.ts
  4. 4
      frontend/app/features/apps/pages/apps-page.component.scss
  5. 2
      frontend/app/features/apps/pages/news-dialog.component.ts
  6. 2
      frontend/app/features/assets/pages/asset-tags.component.ts
  7. 12
      frontend/app/features/content/declarations.ts
  8. 14
      frontend/app/features/content/module.ts
  9. 2
      frontend/app/features/content/pages/content/content-event.component.ts
  10. 24
      frontend/app/features/content/pages/content/content-page.component.ts
  11. 6
      frontend/app/features/content/pages/content/editor/content-editor.component.ts
  12. 2
      frontend/app/features/content/pages/content/editor/content-field.component.html
  13. 2
      frontend/app/features/content/pages/content/editor/content-field.component.ts
  14. 2
      frontend/app/features/content/pages/content/editor/content-section.component.ts
  15. 4
      frontend/app/features/content/pages/content/editor/field-languages.component.html
  16. 2
      frontend/app/features/content/pages/content/editor/field-languages.component.ts
  17. 2
      frontend/app/features/content/pages/content/references/content-references.component.ts
  18. 20
      frontend/app/features/content/pages/contents/contents-page.component.html
  19. 2
      frontend/app/features/content/pages/contents/custom-view-editor.component.ts
  20. 2
      frontend/app/features/content/shared/content-extension.component.ts
  21. 2
      frontend/app/features/content/shared/forms/array-editor.component.ts
  22. 2
      frontend/app/features/content/shared/forms/array-item.component.ts
  23. 2
      frontend/app/features/content/shared/forms/assets-editor.component.ts
  24. 4
      frontend/app/features/content/shared/forms/component-section.component.ts
  25. 2
      frontend/app/features/content/shared/forms/component.component.ts
  26. 4
      frontend/app/features/content/shared/forms/field-editor.component.html
  27. 4
      frontend/app/features/content/shared/forms/field-editor.component.ts
  28. 4
      frontend/app/features/content/shared/forms/iframe-editor.component.ts
  29. 2
      frontend/app/features/content/shared/forms/stock-photo-editor.component.ts
  30. 20
      frontend/app/features/content/shared/list/content.component.ts
  31. 2
      frontend/app/features/content/shared/preview-button.component.ts
  32. 2
      frontend/app/features/content/shared/references/content-creator.component.html
  33. 17
      frontend/app/features/content/shared/references/content-creator.component.ts
  34. 2
      frontend/app/features/content/shared/references/reference-item.component.html
  35. 2
      frontend/app/features/content/shared/references/reference-item.component.ts
  36. 23
      frontend/app/features/content/shared/references/references-editor.component.ts
  37. 2
      frontend/app/features/dashboard/pages/cards/api-calls-card.component.ts
  38. 2
      frontend/app/features/dashboard/pages/cards/api-calls-summary-card.component.ts
  39. 2
      frontend/app/features/dashboard/pages/cards/api-card.component.ts
  40. 2
      frontend/app/features/dashboard/pages/cards/api-performance-card.component.ts
  41. 2
      frontend/app/features/dashboard/pages/cards/api-traffic-card.component.ts
  42. 2
      frontend/app/features/dashboard/pages/cards/api-traffic-summary-card.component.ts
  43. 2
      frontend/app/features/dashboard/pages/cards/asset-uploads-count-card.component.ts
  44. 2
      frontend/app/features/dashboard/pages/cards/asset-uploads-size-card.component.ts
  45. 2
      frontend/app/features/dashboard/pages/cards/asset-uploads-size-summary-card.component.ts
  46. 12
      frontend/app/features/dashboard/pages/cards/content-summary-card.component.ts
  47. 2
      frontend/app/features/dashboard/pages/cards/github-card.component.ts
  48. 2
      frontend/app/features/dashboard/pages/cards/history-card.component.ts
  49. 8
      frontend/app/features/dashboard/pages/cards/iframe-card.component.ts
  50. 2
      frontend/app/features/dashboard/pages/cards/schema-card.component.ts
  51. 2
      frontend/app/features/dashboard/pages/cards/support-card.component.ts
  52. 2
      frontend/app/features/rules/pages/rules/rule.component.ts
  53. 2
      frontend/app/features/rules/shared/actions/formattable-input.component.ts
  54. 2
      frontend/app/features/rules/shared/actions/generic-action.component.ts
  55. 2
      frontend/app/features/rules/shared/rule-element.component.ts
  56. 5
      frontend/app/features/rules/shared/triggers/asset-changed-trigger.component.ts
  57. 5
      frontend/app/features/rules/shared/triggers/comment-trigger.component.ts
  58. 14
      frontend/app/features/rules/shared/triggers/content-changed-trigger.component.html
  59. 2
      frontend/app/features/rules/shared/triggers/content-changed-trigger.component.ts
  60. 5
      frontend/app/features/rules/shared/triggers/schema-changed-trigger.component.ts
  61. 2
      frontend/app/features/rules/shared/triggers/usage-trigger.component.ts
  62. 13
      frontend/app/features/schemas/pages/schema/common/schema-edit-form.component.ts
  63. 13
      frontend/app/features/schemas/pages/schema/export/schema-export-form.component.ts
  64. 62
      frontend/app/features/schemas/pages/schema/fields/field-wizard.component.ts
  65. 13
      frontend/app/features/schemas/pages/schema/fields/field.component.ts
  66. 2
      frontend/app/features/schemas/pages/schema/fields/forms/field-form-common.component.ts
  67. 2
      frontend/app/features/schemas/pages/schema/fields/forms/field-form-ui.component.ts
  68. 2
      frontend/app/features/schemas/pages/schema/fields/forms/field-form-validation.component.ts
  69. 2
      frontend/app/features/schemas/pages/schema/fields/forms/field-form.component.ts
  70. 2
      frontend/app/features/schemas/pages/schema/fields/schema-fields.component.ts
  71. 2
      frontend/app/features/schemas/pages/schema/fields/types/array-validation.component.ts
  72. 2
      frontend/app/features/schemas/pages/schema/fields/types/assets-ui.component.ts
  73. 2
      frontend/app/features/schemas/pages/schema/fields/types/assets-validation.component.ts
  74. 6
      frontend/app/features/schemas/pages/schema/fields/types/boolean-ui.component.ts
  75. 2
      frontend/app/features/schemas/pages/schema/fields/types/boolean-validation.component.ts
  76. 2
      frontend/app/features/schemas/pages/schema/fields/types/component-ui.component.ts
  77. 2
      frontend/app/features/schemas/pages/schema/fields/types/component-validation.component.ts
  78. 2
      frontend/app/features/schemas/pages/schema/fields/types/components-ui.component.ts
  79. 2
      frontend/app/features/schemas/pages/schema/fields/types/components-validation.component.ts
  80. 5
      frontend/app/features/schemas/pages/schema/fields/types/date-time-ui.component.ts
  81. 2
      frontend/app/features/schemas/pages/schema/fields/types/date-time-validation.component.ts
  82. 2
      frontend/app/features/schemas/pages/schema/fields/types/geolocation-ui.component.ts
  83. 2
      frontend/app/features/schemas/pages/schema/fields/types/geolocation-validation.component.ts
  84. 2
      frontend/app/features/schemas/pages/schema/fields/types/json-ui.component.ts
  85. 2
      frontend/app/features/schemas/pages/schema/fields/types/json-validation.component.ts
  86. 5
      frontend/app/features/schemas/pages/schema/fields/types/number-ui.component.ts
  87. 2
      frontend/app/features/schemas/pages/schema/fields/types/number-validation.component.ts
  88. 6
      frontend/app/features/schemas/pages/schema/fields/types/references-ui.component.ts
  89. 2
      frontend/app/features/schemas/pages/schema/fields/types/references-validation.component.ts
  90. 6
      frontend/app/features/schemas/pages/schema/fields/types/string-ui.component.ts
  91. 6
      frontend/app/features/schemas/pages/schema/fields/types/string-validation.component.ts
  92. 6
      frontend/app/features/schemas/pages/schema/fields/types/tags-ui.component.ts
  93. 2
      frontend/app/features/schemas/pages/schema/fields/types/tags-validation.component.ts
  94. 11
      frontend/app/features/schemas/pages/schema/preview/schema-preview-urls-form.component.ts
  95. 11
      frontend/app/features/schemas/pages/schema/rules/schema-field-rules-form.component.ts
  96. 11
      frontend/app/features/schemas/pages/schema/scripts/schema-scripts-form.component.ts
  97. 11
      frontend/app/features/schemas/pages/schemas/schema-form.component.ts
  98. 2
      frontend/app/features/settings/pages/backups/backup.component.ts
  99. 11
      frontend/app/features/settings/pages/clients/client-add-form.component.ts
  100. 15
      frontend/app/features/settings/pages/clients/client-connect-form.component.ts

11
frontend/app/features/administration/pages/restore/restore-page.component.ts

@ -36,10 +36,13 @@ export class RestorePageComponent {
this.restoreForm.submitCompleted(); this.restoreForm.submitCompleted();
this.backupsService.postRestore(value) this.backupsService.postRestore(value)
.subscribe(() => { .subscribe({
this.dialogs.notifyInfo('i18n:backups.restoreStarted'); next: () => {
}, error => { this.dialogs.notifyInfo('i18n:backups.restoreStarted');
this.dialogs.notifyError(error); },
error: error => {
this.dialogs.notifyError(error);
},
}); });
} }
} }

22
frontend/app/features/administration/pages/users/user-page.component.ts

@ -56,17 +56,23 @@ export class UserPageComponent extends ResourceOwner implements OnInit {
if (value) { if (value) {
if (this.user) { if (this.user) {
this.usersState.update(this.user, value) this.usersState.update(this.user, value)
.subscribe(user => { .subscribe({
this.userForm.submitCompleted({ newValue: user }); next: user => {
}, error => { this.userForm.submitCompleted({ newValue: user });
this.userForm.submitFailed(error); },
error: error => {
this.userForm.submitFailed(error);
},
}); });
} else { } else {
this.usersState.create(<CreateUserDto>value) this.usersState.create(<CreateUserDto>value)
.subscribe(() => { .subscribe({
this.back(); next: () => {
}, error => { this.back();
this.userForm.submitFailed(error); },
error: error => {
this.userForm.submitFailed(error);
},
}); });
} }
} }

2
frontend/app/features/apps/pages/app.component.ts

@ -9,7 +9,7 @@ import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from
import { AppDto, fadeAnimation, ModalModel } from '@app/shared'; import { AppDto, fadeAnimation, ModalModel } from '@app/shared';
@Component({ @Component({
selector: 'sqx-app', selector: 'sqx-app[app]',
styleUrls: ['./app.component.scss'], styleUrls: ['./app.component.scss'],
templateUrl: './app.component.html', templateUrl: './app.component.html',
animations: [ animations: [

4
frontend/app/features/apps/pages/apps-page.component.scss

@ -48,6 +48,10 @@
a { a {
text-decoration: none; text-decoration: none;
&:hover {
text-decoration: underline;
}
} }
} }

2
frontend/app/features/apps/pages/news-dialog.component.ts

@ -9,7 +9,7 @@ import { Component, EventEmitter, Input, Output } from '@angular/core';
import { FeatureDto } from '@app/shared'; import { FeatureDto } from '@app/shared';
@Component({ @Component({
selector: 'sqx-news-dialog', selector: 'sqx-news-dialog[features]',
styleUrls: ['./news-dialog.component.scss'], styleUrls: ['./news-dialog.component.scss'],
templateUrl: './news-dialog.component.html', templateUrl: './news-dialog.component.html',
}) })

2
frontend/app/features/assets/pages/asset-tags.component.ts

@ -11,7 +11,7 @@ import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from
import { TagItem, TagsSelected } from '@app/shared'; import { TagItem, TagsSelected } from '@app/shared';
@Component({ @Component({
selector: 'sqx-asset-tags', selector: 'sqx-asset-tags[tags][tagsSelected]',
styleUrls: ['./asset-tags.component.scss'], styleUrls: ['./asset-tags.component.scss'],
templateUrl: './asset-tags.component.html', templateUrl: './asset-tags.component.html',
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,

12
frontend/app/features/content/declarations.ts

@ -20,25 +20,17 @@ export * from './pages/contents/custom-view-editor.component';
export * from './pages/schemas/schemas-page.component'; export * from './pages/schemas/schemas-page.component';
export * from './pages/sidebar/sidebar-page.component'; export * from './pages/sidebar/sidebar-page.component';
export * from './shared/content-extension.component'; export * from './shared/content-extension.component';
export * from './shared/content-status.component';
export * from './shared/due-time-selector.component'; export * from './shared/due-time-selector.component';
export * from './shared/forms/array-editor.component'; export * from './shared/forms/array-editor.component';
export * from './shared/forms/array-item.component'; export * from './shared/forms/array-item.component';
export * from './shared/forms/component.component';
export * from './shared/forms/component-section.component';
export * from './shared/forms/assets-editor.component'; export * from './shared/forms/assets-editor.component';
export * from './shared/forms/component-section.component';
export * from './shared/forms/component.component';
export * from './shared/forms/field-editor.component'; export * from './shared/forms/field-editor.component';
export * from './shared/forms/iframe-editor.component'; export * from './shared/forms/iframe-editor.component';
export * from './shared/forms/stock-photo-editor.component'; export * from './shared/forms/stock-photo-editor.component';
export * from './shared/list/content-list-cell.directive';
export * from './shared/list/content-list-field.component';
export * from './shared/list/content-list-header.component';
export * from './shared/list/content-value-editor.component';
export * from './shared/list/content-value.component';
export * from './shared/list/content.component'; export * from './shared/list/content.component';
export * from './shared/preview-button.component'; export * from './shared/preview-button.component';
export * from './shared/references/content-creator.component'; export * from './shared/references/content-creator.component';
export * from './shared/references/content-selector-item.component';
export * from './shared/references/content-selector.component';
export * from './shared/references/reference-item.component'; export * from './shared/references/reference-item.component';
export * from './shared/references/references-editor.component'; export * from './shared/references/references-editor.component';

14
frontend/app/features/content/module.ts

@ -10,7 +10,7 @@ import { RouterModule, Routes } from '@angular/router';
import { CanDeactivateGuard, ContentMustExistGuard, LoadLanguagesGuard, LoadSchemasGuard, SchemaMustExistPublishedGuard, SchemaMustNotBeSingletonGuard, SqxFrameworkModule, SqxSharedModule } from '@app/shared'; import { CanDeactivateGuard, ContentMustExistGuard, LoadLanguagesGuard, LoadSchemasGuard, SchemaMustExistPublishedGuard, SchemaMustNotBeSingletonGuard, SqxFrameworkModule, SqxSharedModule } from '@app/shared';
import { ScrollingModule } from '@angular/cdk/scrolling'; import { ScrollingModule } from '@angular/cdk/scrolling';
import { ScrollingModule as ScrollingModuleExperimental } from '@angular/cdk-experimental/scrolling'; import { ScrollingModule as ScrollingModuleExperimental } from '@angular/cdk-experimental/scrolling';
import { ArrayEditorComponent, ArrayItemComponent, AssetsEditorComponent, CommentsPageComponent, ComponentComponent, ComponentSectionComponent, ContentComponent, ContentCreatorComponent, ContentEditorComponent, ContentEventComponent, ContentExtensionComponent, ContentFieldComponent, ContentHistoryPageComponent, ContentListCellDirective, ContentListFieldComponent, ContentListHeaderComponent, ContentListWidthPipe, ContentPageComponent, ContentReferencesComponent, ContentsColumnsPipe, ContentSectionComponent, ContentSelectorComponent, ContentSelectorItemComponent, ContentsFiltersPageComponent, ContentsPageComponent, ContentStatusComponent, ContentValueComponent, ContentValueEditorComponent, CustomViewEditorComponent, DueTimeSelectorComponent, FieldEditorComponent, FieldLanguagesComponent, IFrameEditorComponent, PreviewButtonComponent, ReferenceItemComponent, ReferencesEditorComponent, SchemasPageComponent, SidebarPageComponent, StockPhotoEditorComponent } from './declarations'; import { ArrayEditorComponent, ArrayItemComponent, AssetsEditorComponent, CommentsPageComponent, ComponentComponent, ComponentSectionComponent, ContentComponent, ContentCreatorComponent, ContentEditorComponent, ContentEventComponent, ContentExtensionComponent, ContentFieldComponent, ContentHistoryPageComponent, ContentPageComponent, ContentReferencesComponent, ContentSectionComponent, ContentsFiltersPageComponent, ContentsPageComponent, CustomViewEditorComponent, DueTimeSelectorComponent, FieldEditorComponent, FieldLanguagesComponent, IFrameEditorComponent, PreviewButtonComponent, ReferenceItemComponent, ReferencesEditorComponent, SchemasPageComponent, SidebarPageComponent, StockPhotoEditorComponent } from './declarations';
const routes: Routes = [ const routes: Routes = [
{ {
@ -89,29 +89,19 @@ const routes: Routes = [
AssetsEditorComponent, AssetsEditorComponent,
CommentsPageComponent, CommentsPageComponent,
ComponentComponent, ComponentComponent,
ContentCreatorComponent,
ComponentSectionComponent, ComponentSectionComponent,
ContentComponent, ContentComponent,
ContentCreatorComponent,
ContentEditorComponent, ContentEditorComponent,
ContentEventComponent, ContentEventComponent,
ContentExtensionComponent, ContentExtensionComponent,
ContentFieldComponent, ContentFieldComponent,
ContentHistoryPageComponent, ContentHistoryPageComponent,
ContentListCellDirective,
ContentListFieldComponent,
ContentListHeaderComponent,
ContentListWidthPipe,
ContentPageComponent, ContentPageComponent,
ContentReferencesComponent, ContentReferencesComponent,
ContentsColumnsPipe,
ContentSectionComponent, ContentSectionComponent,
ContentSelectorComponent,
ContentSelectorItemComponent,
ContentsFiltersPageComponent, ContentsFiltersPageComponent,
ContentsPageComponent, ContentsPageComponent,
ContentStatusComponent,
ContentValueComponent,
ContentValueEditorComponent,
CustomViewEditorComponent, CustomViewEditorComponent,
DueTimeSelectorComponent, DueTimeSelectorComponent,
FieldEditorComponent, FieldEditorComponent,

2
frontend/app/features/content/pages/content/content-event.component.ts

@ -9,7 +9,7 @@ import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, Out
import { ContentDto, HistoryEventDto } from '@app/shared'; import { ContentDto, HistoryEventDto } from '@app/shared';
@Component({ @Component({
selector: 'sqx-content-event', selector: 'sqx-content-event[content][event]',
styleUrls: ['./content-event.component.scss'], styleUrls: ['./content-event.component.scss'],
templateUrl: './content-event.component.html', templateUrl: './content-event.component.html',
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,

24
frontend/app/features/content/pages/content/content-page.component.ts

@ -167,10 +167,13 @@ export class ContentPageComponent extends ResourceOwner implements CanComponentD
} }
this.contentsState.update(this.content, value) this.contentsState.update(this.content, value)
.subscribe(() => { .subscribe({
this.contentForm.submitCompleted({ noReset: true }); next: () => {
}, error => { this.contentForm.submitCompleted({ noReset: true });
this.contentForm.submitFailed(error); },
error: error => {
this.contentForm.submitFailed(error);
},
}); });
} else { } else {
if (!this.canCreate(publish)) { if (!this.canCreate(publish)) {
@ -178,12 +181,13 @@ export class ContentPageComponent extends ResourceOwner implements CanComponentD
} }
this.contentsState.create(value, publish) this.contentsState.create(value, publish)
.subscribe(() => { .subscribe({
this.contentForm.submitCompleted({ noReset: true }); next: () => {
this.contentForm.submitCompleted({ noReset: true });
this.back(); },
}, error => { error: error => {
this.contentForm.submitFailed(error); this.contentForm.submitFailed(error);
},
}); });
} }
} else { } else {

6
frontend/app/features/content/pages/content/editor/content-editor.component.ts

@ -9,7 +9,7 @@ import { Component, EventEmitter, Input, Output } from '@angular/core';
import { AppLanguageDto, EditContentForm, FieldForm, FieldSection, RootFieldDto, SchemaDto, Version } from '@app/shared'; import { AppLanguageDto, EditContentForm, FieldForm, FieldSection, RootFieldDto, SchemaDto, Version } from '@app/shared';
@Component({ @Component({
selector: 'sqx-content-editor', selector: 'sqx-content-editor[contentForm][formContext][language][languages][schema]',
styleUrls: ['./content-editor.component.scss'], styleUrls: ['./content-editor.component.scss'],
templateUrl: './content-editor.component.html', templateUrl: './content-editor.component.html',
}) })
@ -36,10 +36,10 @@ export class ContentEditorComponent {
public formContext: any; public formContext: any;
@Input() @Input()
public languages: ReadonlyArray<AppLanguageDto>; public language: AppLanguageDto;
@Input() @Input()
public language: AppLanguageDto; public languages: ReadonlyArray<AppLanguageDto>;
public trackBySection(_index: number, section: FieldSection<RootFieldDto, FieldForm>) { public trackBySection(_index: number, section: FieldSection<RootFieldDto, FieldForm>) {
return section.separator?.fieldId; return section.separator?.fieldId;

2
frontend/app/features/content/pages/content/editor/content-field.component.html

@ -81,7 +81,9 @@
<ng-template #singleControlCompare> <ng-template #singleControlCompare>
<sqx-field-editor <sqx-field-editor
[form]="formCompare"
[formModel]="getControlCompare()!" [formModel]="getControlCompare()!"
[formContext]="formContext"
[language]="language" [language]="language"
[languages]="languages"> [languages]="languages">
</sqx-field-editor> </sqx-field-editor>

2
frontend/app/features/content/pages/content/editor/content-field.component.ts

@ -11,7 +11,7 @@ import { combineLatest, Observable } from 'rxjs';
import { map } from 'rxjs/operators'; import { map } from 'rxjs/operators';
@Component({ @Component({
selector: 'sqx-content-field', selector: 'sqx-content-field[form][formContext][formModel][language][languages][schema]',
styleUrls: ['./content-field.component.scss'], styleUrls: ['./content-field.component.scss'],
templateUrl: './content-field.component.html', templateUrl: './content-field.component.html',
}) })

2
frontend/app/features/content/pages/content/editor/content-section.component.ts

@ -14,7 +14,7 @@ interface State {
} }
@Component({ @Component({
selector: 'sqx-content-section', selector: 'sqx-content-section[form][formContext][formSection][language][languages][schema]',
styleUrls: ['./content-section.component.scss'], styleUrls: ['./content-section.component.scss'],
templateUrl: './content-section.component.html', templateUrl: './content-section.component.html',
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,

4
frontend/app/features/content/pages/content/editor/field-languages.component.html

@ -12,8 +12,8 @@
<ng-container *ngIf="field.properties.isComplexUI || !showAllControls"> <ng-container *ngIf="field.properties.isComplexUI || !showAllControls">
<div class="button-container"> <div class="button-container">
<sqx-language-selector size="sm" #buttonLanguages <sqx-language-selector size="sm" #buttonLanguages
[selectedLanguage]="language" (languageChange)="languageChange.emit($event)"
(selectedLanguageChange)="languageChange.emit($event)" [language]="language"
[languages]="languages"> [languages]="languages">
</sqx-language-selector> </sqx-language-selector>
</div> </div>

2
frontend/app/features/content/pages/content/editor/field-languages.component.ts

@ -9,7 +9,7 @@ import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from
import { AppLanguageDto, RootFieldDto } from '@app/shared'; import { AppLanguageDto, RootFieldDto } from '@app/shared';
@Component({ @Component({
selector: 'sqx-field-languages', selector: 'sqx-field-languages[field][language][languages]',
styleUrls: ['./field-languages.component.scss'], styleUrls: ['./field-languages.component.scss'],
templateUrl: './field-languages.component.html', templateUrl: './field-languages.component.html',
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,

2
frontend/app/features/content/pages/content/references/content-references.component.ts

@ -9,7 +9,7 @@ import { ChangeDetectionStrategy, Component, Input, OnChanges, SimpleChanges } f
import { AppLanguageDto, ComponentContentsState, ContentDto, QuerySynchronizer, Router2State } from '@app/shared'; import { AppLanguageDto, ComponentContentsState, ContentDto, QuerySynchronizer, Router2State } from '@app/shared';
@Component({ @Component({
selector: 'sqx-content-references', selector: 'sqx-content-references[content][language][languages]',
styleUrls: ['./content-references.component.scss'], styleUrls: ['./content-references.component.scss'],
templateUrl: './content-references.component.html', templateUrl: './content-references.component.html',
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,

20
frontend/app/features/content/pages/contents/contents-page.component.html

@ -13,16 +13,17 @@
<div class="col"> <div class="col">
<sqx-search-form formClass="form" placeholder="{{ 'contents.searchPlaceholder' | sqxTranslate }}" <sqx-search-form formClass="form" placeholder="{{ 'contents.searchPlaceholder' | sqxTranslate }}"
(queryChange)="search($event)" (queryChange)="search($event)"
[query]="contentsState.query | async" [enableShortcut]="true"
[language]="(languagesState.isoMasterLanguage | async)!"
[languages]="languages"
[queries]="queries | async" [queries]="queries | async"
[queriesTypes]="'common.contents' | sqxTranslate" [queriesTypes]="'common.contents' | sqxTranslate"
[queryModel]="queryModel | async" [query]="contentsState.query | async"
[language]="(languagesState.isoMasterLanguage | async)!" [queryModel]="queryModel | async">
[enableShortcut]="true">
</sqx-search-form> </sqx-search-form>
</div> </div>
<div class="col-auto" *ngIf="languages.length > 1"> <div class="col-auto" *ngIf="languages.length > 1">
<sqx-language-selector class="languages-buttons" [(selectedLanguage)]="language" [languages]="languages"></sqx-language-selector> <sqx-language-selector class="languages-buttons" [(language)]="language" [languages]="languages"></sqx-language-selector>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<button type="button" class="btn btn-success" routerLink="new" title="i18n:contents.createContentTooltip" shortcut="CTRL + U" [disabled]="(contentsState.canCreateAny | async) === false"> <button type="button" class="btn btn-success" routerLink="new" title="i18n:contents.createContentTooltip" shortcut="CTRL + U" [disabled]="(contentsState.canCreateAny | async) === false">
@ -62,7 +63,8 @@
<ng-container *sqxModal="tableViewModal"> <ng-container *sqxModal="tableViewModal">
<div class="dropdown-menu" [sqxAnchoredTo]="buttonSettings" @fade position="bottom-right"> <div class="dropdown-menu" [sqxAnchoredTo]="buttonSettings" @fade position="bottom-right">
<sqx-custom-view-editor [allFields]="tableView.allFields" <sqx-custom-view-editor
[allFields]="tableView.allFields"
(fieldNamesChange)="tableView.updateFields($event)" (fieldNamesChange)="tableView.updateFields($event)"
[fieldNames]="$any(tableView.listFieldNames | async)"> [fieldNames]="$any(tableView.listFieldNames | async)">
</sqx-custom-view-editor> </sqx-custom-view-editor>
@ -105,15 +107,15 @@
<table class="table table-items table-fixed" [style.minWidth]="listFields | sqxContentListWidth" [sqxSyncWidth]="header"> <table class="table table-items table-fixed" [style.minWidth]="listFields | sqxContentListWidth" [sqxSyncWidth]="header">
<tbody *ngFor="let content of contentsState.contents | async; trackBy: trackByContent" <tbody *ngFor="let content of contentsState.contents | async; trackBy: trackByContent"
[sqxContent]="content" [sqxContent]="content"
(clone)="clone(content)"
(delete)="delete(content)" (delete)="delete(content)"
[selected]="isItemSelected(content)"
(selectedChange)="selectItem(content, $event)" (selectedChange)="selectItem(content, $event)"
(statusChange)="changeStatus(content, $event)" (statusChange)="changeStatus(content, $event)"
[cloneable]="contentsState.snapshot.canCreate" [cloneable]="contentsState.snapshot.canCreate"
(clone)="clone(content)"
[language]="language" [language]="language"
[link]="[content.id, 'history']" [link]="[content.id, 'history']"
[listFields]="listFields"> [listFields]="listFields"
[selected]="isItemSelected(content)">
</tbody> </tbody>
</table> </table>
</div> </div>

2
frontend/app/features/content/pages/contents/custom-view-editor.component.ts

@ -9,7 +9,7 @@ import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop';
import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, Output } from '@angular/core'; import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, Output } from '@angular/core';
@Component({ @Component({
selector: 'sqx-custom-view-editor', selector: 'sqx-custom-view-editor[allFields][fieldNames]',
styleUrls: ['./custom-view-editor.component.scss'], styleUrls: ['./custom-view-editor.component.scss'],
templateUrl: './custom-view-editor.component.html', templateUrl: './custom-view-editor.component.html',
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,

2
frontend/app/features/content/shared/content-extension.component.ts

@ -11,7 +11,7 @@ import { ApiUrlConfig, ResourceOwner, Types } from '@app/framework/internal';
import { AppsState, AuthService, computeEditorUrl, ContentDto, SchemaDto } from '@app/shared'; import { AppsState, AuthService, computeEditorUrl, ContentDto, SchemaDto } from '@app/shared';
@Component({ @Component({
selector: 'sqx-content-extension', selector: 'sqx-content-extension[content][contentSchema]',
styleUrls: ['./content-extension.component.scss'], styleUrls: ['./content-extension.component.scss'],
templateUrl: './content-extension.component.html', templateUrl: './content-extension.component.html',
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,

2
frontend/app/features/content/shared/forms/array-editor.component.ts

@ -13,7 +13,7 @@ import { map } from 'rxjs/operators';
import { ArrayItemComponent } from './array-item.component'; import { ArrayItemComponent } from './array-item.component';
@Component({ @Component({
selector: 'sqx-array-editor', selector: 'sqx-array-editor[form][formContext][formModel][language][languages]',
styleUrls: ['./array-editor.component.scss'], styleUrls: ['./array-editor.component.scss'],
templateUrl: './array-editor.component.html', templateUrl: './array-editor.component.html',
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,

2
frontend/app/features/content/shared/forms/array-item.component.ts

@ -17,7 +17,7 @@ interface State {
} }
@Component({ @Component({
selector: 'sqx-array-item', selector: 'sqx-array-item[form][formContext][language][languages][index]',
styleUrls: ['./array-item.component.scss'], styleUrls: ['./array-item.component.scss'],
templateUrl: './array-item.component.html', templateUrl: './array-item.component.html',
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,

2
frontend/app/features/content/shared/forms/assets-editor.component.ts

@ -50,7 +50,7 @@ export class AssetsEditorComponent extends StatefulControlComponent<State, Reado
public folderId?: string; public folderId?: string;
@Input() @Input()
public set disabled(value: boolean | null | undefined) { public set disabled(value: boolean | undefined | null) {
this.setDisabledState(value === true); this.setDisabledState(value === true);
} }

4
frontend/app/features/content/shared/forms/component-section.component.ts

@ -10,7 +10,7 @@ import { AbstractContentForm, AppLanguageDto, EditContentForm, FieldDto, FieldSe
import { FieldEditorComponent } from './field-editor.component'; import { FieldEditorComponent } from './field-editor.component';
@Component({ @Component({
selector: 'sqx-component-section', selector: 'sqx-component-section[form][formContext][formSection][language][languages]',
styleUrls: ['./component-section.component.scss'], styleUrls: ['./component-section.component.scss'],
templateUrl: './component-section.component.html', templateUrl: './component-section.component.html',
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,
@ -32,7 +32,7 @@ export class ComponentSectionComponent {
public languages: ReadonlyArray<AppLanguageDto>; public languages: ReadonlyArray<AppLanguageDto>;
@Input() @Input()
public index: number; public index: number | null | undefined;
@Input() @Input()
public canUnset?: boolean | null; public canUnset?: boolean | null;

2
frontend/app/features/content/shared/forms/component.component.ts

@ -10,7 +10,7 @@ import { AppLanguageDto, ComponentFieldPropertiesDto, ComponentForm, EditContent
import { ComponentSectionComponent } from './component-section.component'; import { ComponentSectionComponent } from './component-section.component';
@Component({ @Component({
selector: 'sqx-component', selector: 'sqx-component[form][formContext][formModel][language][languages]',
styleUrls: ['./component.component.scss'], styleUrls: ['./component.component.scss'],
templateUrl: './component.component.html', templateUrl: './component.component.html',
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,

4
frontend/app/features/content/shared/forms/field-editor.component.html

@ -112,11 +112,11 @@
</sqx-references-editor> </sqx-references-editor>
</ng-container> </ng-container>
<ng-container *ngSwitchCase="'Dropdown'"> <ng-container *ngSwitchCase="'Dropdown'">
<sqx-references-dropdown <sqx-reference-dropdown
[formControl]="editorControl" [formControl]="editorControl"
[language]="language" [language]="language"
[schemaId]="field.rawProperties.singleId"> [schemaId]="field.rawProperties.singleId">
</sqx-references-dropdown> </sqx-reference-dropdown>
</ng-container> </ng-container>
<ng-container *ngSwitchCase="'Tags'"> <ng-container *ngSwitchCase="'Tags'">
<sqx-references-tags <sqx-references-tags

4
frontend/app/features/content/shared/forms/field-editor.component.ts

@ -12,7 +12,7 @@ import { Observable } from 'rxjs';
import { map } from 'rxjs/operators'; import { map } from 'rxjs/operators';
@Component({ @Component({
selector: 'sqx-field-editor', selector: 'sqx-field-editor[form][formContext][formModel][language][languages]',
styleUrls: ['./field-editor.component.scss'], styleUrls: ['./field-editor.component.scss'],
templateUrl: './field-editor.component.html', templateUrl: './field-editor.component.html',
}) })
@ -33,7 +33,7 @@ export class FieldEditorComponent implements OnChanges {
public languages: ReadonlyArray<AppLanguageDto>; public languages: ReadonlyArray<AppLanguageDto>;
@Input() @Input()
public index: number; public index: number | null | undefined;
@Input() @Input()
public canUnset?: boolean | null; public canUnset?: boolean | null;

4
frontend/app/features/content/shared/forms/iframe-editor.component.ts

@ -21,7 +21,7 @@ interface State {
} }
@Component({ @Component({
selector: 'sqx-iframe-editor', selector: 'sqx-iframe-editor[context][formValue]',
styleUrls: ['./iframe-editor.component.scss'], styleUrls: ['./iframe-editor.component.scss'],
templateUrl: './iframe-editor.component.html', templateUrl: './iframe-editor.component.html',
providers: [ providers: [
@ -56,7 +56,7 @@ export class IFrameEditorComponent extends StatefulControlComponent<State, any>
public language?: string | null; public language?: string | null;
@Input() @Input()
public set disabled(value: boolean | null | undefined) { public set disabled(value: boolean | undefined | null) {
this.setDisabledState(value === true); this.setDisabledState(value === true);
} }

2
frontend/app/features/content/shared/forms/stock-photo-editor.component.ts

@ -34,7 +34,7 @@ interface State {
}) })
export class StockPhotoEditorComponent extends StatefulControlComponent<State, string> implements OnInit { export class StockPhotoEditorComponent extends StatefulControlComponent<State, string> implements OnInit {
@Input() @Input()
public set disabled(value: boolean | null | undefined) { public set disabled(value: boolean | undefined | null) {
this.setDisabledState(value === true); this.setDisabledState(value === true);
} }

20
frontend/app/features/content/shared/list/content.component.ts

@ -6,13 +6,12 @@
*/ */
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, OnChanges, Output, QueryList, SimpleChanges, ViewChildren } from '@angular/core'; import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, OnChanges, Output, QueryList, SimpleChanges, ViewChildren } from '@angular/core';
import { AppLanguageDto, ContentDto, ContentsState, fadeAnimation, ModalModel, PatchContentForm, RootFieldDto, TableField, Types } from '@app/shared'; import { AppLanguageDto, ContentDto, ContentListFieldComponent, ContentsState, fadeAnimation, ModalModel, PatchContentForm, RootFieldDto, TableField, Types } from '@app/shared';
import { ContentListFieldComponent } from './content-list-field.component';
/* tslint:disable: component-selector */ /* tslint:disable: component-selector */
@Component({ @Component({
selector: '[sqxContent]', selector: '[sqxContent][language][listFields]',
styleUrls: ['./content.component.scss'], styleUrls: ['./content.component.scss'],
templateUrl: './content.component.html', templateUrl: './content.component.html',
animations: [ animations: [
@ -88,14 +87,17 @@ export class ContentComponent implements OnChanges {
if (value) { if (value) {
this.contentsState.patch(this.content, value) this.contentsState.patch(this.content, value)
.subscribe(() => { .subscribe({
this.patchForm.submitCompleted({ noReset: true }); next: () => {
this.patchForm.submitCompleted({ noReset: true });
this.changeDetector.markForCheck(); this.changeDetector.markForCheck();
}, error => { },
this.patchForm.submitFailed(error); error: error => {
this.patchForm.submitFailed(error);
this.changeDetector.markForCheck(); this.changeDetector.markForCheck();
},
}); });
} }
} }

2
frontend/app/features/content/shared/preview-button.component.ts

@ -19,7 +19,7 @@ interface State {
} }
@Component({ @Component({
selector: 'sqx-preview-button', selector: 'sqx-preview-button[content][schema]',
styleUrls: ['./preview-button.component.scss'], styleUrls: ['./preview-button.component.scss'],
templateUrl: './preview-button.component.html', templateUrl: './preview-button.component.html',
animations: [ animations: [

2
frontend/app/features/content/shared/references/content-creator.component.html

@ -11,7 +11,7 @@
<div class="row gx-2 mt-3 mb-3"> <div class="row gx-2 mt-3 mb-3">
<div class="col-auto"> <div class="col-auto">
<div *ngIf="schema && languages.length > 1"> <div *ngIf="schema && languages.length > 1">
<sqx-language-selector class="languages-buttons" [(selectedLanguage)]="language!" [languages]="languages"></sqx-language-selector> <sqx-language-selector class="languages-buttons" [(language)]="language" [languages]="languages"></sqx-language-selector>
</div> </div>
</div> </div>

17
frontend/app/features/content/shared/references/content-creator.component.ts

@ -9,7 +9,7 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { AppLanguageDto, ComponentContentsState, ContentDto, EditContentForm, ResourceOwner, SchemaDto, SchemasState } from '@app/shared'; import { AppLanguageDto, ComponentContentsState, ContentDto, EditContentForm, ResourceOwner, SchemaDto, SchemasState } from '@app/shared';
@Component({ @Component({
selector: 'sqx-content-creator', selector: 'sqx-content-creator[formContext][language][languages]',
styleUrls: ['./content-creator.component.scss'], styleUrls: ['./content-creator.component.scss'],
templateUrl: './content-creator.component.html', templateUrl: './content-creator.component.html',
providers: [ providers: [
@ -94,12 +94,15 @@ export class ContentCreatorComponent extends ResourceOwner implements OnInit {
} }
this.contentsState.create(value, publish) this.contentsState.create(value, publish)
.subscribe(content => { .subscribe({
this.contentForm.submitCompleted({ noReset: true }); next: content => {
this.contentForm.submitCompleted({ noReset: true });
this.emitSelect(content);
}, error => { this.emitSelect(content);
this.contentForm.submitFailed(error); },
error: error => {
this.contentForm.submitFailed(error);
},
}); });
} else { } else {
this.contentForm.submitFailed('i18n:contents.contentNotValid'); this.contentForm.submitFailed('i18n:contents.contentNotValid');

2
frontend/app/features/content/shared/references/reference-item.component.html

@ -17,7 +17,7 @@
</td> </td>
<td sqxContentListCell="meta.status.color"> <td sqxContentListCell="meta.status.color">
<sqx-content-list-field field="meta.status.color" [content]="content"></sqx-content-list-field> <sqx-content-list-field [language]="language" field="meta.status.color" [content]="content"></sqx-content-list-field>
</td> </td>
<td class="cell-label" *ngIf="!isCompact"> <td class="cell-label" *ngIf="!isCompact">

2
frontend/app/features/content/shared/references/reference-item.component.ts

@ -11,7 +11,7 @@ import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, Out
import { AppLanguageDto, ContentDto, getContentValue } from '@app/shared'; import { AppLanguageDto, ContentDto, getContentValue } from '@app/shared';
@Component({ @Component({
selector: '[sqxReferenceItem]', selector: '[sqxReferenceItem][language]',
styleUrls: ['./reference-item.component.scss'], styleUrls: ['./reference-item.component.scss'],
templateUrl: './reference-item.component.html', templateUrl: './reference-item.component.html',
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,

23
frontend/app/features/content/shared/references/references-editor.component.ts

@ -23,7 +23,7 @@ interface State {
} }
@Component({ @Component({
selector: 'sqx-references-editor', selector: 'sqx-references-editor[formContext][language][languages][schemaIds]',
styleUrls: ['./references-editor.component.scss'], styleUrls: ['./references-editor.component.scss'],
templateUrl: './references-editor.component.html', templateUrl: './references-editor.component.html',
providers: [ providers: [
@ -48,7 +48,7 @@ export class ReferencesEditorComponent extends StatefulControlComponent<State, R
public allowDuplicates?: boolean | null = true; public allowDuplicates?: boolean | null = true;
@Input() @Input()
public set disabled(value: boolean | null | undefined) { public set disabled(value: boolean | undefined | null) {
this.setDisabledState(value === true); this.setDisabledState(value === true);
} }
@ -70,14 +70,17 @@ export class ReferencesEditorComponent extends StatefulControlComponent<State, R
const contentIds: string[] = obj; const contentIds: string[] = obj;
this.contentsService.getContentsByIds(this.appsState.appName, contentIds) this.contentsService.getContentsByIds(this.appsState.appName, contentIds)
.subscribe(dtos => { .subscribe({
this.setContentItems(contentIds.map(id => dtos.items.find(c => c.id === id)!).filter(r => !!r)); next: dtos => {
this.setContentItems(contentIds.map(id => dtos.items.find(c => c.id === id)!).filter(r => !!r));
if (this.snapshot.contentItems.length !== contentIds.length) {
this.updateValue(); if (this.snapshot.contentItems.length !== contentIds.length) {
} this.updateValue();
}, () => { }
this.setContentItems([]); },
error: () => {
this.setContentItems([]);
},
}); });
} }
} else { } else {

2
frontend/app/features/dashboard/pages/cards/api-calls-card.component.ts

@ -10,7 +10,7 @@ import { AppDto, CallsUsageDto, fadeAnimation, UsagesService } from '@app/shared
import { ChartHelpers, ChartOptions } from './shared'; import { ChartHelpers, ChartOptions } from './shared';
@Component({ @Component({
selector: 'sqx-api-calls-card', selector: 'sqx-api-calls-card[app][usage]',
styleUrls: ['./api-calls-card.component.scss'], styleUrls: ['./api-calls-card.component.scss'],
templateUrl: './api-calls-card.component.html', templateUrl: './api-calls-card.component.html',
animations: [ animations: [

2
frontend/app/features/dashboard/pages/cards/api-calls-summary-card.component.ts

@ -9,7 +9,7 @@ import { ChangeDetectionStrategy, Component, Input, OnChanges } from '@angular/c
import { AppDto, CallsUsageDto, fadeAnimation } from '@app/shared'; import { AppDto, CallsUsageDto, fadeAnimation } from '@app/shared';
@Component({ @Component({
selector: 'sqx-api-calls-summary-card', selector: 'sqx-api-calls-summary-card[app][usage]',
styleUrls: ['./api-calls-summary-card.component.scss'], styleUrls: ['./api-calls-summary-card.component.scss'],
templateUrl: './api-calls-summary-card.component.html', templateUrl: './api-calls-summary-card.component.html',
animations: [ animations: [

2
frontend/app/features/dashboard/pages/cards/api-card.component.ts

@ -9,7 +9,7 @@ import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { AppDto, fadeAnimation } from '@app/shared'; import { AppDto, fadeAnimation } from '@app/shared';
@Component({ @Component({
selector: 'sqx-api-card', selector: 'sqx-api-card[app]',
styleUrls: ['./api-card.component.scss'], styleUrls: ['./api-card.component.scss'],
templateUrl: './api-card.component.html', templateUrl: './api-card.component.html',
animations: [ animations: [

2
frontend/app/features/dashboard/pages/cards/api-performance-card.component.ts

@ -10,7 +10,7 @@ import { AppDto, CallsUsageDto, fadeAnimation } from '@app/shared';
import { ChartHelpers, ChartOptions } from './shared'; import { ChartHelpers, ChartOptions } from './shared';
@Component({ @Component({
selector: 'sqx-api-performance-card', selector: 'sqx-api-performance-card[app][usage]',
styleUrls: ['./api-performance-card.component.scss'], styleUrls: ['./api-performance-card.component.scss'],
templateUrl: './api-performance-card.component.html', templateUrl: './api-performance-card.component.html',
animations: [ animations: [

2
frontend/app/features/dashboard/pages/cards/api-traffic-card.component.ts

@ -10,7 +10,7 @@ import { AppDto, CallsUsageDto, fadeAnimation } from '@app/shared';
import { ChartHelpers, ChartOptions } from './shared'; import { ChartHelpers, ChartOptions } from './shared';
@Component({ @Component({
selector: 'sqx-api-traffic-card', selector: 'sqx-api-traffic-card[app][usage]',
styleUrls: ['./api-traffic-card.component.scss'], styleUrls: ['./api-traffic-card.component.scss'],
templateUrl: './api-traffic-card.component.html', templateUrl: './api-traffic-card.component.html',
animations: [ animations: [

2
frontend/app/features/dashboard/pages/cards/api-traffic-summary-card.component.ts

@ -9,7 +9,7 @@ import { ChangeDetectionStrategy, Component, Input, OnChanges } from '@angular/c
import { AppDto, CallsUsageDto, fadeAnimation } from '@app/shared'; import { AppDto, CallsUsageDto, fadeAnimation } from '@app/shared';
@Component({ @Component({
selector: 'sqx-api-traffic-summary-card', selector: 'sqx-api-traffic-summary-card[app][usage]',
styleUrls: ['./api-traffic-summary-card.component.scss'], styleUrls: ['./api-traffic-summary-card.component.scss'],
templateUrl: './api-traffic-summary-card.component.html', templateUrl: './api-traffic-summary-card.component.html',
animations: [ animations: [

2
frontend/app/features/dashboard/pages/cards/asset-uploads-count-card.component.ts

@ -10,7 +10,7 @@ import { AppDto, fadeAnimation, StorageUsagePerDateDto } from '@app/shared';
import { ChartHelpers, ChartOptions } from './shared'; import { ChartHelpers, ChartOptions } from './shared';
@Component({ @Component({
selector: 'sqx-asset-uploads-count-card', selector: 'sqx-asset-uploads-count-card[app][usage]',
styleUrls: ['./asset-uploads-count-card.component.scss'], styleUrls: ['./asset-uploads-count-card.component.scss'],
templateUrl: './asset-uploads-count-card.component.html', templateUrl: './asset-uploads-count-card.component.html',
animations: [ animations: [

2
frontend/app/features/dashboard/pages/cards/asset-uploads-size-card.component.ts

@ -10,7 +10,7 @@ import { AppDto, fadeAnimation, StorageUsagePerDateDto } from '@app/shared';
import { ChartHelpers, ChartOptions } from './shared'; import { ChartHelpers, ChartOptions } from './shared';
@Component({ @Component({
selector: 'sqx-asset-uploads-size-card', selector: 'sqx-asset-uploads-size-card[app][usage]',
styleUrls: ['./asset-uploads-size-card.component.scss'], styleUrls: ['./asset-uploads-size-card.component.scss'],
templateUrl: './asset-uploads-size-card.component.html', templateUrl: './asset-uploads-size-card.component.html',
animations: [ animations: [

2
frontend/app/features/dashboard/pages/cards/asset-uploads-size-summary-card.component.ts

@ -9,7 +9,7 @@ import { ChangeDetectionStrategy, Component, Input, OnChanges } from '@angular/c
import { AppDto, CurrentStorageDto, fadeAnimation } from '@app/shared'; import { AppDto, CurrentStorageDto, fadeAnimation } from '@app/shared';
@Component({ @Component({
selector: 'sqx-asset-uploads-size-summary-card', selector: 'sqx-asset-uploads-size-summary-card[app][usage]',
styleUrls: ['./asset-uploads-size-summary-card.component.scss'], styleUrls: ['./asset-uploads-size-summary-card.component.scss'],
templateUrl: './asset-uploads-size-summary-card.component.html', templateUrl: './asset-uploads-size-summary-card.component.html',
animations: [ animations: [

12
frontend/app/features/dashboard/pages/cards/content-summary-card.component.ts

@ -51,11 +51,13 @@ export class ContentSummaryCardComponent extends StatefulComponent<State> implem
query.take = 0; query.take = 0;
this.contentsService.getContents(this.app.name, this.options.schema, { query }) this.contentsService.getContents(this.app.name, this.options.schema, { query })
.subscribe(({ total: itemCount }) => { .subscribe({
this.next({ itemCount }); next: ({ total: itemCount }) => {
}, this.next({ itemCount });
() => { },
this.next({ itemCount: 0 }); error: () => {
this.next({ itemCount: 0 });
},
}); });
} }
} }

2
frontend/app/features/dashboard/pages/cards/github-card.component.ts

@ -9,7 +9,7 @@ import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { AppDto, fadeAnimation } from '@app/shared'; import { AppDto, fadeAnimation } from '@app/shared';
@Component({ @Component({
selector: 'sqx-github-card', selector: 'sqx-github-card[app]',
styleUrls: ['./github-card.component.scss'], styleUrls: ['./github-card.component.scss'],
templateUrl: './github-card.component.html', templateUrl: './github-card.component.html',
animations: [ animations: [

2
frontend/app/features/dashboard/pages/cards/history-card.component.ts

@ -10,7 +10,7 @@ import { AppDto, fadeAnimation, HistoryEventDto, HistoryService } from '@app/sha
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
@Component({ @Component({
selector: 'sqx-history-card', selector: 'sqx-history-card[app]',
styleUrls: ['./history-card.component.scss'], styleUrls: ['./history-card.component.scss'],
templateUrl: './history-card.component.html', templateUrl: './history-card.component.html',
animations: [ animations: [

8
frontend/app/features/dashboard/pages/cards/iframe-card.component.ts

@ -9,7 +9,7 @@ import { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, Input, V
import { AppDto, fadeAnimation } from '@app/shared'; import { AppDto, fadeAnimation } from '@app/shared';
@Component({ @Component({
selector: 'sqx-iframe-card', selector: 'sqx-iframe-card[app]',
styleUrls: ['./iframe-card.component.scss'], styleUrls: ['./iframe-card.component.scss'],
templateUrl: './iframe-card.component.html', templateUrl: './iframe-card.component.html',
animations: [ animations: [
@ -18,15 +18,15 @@ import { AppDto, fadeAnimation } from '@app/shared';
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,
}) })
export class IFrameCardComponent implements AfterViewInit { export class IFrameCardComponent implements AfterViewInit {
@ViewChild('iframe', { static: false })
public iframe: ElementRef<HTMLIFrameElement>;
@Input() @Input()
public app: AppDto; public app: AppDto;
@Input() @Input()
public options: any; public options: any;
@ViewChild('iframe', { static: false })
public iframe: ElementRef<HTMLIFrameElement>;
public ngAfterViewInit() { public ngAfterViewInit() {
this.iframe.nativeElement.src = this.options?.src; this.iframe.nativeElement.src = this.options?.src;
} }

2
frontend/app/features/dashboard/pages/cards/schema-card.component.ts

@ -9,7 +9,7 @@ import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { AppDto, fadeAnimation } from '@app/shared'; import { AppDto, fadeAnimation } from '@app/shared';
@Component({ @Component({
selector: 'sqx-schema-card', selector: 'sqx-schema-card[app]',
styleUrls: ['./schema-card.component.scss'], styleUrls: ['./schema-card.component.scss'],
templateUrl: './schema-card.component.html', templateUrl: './schema-card.component.html',
animations: [ animations: [

2
frontend/app/features/dashboard/pages/cards/support-card.component.ts

@ -9,7 +9,7 @@ import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { AppDto, fadeAnimation } from '@app/shared'; import { AppDto, fadeAnimation } from '@app/shared';
@Component({ @Component({
selector: 'sqx-support-card', selector: 'sqx-support-card[app]',
styleUrls: ['./support-card.component.scss'], styleUrls: ['./support-card.component.scss'],
templateUrl: './support-card.component.html', templateUrl: './support-card.component.html',
animations: [ animations: [

2
frontend/app/features/rules/pages/rules/rule.component.ts

@ -9,7 +9,7 @@ import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { ActionsDto, fadeAnimation, ModalModel, RuleDto, RulesState, TriggersDto } from '@app/shared'; import { ActionsDto, fadeAnimation, ModalModel, RuleDto, RulesState, TriggersDto } from '@app/shared';
@Component({ @Component({
selector: 'sqx-rule', selector: 'sqx-rule[rule][ruleActions][ruleTriggers]',
styleUrls: ['./rule.component.scss'], styleUrls: ['./rule.component.scss'],
templateUrl: './rule.component.html', templateUrl: './rule.component.html',
animations: [ animations: [

2
frontend/app/features/rules/shared/actions/formattable-input.component.ts

@ -18,7 +18,7 @@ type TemplateMode = 'Text' | 'Script' | 'Liquid';
const MODES: ReadonlyArray<TemplateMode> = ['Text', 'Script', 'Liquid']; const MODES: ReadonlyArray<TemplateMode> = ['Text', 'Script', 'Liquid'];
@Component({ @Component({
selector: 'sqx-formattable-input', selector: 'sqx-formattable-input[type]',
styleUrls: ['./formattable-input.component.scss'], styleUrls: ['./formattable-input.component.scss'],
templateUrl: './formattable-input.component.html', templateUrl: './formattable-input.component.html',
providers: [ providers: [

2
frontend/app/features/rules/shared/actions/generic-action.component.ts

@ -9,7 +9,7 @@ import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { ActionForm } from '@app/shared'; import { ActionForm } from '@app/shared';
@Component({ @Component({
selector: 'sqx-generic-action', selector: 'sqx-generic-action[actionForm]',
styleUrls: ['./generic-action.component.scss'], styleUrls: ['./generic-action.component.scss'],
templateUrl: './generic-action.component.html', templateUrl: './generic-action.component.html',
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,

2
frontend/app/features/rules/shared/rule-element.component.ts

@ -9,7 +9,7 @@ import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { RuleElementDto } from '@app/shared'; import { RuleElementDto } from '@app/shared';
@Component({ @Component({
selector: 'sqx-rule-element', selector: 'sqx-rule-element[element][type]',
styleUrls: ['./rule-element.component.scss'], styleUrls: ['./rule-element.component.scss'],
templateUrl: './rule-element.component.html', templateUrl: './rule-element.component.html',
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,

5
frontend/app/features/rules/shared/triggers/asset-changed-trigger.component.ts

@ -9,14 +9,11 @@ import { Component, Input } from '@angular/core';
import { TriggerForm } from '@app/shared'; import { TriggerForm } from '@app/shared';
@Component({ @Component({
selector: 'sqx-asset-changed-trigger', selector: 'sqx-asset-changed-trigger[triggerForm]',
styleUrls: ['./asset-changed-trigger.component.scss'], styleUrls: ['./asset-changed-trigger.component.scss'],
templateUrl: './asset-changed-trigger.component.html', templateUrl: './asset-changed-trigger.component.html',
}) })
export class AssetChangedTriggerComponent { export class AssetChangedTriggerComponent {
@Input()
public trigger: any;
@Input() @Input()
public triggerForm: TriggerForm; public triggerForm: TriggerForm;
} }

5
frontend/app/features/rules/shared/triggers/comment-trigger.component.ts

@ -9,14 +9,11 @@ import { Component, Input } from '@angular/core';
import { TriggerForm } from '@app/shared'; import { TriggerForm } from '@app/shared';
@Component({ @Component({
selector: 'sqx-comment-trigger', selector: 'sqx-comment-trigger[triggerForm]',
styleUrls: ['./comment-trigger.component.scss'], styleUrls: ['./comment-trigger.component.scss'],
templateUrl: './comment-trigger.component.html', templateUrl: './comment-trigger.component.html',
}) })
export class CommentTriggerComponent { export class CommentTriggerComponent {
@Input()
public trigger: any;
@Input() @Input()
public triggerForm: TriggerForm; public triggerForm: TriggerForm;
} }

14
frontend/app/features/rules/shared/triggers/content-changed-trigger.component.html

@ -1,9 +1,9 @@
<ng-container *ngIf="!triggerForm.form.controls.handleAll.value"> <ng-container *ngIf="!triggerForm.form.controls.handleAll.value">
<table class="table table-middle table-sm table-fixed table-borderless"> <table class="table table-middle table-sm table-fixed table-borderless">
<colgroup> <colgroup>
<col style="width: 40%" /> <col style="width: 40%;" />
<col style="width: 60%" /> <col style="width: 60%;" />
<col style="width: 40px" /> <col style="width: 40px;" />
</colgroup> </colgroup>
<tr> <tr>
@ -36,14 +36,16 @@
</table> </table>
<div class="section" *ngIf="schemasToAdd.length > 0"> <div class="section" *ngIf="schemasToAdd.length > 0">
<form class="form-inline" (ngSubmit)="addSchema()"> <form class="row g-2" (ngSubmit)="addSchema()">
<div class="form-group me-1"> <div class="col">
<select class="form-select schemas-control" [disabled]="triggerForm.form.disabled" [(ngModel)]="schemaToAdd" name="schema"> <select class="form-select schemas-control" [disabled]="triggerForm.form.disabled" [(ngModel)]="schemaToAdd" name="schema">
<option *ngFor="let schema of schemasToAdd; trackBy: trackBySchema" [ngValue]="schema">{{schema.displayName}}</option> <option *ngFor="let schema of schemasToAdd; trackBy: trackBySchema" [ngValue]="schema">{{schema.displayName}}</option>
</select> </select>
</div> </div>
<button type="submit" class="btn btn-success" [disabled]="triggerForm.form.disabled">Add Schema</button> <div class="col-auto">
<button type="submit" class="btn btn-success" [disabled]="triggerForm.form.disabled">Add Schema</button>
</div>
</form> </form>
</div> </div>

2
frontend/app/features/rules/shared/triggers/content-changed-trigger.component.ts

@ -15,7 +15,7 @@ export interface TriggerSchemaForm {
} }
@Component({ @Component({
selector: 'sqx-content-changed-trigger', selector: 'sqx-content-changed-trigger[trigger][triggerForm]',
styleUrls: ['./content-changed-trigger.component.scss'], styleUrls: ['./content-changed-trigger.component.scss'],
templateUrl: './content-changed-trigger.component.html', templateUrl: './content-changed-trigger.component.html',
}) })

5
frontend/app/features/rules/shared/triggers/schema-changed-trigger.component.ts

@ -9,14 +9,11 @@ import { Component, Input } from '@angular/core';
import { TriggerForm } from '@app/shared'; import { TriggerForm } from '@app/shared';
@Component({ @Component({
selector: 'sqx-schema-changed-trigger', selector: 'sqx-schema-changed-trigger[triggerForm]',
styleUrls: ['./schema-changed-trigger.component.scss'], styleUrls: ['./schema-changed-trigger.component.scss'],
templateUrl: './schema-changed-trigger.component.html', templateUrl: './schema-changed-trigger.component.html',
}) })
export class SchemaChangedTriggerComponent { export class SchemaChangedTriggerComponent {
@Input()
public trigger: any;
@Input() @Input()
public triggerForm: TriggerForm; public triggerForm: TriggerForm;
} }

2
frontend/app/features/rules/shared/triggers/usage-trigger.component.ts

@ -9,7 +9,7 @@ import { Component, Input } from '@angular/core';
import { TriggerForm } from '@app/shared'; import { TriggerForm } from '@app/shared';
@Component({ @Component({
selector: 'sqx-usage-trigger', selector: 'sqx-usage-trigger[triggerForm]',
styleUrls: ['./usage-trigger.component.scss'], styleUrls: ['./usage-trigger.component.scss'],
templateUrl: './usage-trigger.component.html', templateUrl: './usage-trigger.component.html',
}) })

13
frontend/app/features/schemas/pages/schema/common/schema-edit-form.component.ts

@ -10,7 +10,7 @@ import { FormBuilder } from '@angular/forms';
import { EditSchemaForm, SchemaDto, SchemasState } from '@app/shared'; import { EditSchemaForm, SchemaDto, SchemasState } from '@app/shared';
@Component({ @Component({
selector: 'sqx-schema-edit-form', selector: 'sqx-schema-edit-form[schema]',
styleUrls: ['./schema-edit-form.component.scss'], styleUrls: ['./schema-edit-form.component.scss'],
templateUrl: './schema-edit-form.component.html', templateUrl: './schema-edit-form.component.html',
}) })
@ -44,10 +44,13 @@ export class SchemaEditFormComponent implements OnChanges {
if (value) { if (value) {
this.schemasState.update(this.schema, value) this.schemasState.update(this.schema, value)
.subscribe(() => { .subscribe({
this.fieldForm.submitCompleted({ noReset: true }); next: () => {
}, error => { this.fieldForm.submitCompleted({ noReset: true });
this.fieldForm.submitFailed(error); },
error: error => {
this.fieldForm.submitFailed(error);
},
}); });
} }
} }

13
frontend/app/features/schemas/pages/schema/export/schema-export-form.component.ts

@ -10,7 +10,7 @@ import { FormBuilder } from '@angular/forms';
import { SchemaDto, SchemasState, SynchronizeSchemaForm } from '@app/shared'; import { SchemaDto, SchemasState, SynchronizeSchemaForm } from '@app/shared';
@Component({ @Component({
selector: 'sqx-schema-export-form', selector: 'sqx-schema-export-form[schema]',
styleUrls: ['./schema-export-form.component.scss'], styleUrls: ['./schema-export-form.component.scss'],
templateUrl: './schema-export-form.component.html', templateUrl: './schema-export-form.component.html',
}) })
@ -43,10 +43,13 @@ export class SchemaExportFormComponent implements OnChanges {
if (value) { if (value) {
this.schemasState.synchronize(this.schema, value) this.schemasState.synchronize(this.schema, value)
.subscribe(() => { .subscribe({
this.synchronizeForm.submitCompleted({ noReset: true }); next: () => {
}, error => { this.synchronizeForm.submitCompleted({ noReset: true });
this.synchronizeForm.submitFailed(error); },
error: error => {
this.synchronizeForm.submitFailed(error);
},
}); });
} }
} }

62
frontend/app/features/schemas/pages/schema/fields/field-wizard.component.ts

@ -12,7 +12,7 @@ import { AddFieldForm, AppSettingsDto, createProperties, EditFieldForm, FieldDto
const DEFAULT_FIELD = { name: '', partitioning: 'invariant', properties: createProperties('String') }; const DEFAULT_FIELD = { name: '', partitioning: 'invariant', properties: createProperties('String') };
@Component({ @Component({
selector: 'sqx-field-wizard', selector: 'sqx-field-wizard[schema][settings]',
styleUrls: ['./field-wizard.component.scss'], styleUrls: ['./field-wizard.component.scss'],
templateUrl: './field-wizard.component.html', templateUrl: './field-wizard.component.html',
}) })
@ -27,7 +27,7 @@ export class FieldWizardComponent implements OnInit {
public settings: AppSettingsDto; public settings: AppSettingsDto;
@Input() @Input()
public parent: RootFieldDto; public parent: RootFieldDto | null | undefined;
@Output() @Output()
public complete = new EventEmitter(); public complete = new EventEmitter();
@ -65,23 +65,26 @@ export class FieldWizardComponent implements OnInit {
if (value) { if (value) {
this.schemasState.addField(this.schema, value, this.parent) this.schemasState.addField(this.schema, value, this.parent)
.subscribe(dto => { .subscribe({
this.field = dto; next: dto => {
this.field = dto;
this.addFieldForm.submitCompleted({ newValue: { ...DEFAULT_FIELD } });
this.addFieldForm.submitCompleted({ newValue: { ...DEFAULT_FIELD } });
if (addNew) {
if (Types.isFunction(this.nameInput.nativeElement.focus)) { if (addNew) {
this.nameInput.nativeElement.focus(); if (Types.isFunction(this.nameInput.nativeElement.focus)) {
this.nameInput.nativeElement.focus();
}
} else if (edit) {
this.editForm = new EditFieldForm(this.formBuilder, this.field.properties);
this.editForm.load(this.field.properties);
} else {
this.emitComplete();
} }
} else if (edit) { },
this.editForm = new EditFieldForm(this.formBuilder, this.field.properties); error: error => {
this.editForm.load(this.field.properties); this.addFieldForm.submitFailed(error);
} else { },
this.emitComplete();
}
}, error => {
this.addFieldForm.submitFailed(error);
}); });
} }
} }
@ -97,16 +100,19 @@ export class FieldWizardComponent implements OnInit {
const properties = createProperties(this.field.properties.fieldType, value); const properties = createProperties(this.field.properties.fieldType, value);
this.schemasState.updateField(this.schema, this.field as RootFieldDto, { properties }) this.schemasState.updateField(this.schema, this.field as RootFieldDto, { properties })
.subscribe(() => { .subscribe({
this.editForm!.submitCompleted(); next: () => {
this.editForm!.submitCompleted();
if (addNew) {
this.editForm = undefined; if (addNew) {
} else { this.editForm = undefined;
this.emitComplete(); } else {
} this.emitComplete();
}, error => { }
this.editForm!.submitFailed(error); },
error: error => {
this.editForm!.submitFailed(error);
},
}); });
} }
} }

13
frontend/app/features/schemas/pages/schema/fields/field.component.ts

@ -11,7 +11,7 @@ import { FormBuilder } from '@angular/forms';
import { AppSettingsDto, createProperties, DialogModel, EditFieldForm, fadeAnimation, LanguageDto, ModalModel, NestedFieldDto, RootFieldDto, SchemaDto, SchemasState, sorted } from '@app/shared'; import { AppSettingsDto, createProperties, DialogModel, EditFieldForm, fadeAnimation, LanguageDto, ModalModel, NestedFieldDto, RootFieldDto, SchemaDto, SchemasState, sorted } from '@app/shared';
@Component({ @Component({
selector: 'sqx-field', selector: 'sqx-field[field][languages][schema][settings]',
styleUrls: ['./field.component.scss'], styleUrls: ['./field.component.scss'],
templateUrl: './field.component.html', templateUrl: './field.component.html',
animations: [ animations: [
@ -112,10 +112,13 @@ export class FieldComponent implements OnChanges {
const properties = createProperties(this.field.properties.fieldType, value); const properties = createProperties(this.field.properties.fieldType, value);
this.schemasState.updateField(this.schema, this.field, { properties }) this.schemasState.updateField(this.schema, this.field, { properties })
.subscribe(() => { .subscribe({
this.editForm.submitCompleted({ noReset: true }); next: () => {
}, error => { this.editForm.submitCompleted({ noReset: true });
this.editForm.submitFailed(error); },
error: error => {
this.editForm.submitFailed(error);
},
}); });
} }
} }

2
frontend/app/features/schemas/pages/schema/fields/forms/field-form-common.component.ts

@ -10,7 +10,7 @@ import { FormGroup } from '@angular/forms';
import { FieldDto } from '@app/shared'; import { FieldDto } from '@app/shared';
@Component({ @Component({
selector: 'sqx-field-form-common', selector: 'sqx-field-form-common[field][fieldForm]',
styleUrls: ['./field-form-common.component.scss'], styleUrls: ['./field-form-common.component.scss'],
templateUrl: './field-form-common.component.html', templateUrl: './field-form-common.component.html',
}) })

2
frontend/app/features/schemas/pages/schema/fields/forms/field-form-ui.component.ts

@ -10,7 +10,7 @@ import { FormGroup } from '@angular/forms';
import { FieldDto } from '@app/shared'; import { FieldDto } from '@app/shared';
@Component({ @Component({
selector: 'sqx-field-form-ui', selector: 'sqx-field-form-ui[field][fieldForm]',
styleUrls: ['./field-form-ui.component.scss'], styleUrls: ['./field-form-ui.component.scss'],
templateUrl: './field-form-ui.component.html', templateUrl: './field-form-ui.component.html',
}) })

2
frontend/app/features/schemas/pages/schema/fields/forms/field-form-validation.component.ts

@ -10,7 +10,7 @@ import { FormGroup } from '@angular/forms';
import { AppSettingsDto, FieldDto, LanguageDto } from '@app/shared'; import { AppSettingsDto, FieldDto, LanguageDto } from '@app/shared';
@Component({ @Component({
selector: 'sqx-field-form-validation', selector: 'sqx-field-form-validation[field][fieldForm][languages][settings]',
styleUrls: ['./field-form-validation.component.scss'], styleUrls: ['./field-form-validation.component.scss'],
templateUrl: './field-form-validation.component.html', templateUrl: './field-form-validation.component.html',
}) })

2
frontend/app/features/schemas/pages/schema/fields/forms/field-form.component.ts

@ -10,7 +10,7 @@ import { FormGroup } from '@angular/forms';
import { AppSettingsDto, FieldDto, LanguageDto } from '@app/shared'; import { AppSettingsDto, FieldDto, LanguageDto } from '@app/shared';
@Component({ @Component({
selector: 'sqx-field-form', selector: 'sqx-field-form[field][fieldForm][languages][settings]',
styleUrls: ['./field-form.component.scss'], styleUrls: ['./field-form.component.scss'],
templateUrl: './field-form.component.html', templateUrl: './field-form.component.html',
}) })

2
frontend/app/features/schemas/pages/schema/fields/schema-fields.component.ts

@ -10,7 +10,7 @@ import { Component, Input, OnInit } from '@angular/core';
import { AppsState, DialogModel, FieldDto, fieldTypes, LanguagesState, SchemaDto, SchemasState, sorted } from '@app/shared'; import { AppsState, DialogModel, FieldDto, fieldTypes, LanguagesState, SchemaDto, SchemasState, sorted } from '@app/shared';
@Component({ @Component({
selector: 'sqx-schema-fields', selector: 'sqx-schema-fields[schema]',
styleUrls: ['./schema-fields.component.scss'], styleUrls: ['./schema-fields.component.scss'],
templateUrl: './schema-fields.component.html', templateUrl: './schema-fields.component.html',
}) })

2
frontend/app/features/schemas/pages/schema/fields/types/array-validation.component.ts

@ -10,7 +10,7 @@ import { FormGroup } from '@angular/forms';
import { ArrayFieldPropertiesDto, FieldDto, SchemaTagSource } from '@app/shared'; import { ArrayFieldPropertiesDto, FieldDto, SchemaTagSource } from '@app/shared';
@Component({ @Component({
selector: 'sqx-array-validation', selector: 'sqx-array-validation[field][fieldForm][properties]',
styleUrls: ['array-validation.component.scss'], styleUrls: ['array-validation.component.scss'],
templateUrl: 'array-validation.component.html', templateUrl: 'array-validation.component.html',
}) })

2
frontend/app/features/schemas/pages/schema/fields/types/assets-ui.component.ts

@ -10,7 +10,7 @@ import { FormGroup } from '@angular/forms';
import { AssetsFieldPropertiesDto, FieldDto } from '@app/shared'; import { AssetsFieldPropertiesDto, FieldDto } from '@app/shared';
@Component({ @Component({
selector: 'sqx-assets-ui', selector: 'sqx-assets-ui[field][fieldForm][properties]',
styleUrls: ['assets-ui.component.scss'], styleUrls: ['assets-ui.component.scss'],
templateUrl: 'assets-ui.component.html', templateUrl: 'assets-ui.component.html',
}) })

2
frontend/app/features/schemas/pages/schema/fields/types/assets-validation.component.ts

@ -10,7 +10,7 @@ import { FormGroup } from '@angular/forms';
import { AssetsFieldPropertiesDto, FieldDto, LanguageDto } from '@app/shared'; import { AssetsFieldPropertiesDto, FieldDto, LanguageDto } from '@app/shared';
@Component({ @Component({
selector: 'sqx-assets-validation', selector: 'sqx-assets-validation[field][fieldForm][properties]',
styleUrls: ['assets-validation.component.scss'], styleUrls: ['assets-validation.component.scss'],
templateUrl: 'assets-validation.component.html', templateUrl: 'assets-validation.component.html',
}) })

6
frontend/app/features/schemas/pages/schema/fields/types/boolean-ui.component.ts

@ -10,11 +10,13 @@ import { FormGroup } from '@angular/forms';
import { BooleanFieldPropertiesDto, BOOLEAN_FIELD_EDITORS, FieldDto } from '@app/shared'; import { BooleanFieldPropertiesDto, BOOLEAN_FIELD_EDITORS, FieldDto } from '@app/shared';
@Component({ @Component({
selector: 'sqx-boolean-ui', selector: 'sqx-boolean-ui[field][fieldForm][properties]',
styleUrls: ['boolean-ui.component.scss'], styleUrls: ['boolean-ui.component.scss'],
templateUrl: 'boolean-ui.component.html', templateUrl: 'boolean-ui.component.html',
}) })
export class BooleanUIComponent { export class BooleanUIComponent {
public readonly editors = BOOLEAN_FIELD_EDITORS;
@Input() @Input()
public fieldForm: FormGroup; public fieldForm: FormGroup;
@ -23,6 +25,4 @@ export class BooleanUIComponent {
@Input() @Input()
public properties: BooleanFieldPropertiesDto; public properties: BooleanFieldPropertiesDto;
public editors = BOOLEAN_FIELD_EDITORS;
} }

2
frontend/app/features/schemas/pages/schema/fields/types/boolean-validation.component.ts

@ -11,7 +11,7 @@ import { BooleanFieldPropertiesDto, FieldDto, hasNoValue$, LanguageDto } from '@
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
@Component({ @Component({
selector: 'sqx-boolean-validation', selector: 'sqx-boolean-validation[field][fieldForm][properties]',
styleUrls: ['boolean-validation.component.scss'], styleUrls: ['boolean-validation.component.scss'],
templateUrl: 'boolean-validation.component.html', templateUrl: 'boolean-validation.component.html',
}) })

2
frontend/app/features/schemas/pages/schema/fields/types/component-ui.component.ts

@ -10,7 +10,7 @@ import { FormGroup } from '@angular/forms';
import { FieldDto, ReferencesFieldPropertiesDto } from '@app/shared'; import { FieldDto, ReferencesFieldPropertiesDto } from '@app/shared';
@Component({ @Component({
selector: 'sqx-component-ui', selector: 'sqx-component-ui[field][fieldForm][properties]',
styleUrls: ['component-ui.component.scss'], styleUrls: ['component-ui.component.scss'],
templateUrl: 'component-ui.component.html', templateUrl: 'component-ui.component.html',
}) })

2
frontend/app/features/schemas/pages/schema/fields/types/component-validation.component.ts

@ -10,7 +10,7 @@ import { FormGroup } from '@angular/forms';
import { FieldDto, ReferencesFieldPropertiesDto, SchemaTagSource } from '@app/shared'; import { FieldDto, ReferencesFieldPropertiesDto, SchemaTagSource } from '@app/shared';
@Component({ @Component({
selector: 'sqx-component-validation', selector: 'sqx-component-validation[field][fieldForm][properties]',
styleUrls: ['component-validation.component.scss'], styleUrls: ['component-validation.component.scss'],
templateUrl: 'component-validation.component.html', templateUrl: 'component-validation.component.html',
}) })

2
frontend/app/features/schemas/pages/schema/fields/types/components-ui.component.ts

@ -10,7 +10,7 @@ import { FormGroup } from '@angular/forms';
import { FieldDto, ReferencesFieldPropertiesDto } from '@app/shared'; import { FieldDto, ReferencesFieldPropertiesDto } from '@app/shared';
@Component({ @Component({
selector: 'sqx-components-ui', selector: 'sqx-components-ui[field][fieldForm][properties]',
styleUrls: ['components-ui.component.scss'], styleUrls: ['components-ui.component.scss'],
templateUrl: 'components-ui.component.html', templateUrl: 'components-ui.component.html',
}) })

2
frontend/app/features/schemas/pages/schema/fields/types/components-validation.component.ts

@ -10,7 +10,7 @@ import { FormGroup } from '@angular/forms';
import { FieldDto, ReferencesFieldPropertiesDto, SchemaTagSource } from '@app/shared'; import { FieldDto, ReferencesFieldPropertiesDto, SchemaTagSource } from '@app/shared';
@Component({ @Component({
selector: 'sqx-components-validation', selector: 'sqx-components-validation[field][fieldForm][properties]',
styleUrls: ['components-validation.component.scss'], styleUrls: ['components-validation.component.scss'],
templateUrl: 'components-validation.component.html', templateUrl: 'components-validation.component.html',
}) })

5
frontend/app/features/schemas/pages/schema/fields/types/date-time-ui.component.ts

@ -10,12 +10,13 @@ import { FormGroup } from '@angular/forms';
import { DateTimeFieldPropertiesDto, DATETIME_FIELD_EDITORS, FieldDto, FloatConverter } from '@app/shared'; import { DateTimeFieldPropertiesDto, DATETIME_FIELD_EDITORS, FieldDto, FloatConverter } from '@app/shared';
@Component({ @Component({
selector: 'sqx-date-time-ui', selector: 'sqx-date-time-ui[field][fieldForm][properties]',
styleUrls: ['date-time-ui.component.scss'], styleUrls: ['date-time-ui.component.scss'],
templateUrl: 'date-time-ui.component.html', templateUrl: 'date-time-ui.component.html',
}) })
export class DateTimeUIComponent { export class DateTimeUIComponent {
public readonly converter = FloatConverter.INSTANCE; public readonly converter = FloatConverter.INSTANCE;
public readonly editors = DATETIME_FIELD_EDITORS;
@Input() @Input()
public fieldForm: FormGroup; public fieldForm: FormGroup;
@ -25,6 +26,4 @@ export class DateTimeUIComponent {
@Input() @Input()
public properties: DateTimeFieldPropertiesDto; public properties: DateTimeFieldPropertiesDto;
public editors = DATETIME_FIELD_EDITORS;
} }

2
frontend/app/features/schemas/pages/schema/fields/types/date-time-validation.component.ts

@ -13,7 +13,7 @@ import { Observable } from 'rxjs';
const CALCULATED_DEFAULT_VALUES: ReadonlyArray<string> = ['Now', 'Today']; const CALCULATED_DEFAULT_VALUES: ReadonlyArray<string> = ['Now', 'Today'];
@Component({ @Component({
selector: 'sqx-date-time-validation', selector: 'sqx-date-time-validation[field][fieldForm][properties]',
styleUrls: ['date-time-validation.component.scss'], styleUrls: ['date-time-validation.component.scss'],
templateUrl: 'date-time-validation.component.html', templateUrl: 'date-time-validation.component.html',
}) })

2
frontend/app/features/schemas/pages/schema/fields/types/geolocation-ui.component.ts

@ -10,7 +10,7 @@ import { FormGroup } from '@angular/forms';
import { FieldDto, GeolocationFieldPropertiesDto } from '@app/shared'; import { FieldDto, GeolocationFieldPropertiesDto } from '@app/shared';
@Component({ @Component({
selector: 'sqx-geolocation-ui', selector: 'sqx-geolocation-ui[field][fieldForm][properties]',
styleUrls: ['geolocation-ui.component.scss'], styleUrls: ['geolocation-ui.component.scss'],
templateUrl: 'geolocation-ui.component.html', templateUrl: 'geolocation-ui.component.html',
}) })

2
frontend/app/features/schemas/pages/schema/fields/types/geolocation-validation.component.ts

@ -10,7 +10,7 @@ import { FormGroup } from '@angular/forms';
import { FieldDto, GeolocationFieldPropertiesDto } from '@app/shared'; import { FieldDto, GeolocationFieldPropertiesDto } from '@app/shared';
@Component({ @Component({
selector: 'sqx-geolocation-validation', selector: 'sqx-geolocation-validation[field][fieldForm][properties]',
styleUrls: ['geolocation-validation.component.scss'], styleUrls: ['geolocation-validation.component.scss'],
templateUrl: 'geolocation-validation.component.html', templateUrl: 'geolocation-validation.component.html',
}) })

2
frontend/app/features/schemas/pages/schema/fields/types/json-ui.component.ts

@ -10,7 +10,7 @@ import { FormGroup } from '@angular/forms';
import { FieldDto, JsonFieldPropertiesDto } from '@app/shared'; import { FieldDto, JsonFieldPropertiesDto } from '@app/shared';
@Component({ @Component({
selector: 'sqx-json-ui', selector: 'sqx-json-ui[field][fieldForm][properties]',
styleUrls: ['json-ui.component.scss'], styleUrls: ['json-ui.component.scss'],
templateUrl: 'json-ui.component.html', templateUrl: 'json-ui.component.html',
}) })

2
frontend/app/features/schemas/pages/schema/fields/types/json-validation.component.ts

@ -10,7 +10,7 @@ import { FormGroup } from '@angular/forms';
import { FieldDto, JsonFieldPropertiesDto } from '@app/shared'; import { FieldDto, JsonFieldPropertiesDto } from '@app/shared';
@Component({ @Component({
selector: 'sqx-json-validation', selector: 'sqx-json-validation[field][fieldForm][properties]',
styleUrls: ['json-validation.component.scss'], styleUrls: ['json-validation.component.scss'],
templateUrl: 'json-validation.component.html', templateUrl: 'json-validation.component.html',
}) })

5
frontend/app/features/schemas/pages/schema/fields/types/number-ui.component.ts

@ -12,12 +12,13 @@ import { Observable } from 'rxjs';
import { map } from 'rxjs/operators'; import { map } from 'rxjs/operators';
@Component({ @Component({
selector: 'sqx-number-ui', selector: 'sqx-number-ui[field][fieldForm][properties]',
styleUrls: ['number-ui.component.scss'], styleUrls: ['number-ui.component.scss'],
templateUrl: 'number-ui.component.html', templateUrl: 'number-ui.component.html',
}) })
export class NumberUIComponent extends ResourceOwner implements OnChanges { export class NumberUIComponent extends ResourceOwner implements OnChanges {
public readonly converter = FloatConverter.INSTANCE; public readonly converter = FloatConverter.INSTANCE;
public readonly editors = NUMBER_FIELD_EDITORS;
@Input() @Input()
public fieldForm: FormGroup; public fieldForm: FormGroup;
@ -28,8 +29,6 @@ export class NumberUIComponent extends ResourceOwner implements OnChanges {
@Input() @Input()
public properties: NumberFieldPropertiesDto; public properties: NumberFieldPropertiesDto;
public editors = NUMBER_FIELD_EDITORS;
public hideAllowedValues: Observable<boolean>; public hideAllowedValues: Observable<boolean>;
public hideInlineEditable: Observable<boolean>; public hideInlineEditable: Observable<boolean>;

2
frontend/app/features/schemas/pages/schema/fields/types/number-validation.component.ts

@ -10,7 +10,7 @@ import { FormGroup } from '@angular/forms';
import { FieldDto, LanguageDto, NumberFieldPropertiesDto, RootFieldDto, Types } from '@app/shared'; import { FieldDto, LanguageDto, NumberFieldPropertiesDto, RootFieldDto, Types } from '@app/shared';
@Component({ @Component({
selector: 'sqx-number-validation', selector: 'sqx-number-validation[field][fieldForm][properties]',
styleUrls: ['number-validation.component.scss'], styleUrls: ['number-validation.component.scss'],
templateUrl: 'number-validation.component.html', templateUrl: 'number-validation.component.html',
}) })

6
frontend/app/features/schemas/pages/schema/fields/types/references-ui.component.ts

@ -10,11 +10,13 @@ import { FormGroup } from '@angular/forms';
import { FieldDto, ReferencesFieldPropertiesDto, REFERENCES_FIELD_EDITORS } from '@app/shared'; import { FieldDto, ReferencesFieldPropertiesDto, REFERENCES_FIELD_EDITORS } from '@app/shared';
@Component({ @Component({
selector: 'sqx-references-ui', selector: 'sqx-references-ui[field][fieldForm][properties]',
styleUrls: ['references-ui.component.scss'], styleUrls: ['references-ui.component.scss'],
templateUrl: 'references-ui.component.html', templateUrl: 'references-ui.component.html',
}) })
export class ReferencesUIComponent { export class ReferencesUIComponent {
public readonly editors = REFERENCES_FIELD_EDITORS;
@Input() @Input()
public fieldForm: FormGroup; public fieldForm: FormGroup;
@ -23,6 +25,4 @@ export class ReferencesUIComponent {
@Input() @Input()
public properties: ReferencesFieldPropertiesDto; public properties: ReferencesFieldPropertiesDto;
public editors = REFERENCES_FIELD_EDITORS;
} }

2
frontend/app/features/schemas/pages/schema/fields/types/references-validation.component.ts

@ -10,7 +10,7 @@ import { FormGroup } from '@angular/forms';
import { FieldDto, LanguageDto, ReferencesFieldPropertiesDto, SchemaTagSource } from '@app/shared'; import { FieldDto, LanguageDto, ReferencesFieldPropertiesDto, SchemaTagSource } from '@app/shared';
@Component({ @Component({
selector: 'sqx-references-validation', selector: 'sqx-references-validation[field][fieldForm][properties]',
styleUrls: ['references-validation.component.scss'], styleUrls: ['references-validation.component.scss'],
templateUrl: 'references-validation.component.html', templateUrl: 'references-validation.component.html',
}) })

6
frontend/app/features/schemas/pages/schema/fields/types/string-ui.component.ts

@ -12,11 +12,13 @@ import { Observable } from 'rxjs';
import { map } from 'rxjs/operators'; import { map } from 'rxjs/operators';
@Component({ @Component({
selector: 'sqx-string-ui', selector: 'sqx-string-ui[field][fieldForm][properties]',
styleUrls: ['string-ui.component.scss'], styleUrls: ['string-ui.component.scss'],
templateUrl: 'string-ui.component.html', templateUrl: 'string-ui.component.html',
}) })
export class StringUIComponent extends ResourceOwner implements OnChanges { export class StringUIComponent extends ResourceOwner implements OnChanges {
public readonly editors = STRING_FIELD_EDITORS;
@Input() @Input()
public fieldForm: FormGroup; public fieldForm: FormGroup;
@ -26,8 +28,6 @@ export class StringUIComponent extends ResourceOwner implements OnChanges {
@Input() @Input()
public properties: StringFieldPropertiesDto; public properties: StringFieldPropertiesDto;
public editors = STRING_FIELD_EDITORS;
public hideAllowedValues: Observable<boolean>; public hideAllowedValues: Observable<boolean>;
public hideInlineEditable: Observable<boolean>; public hideInlineEditable: Observable<boolean>;

6
frontend/app/features/schemas/pages/schema/fields/types/string-validation.component.ts

@ -11,7 +11,7 @@ import { AppSettingsDto, fadeAnimation, FieldDto, hasNoValue$, hasValue$, Langua
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
@Component({ @Component({
selector: 'sqx-string-validation', selector: 'sqx-string-validation[field][fieldForm][properties]',
styleUrls: ['string-validation.component.scss'], styleUrls: ['string-validation.component.scss'],
templateUrl: 'string-validation.component.html', templateUrl: 'string-validation.component.html',
animations: [ animations: [
@ -19,6 +19,8 @@ import { Observable } from 'rxjs';
], ],
}) })
export class StringValidationComponent extends ResourceOwner implements OnChanges { export class StringValidationComponent extends ResourceOwner implements OnChanges {
public readonly contentTypes = STRING_CONTENT_TYPES;
@Input() @Input()
public fieldForm: FormGroup; public fieldForm: FormGroup;
@ -37,8 +39,6 @@ export class StringValidationComponent extends ResourceOwner implements OnChange
@Input() @Input()
public isLocalizable?: boolean | null; public isLocalizable?: boolean | null;
public contentTypes = STRING_CONTENT_TYPES;
public showPatternMessage: Observable<boolean>; public showPatternMessage: Observable<boolean>;
public showPatternSuggestions: Observable<boolean>; public showPatternSuggestions: Observable<boolean>;

6
frontend/app/features/schemas/pages/schema/fields/types/tags-ui.component.ts

@ -10,11 +10,13 @@ import { FormGroup } from '@angular/forms';
import { FieldDto, TagsFieldPropertiesDto, TAGS_FIELD_EDITORS } from '@app/shared'; import { FieldDto, TagsFieldPropertiesDto, TAGS_FIELD_EDITORS } from '@app/shared';
@Component({ @Component({
selector: 'sqx-tags-ui', selector: 'sqx-tags-ui[field][fieldForm][properties]',
styleUrls: ['tags-ui.component.scss'], styleUrls: ['tags-ui.component.scss'],
templateUrl: 'tags-ui.component.html', templateUrl: 'tags-ui.component.html',
}) })
export class TagsUIComponent { export class TagsUIComponent {
public readonly editors = TAGS_FIELD_EDITORS;
@Input() @Input()
public fieldForm: FormGroup; public fieldForm: FormGroup;
@ -23,6 +25,4 @@ export class TagsUIComponent {
@Input() @Input()
public properties: TagsFieldPropertiesDto; public properties: TagsFieldPropertiesDto;
public editors = TAGS_FIELD_EDITORS;
} }

2
frontend/app/features/schemas/pages/schema/fields/types/tags-validation.component.ts

@ -10,7 +10,7 @@ import { FormGroup } from '@angular/forms';
import { FieldDto, LanguageDto, TagsFieldPropertiesDto } from '@app/shared'; import { FieldDto, LanguageDto, TagsFieldPropertiesDto } from '@app/shared';
@Component({ @Component({
selector: 'sqx-tags-validation', selector: 'sqx-tags-validation[field][fieldForm][languages][properties]',
styleUrls: ['tags-validation.component.scss'], styleUrls: ['tags-validation.component.scss'],
templateUrl: 'tags-validation.component.html', templateUrl: 'tags-validation.component.html',
}) })

11
frontend/app/features/schemas/pages/schema/preview/schema-preview-urls-form.component.ts

@ -48,10 +48,13 @@ export class SchemaPreviewUrlsFormComponent implements OnChanges {
if (value) { if (value) {
this.schemasState.configurePreviewUrls(this.schema, value) this.schemasState.configurePreviewUrls(this.schema, value)
.subscribe(() => { .subscribe({
this.editForm.submitCompleted({ noReset: true }); next: () => {
}, error => { this.editForm.submitCompleted({ noReset: true });
this.editForm.submitFailed(error); },
error: error => {
this.editForm.submitFailed(error);
},
}); });
} }
} }

11
frontend/app/features/schemas/pages/schema/rules/schema-field-rules-form.component.ts

@ -67,10 +67,13 @@ export class SchemaFieldRulesFormComponent implements OnChanges {
if (value) { if (value) {
this.schemasState.configureFieldRules(this.schema, value) this.schemasState.configureFieldRules(this.schema, value)
.subscribe(() => { .subscribe({
this.editForm.submitCompleted({ noReset: true }); next: () => {
}, error => { this.editForm.submitCompleted({ noReset: true });
this.editForm.submitFailed(error); },
error: error => {
this.editForm.submitFailed(error);
},
}); });
} }
} }

11
frontend/app/features/schemas/pages/schema/scripts/schema-scripts-form.component.ts

@ -56,10 +56,13 @@ export class SchemaScriptsFormComponent implements OnChanges {
if (value) { if (value) {
this.schemasState.configureScripts(this.schema, value) this.schemasState.configureScripts(this.schema, value)
.subscribe(() => { .subscribe({
this.editForm.submitCompleted({ noReset: true }); next: () => {
}, error => { this.editForm.submitCompleted({ noReset: true });
this.editForm.submitFailed(error); },
error: error => {
this.editForm.submitFailed(error);
},
}); });
} }
} }

11
frontend/app/features/schemas/pages/schemas/schema-form.component.ts

@ -57,10 +57,13 @@ export class SchemaFormComponent implements OnInit {
if (value) { if (value) {
this.schemasState.create(value) this.schemasState.create(value)
.subscribe(dto => { .subscribe({
this.emitComplete(dto); next: dto => {
}, error => { this.emitComplete(dto);
this.createForm.submitFailed(error); },
error: error => {
this.createForm.submitFailed(error);
},
}); });
} }
} }

2
frontend/app/features/settings/pages/backups/backup.component.ts

@ -9,7 +9,7 @@ import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { ApiUrlConfig, BackupDto, BackupsState, Duration } from '@app/shared'; import { ApiUrlConfig, BackupDto, BackupsState, Duration } from '@app/shared';
@Component({ @Component({
selector: 'sqx-backup', selector: 'sqx-backup[backup]',
styleUrls: ['./backup.component.scss'], styleUrls: ['./backup.component.scss'],
templateUrl: './backup.component.html', templateUrl: './backup.component.html',
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,

11
frontend/app/features/settings/pages/clients/client-add-form.component.ts

@ -29,10 +29,13 @@ export class ClientAddFormComponent {
if (value) { if (value) {
this.clientsState.attach(value) this.clientsState.attach(value)
.subscribe(() => { .subscribe({
this.addClientForm.submitCompleted(); next: () => {
}, error => { this.addClientForm.submitCompleted();
this.addClientForm.submitFailed(error); },
error: error => {
this.addClientForm.submitFailed(error);
},
}); });
} }
} }

15
frontend/app/features/settings/pages/clients/client-connect-form.component.ts

@ -51,12 +51,15 @@ export class ClientConnectFormComponent implements OnInit {
this.connectLibraryText = connectLibrary(this.apiUrl, this.appName, this.client); this.connectLibraryText = connectLibrary(this.apiUrl, this.appName, this.client);
this.clientsService.createToken(this.appsState.appName, this.client) this.clientsService.createToken(this.appsState.appName, this.client)
.subscribe(dto => { .subscribe({
this.connectToken = dto; next: dto => {
this.connectToken = dto;
this.changeDetector.markForCheck();
}, error => { this.changeDetector.markForCheck();
this.dialogs.notifyError(error); },
error: error => {
this.dialogs.notifyError(error);
},
}); });
} }

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save