From 880c5ef5f077f6e5436404e696017a8611b133ce Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Tue, 14 Apr 2020 21:43:53 +0200 Subject: [PATCH] Feature/rule runner (#512) * Imports reorganized after objective criterias. * Rule rerunner. * Build fix. * Just another fix. * Another build fix. --- .../Rules/RuleJob.cs | 2 +- .../HandleRules/RuleService.cs | 10 +- .../DefaultValidatorsFactory.cs | 1 - .../ValidateContent/IValidatorsFactory.cs | 1 - .../Rules/MongoRuleEventRepository.cs | 57 ++--- .../Repositories/IRuleEventRepository.cs | 12 +- .../Rules/RuleDequeuerGrain.cs | 12 +- .../Rules/RuleJobUpdate.cs | 28 +++ .../Rules/Runner/GrainRuleRunnerService.cs | 47 ++++ .../Rules/Runner/IRuleRunnerGrain.cs | 22 ++ .../Rules/Runner/IRuleRunnerService.cs | 21 ++ .../Rules/Runner/RuleRunnerGrain.cs | 202 ++++++++++++++++++ .../UserManagerExtensions.cs | 1 - .../src/Squidex.Domain.Users/UserValues.cs | 1 + .../MongoDb/MongoExtensions.cs | 4 +- .../UniqueConstraintException.cs | 35 --- .../Api/Controllers/Rules/Models/RuleDto.cs | 13 +- .../Controllers/Rules/Models/RuleEventsDto.cs | 8 +- .../Api/Controllers/Rules/Models/RulesDto.cs | 21 +- .../Api/Controllers/Rules/RulesController.cs | 61 +++++- .../src/Squidex/Config/Domain/RuleServices.cs | 4 + .../Model/Apps/RolesTests.cs | 1 - .../HandleRules/RuleServiceTests.cs | 2 +- .../ValidateContent/AssetsFieldTests.cs | 3 - .../Validators/AssetsValidatorTests.cs | 1 - .../Validators/ReferencesValidatorTests.cs | 1 - .../Rules/RuleDequeuerTests.cs | 11 +- .../Rules/RuleEnqueuerTests.cs | 10 +- frontend/app/app.module.ts | 16 +- frontend/app/app.routes.ts | 20 +- frontend/app/app.ts | 4 +- .../administration-area.component.ts | 1 - .../features/administration/declarations.ts | 11 +- .../guards/unset-user.guard.spec.ts | 4 +- .../administration/guards/unset-user.guard.ts | 3 +- .../guards/user-must-exist.guard.spec.ts | 4 +- .../guards/user-must-exist.guard.ts | 6 +- .../app/features/administration/internal.ts | 1 - .../app/features/administration/module.ts | 26 +-- .../pages/cluster/cluster-page.component.ts | 1 - .../event-consumer.component.ts | 1 - .../event-consumers-page.component.ts | 6 +- .../pages/restore/restore-page.component.ts | 9 +- .../pages/users/user-page.component.ts | 9 +- .../pages/users/user.component.ts | 1 - .../pages/users/users-page.component.ts | 1 - .../services/event-consumers.service.spec.ts | 8 +- .../services/event-consumers.service.ts | 9 +- .../services/users.service.spec.ts | 8 +- .../administration/services/users.service.ts | 10 +- .../state/event-consumers.state.spec.ts | 9 +- .../state/event-consumers.state.ts | 8 +- .../administration/state/users.forms.ts | 2 - .../administration/state/users.state.spec.ts | 18 +- .../administration/state/users.state.ts | 20 +- .../app/features/api/api-area.component.ts | 1 - frontend/app/features/api/declarations.ts | 3 +- frontend/app/features/api/index.ts | 2 +- frontend/app/features/api/module.ts | 12 +- .../pages/graphql/graphql-page.component.ts | 11 +- frontend/app/features/apps/declarations.ts | 2 +- frontend/app/features/apps/index.ts | 2 +- frontend/app/features/apps/module.ts | 8 +- .../apps/pages/apps-page.component.ts | 14 +- .../apps/pages/news-dialog.component.ts | 1 - .../apps/pages/onboarding-dialog.component.ts | 1 - frontend/app/features/assets/declarations.ts | 2 +- frontend/app/features/assets/index.ts | 2 +- frontend/app/features/assets/module.ts | 8 +- .../assets/pages/asset-tags.component.ts | 1 - .../pages/assets-filters-page.component.ts | 8 +- .../assets/pages/assets-page.component.ts | 11 +- frontend/app/features/content/declarations.ts | 10 +- frontend/app/features/content/index.ts | 2 +- frontend/app/features/content/module.ts | 48 +---- .../pages/comments/comments-page.component.ts | 1 - .../pages/content/content-event.component.ts | 1 - .../pages/content/content-field.component.ts | 15 +- .../content/content-history-page.component.ts | 16 +- .../pages/content/content-page.component.ts | 25 +-- .../content/field-languages.component.ts | 1 - .../contents-filters-page.component.ts | 10 +- .../pages/contents/contents-page.component.ts | 21 +- .../pages/schemas/schemas-page.component.ts | 1 - .../shared/content-status.component.ts | 1 - .../shared/due-time-selector.component.ts | 3 +- .../shared/forms/array-editor.component.ts | 9 +- .../shared/forms/array-item.component.ts | 12 +- .../shared/forms/assets-editor.component.ts | 13 +- .../shared/forms/field-editor.component.ts | 10 +- .../forms/stock-photo-editor.component.ts | 10 +- .../list/content-list-cell.directive.ts | 8 +- .../list/content-list-field.component.ts | 11 +- .../list/content-list-header.component.ts | 10 +- .../list/content-value-editor.component.ts | 1 - .../shared/list/content-value.component.ts | 1 - .../content/shared/list/content.component.ts | 16 +- .../shared/preview-button.component.ts | 11 +- .../references/content-creator.component.ts | 17 +- .../content-selector-item.component.ts | 9 +- .../references/content-selector.component.ts | 17 +- .../references/reference-item.component.ts | 9 +- .../references/references-editor.component.ts | 12 +- .../app/features/dashboard/declarations.ts | 2 +- frontend/app/features/dashboard/index.ts | 2 +- frontend/app/features/dashboard/module.ts | 8 +- .../pages/dashboard-page.component.ts | 13 +- frontend/app/features/rules/declarations.ts | 17 +- frontend/app/features/rules/index.ts | 2 +- frontend/app/features/rules/module.ts | 26 +-- .../events/rule-events-page.component.ts | 7 +- .../rules/actions/generic-action.component.ts | 1 - .../pages/rules/rule-element.component.ts | 1 - .../rules/pages/rules/rule-icon.component.ts | 1 - .../pages/rules/rule-wizard.component.ts | 10 +- .../rules/pages/rules/rule.component.html | 28 ++- .../rules/pages/rules/rule.component.ts | 17 +- .../pages/rules/rules-page.component.html | 10 + .../rules/pages/rules/rules-page.component.ts | 15 +- .../content-changed-trigger.component.ts | 1 - .../rules/triggers/usage-trigger.component.ts | 1 - frontend/app/features/schemas/declarations.ts | 9 +- frontend/app/features/schemas/index.ts | 2 +- frontend/app/features/schemas/module.ts | 49 +---- .../common/schema-edit-form.component.ts | 7 +- .../export/schema-export-form.component.ts | 7 +- .../schema/fields/field-wizard.component.ts | 14 +- .../pages/schema/fields/field.component.ts | 15 +- .../forms/field-form-common.component.ts | 1 - .../fields/forms/field-form-ui.component.ts | 1 - .../forms/field-form-validation.component.ts | 1 - .../fields/forms/field-form.component.ts | 1 - .../schema/fields/schema-fields.component.ts | 11 +- .../types/array-validation.component.ts | 7 +- .../fields/types/assets-ui.component.ts | 1 - .../types/assets-validation.component.ts | 1 - .../fields/types/boolean-ui.component.ts | 1 - .../types/boolean-validation.component.ts | 7 +- .../fields/types/date-time-ui.component.ts | 3 +- .../types/date-time-validation.component.ts | 8 +- .../fields/types/geolocation-ui.component.ts | 1 - .../types/geolocation-validation.component.ts | 1 - .../schema/fields/types/json-ui.component.ts | 1 - .../fields/types/json-validation.component.ts | 1 - .../fields/types/number-ui.component.ts | 9 +- .../types/number-validation.component.ts | 9 +- .../fields/types/references-ui.component.ts | 1 - .../types/references-validation.component.ts | 7 +- .../fields/types/string-ui.component.ts | 8 +- .../types/string-validation.component.ts | 15 +- .../schema/fields/types/tags-ui.component.ts | 1 - .../fields/types/tags-validation.component.ts | 1 - .../schema-preview-urls-form.component.ts | 8 +- .../pages/schema/schema-page.component.ts | 15 +- .../scripts/schema-scripts-form.component.ts | 7 +- .../pages/schema/ui/field-list.component.ts | 1 - .../schema/ui/schema-ui-form.component.ts | 1 - .../pages/schemas/schema-form.component.ts | 9 +- .../pages/schemas/schemas-page.component.ts | 12 +- .../app/features/settings/declarations.ts | 1 - frontend/app/features/settings/index.ts | 2 +- frontend/app/features/settings/module.ts | 41 +--- .../pages/backups/backup.component.ts | 8 +- .../pages/backups/backups-page.component.ts | 8 +- .../clients/client-add-form.component.ts | 1 - .../clients/client-connect-form.component.ts | 11 +- .../pages/clients/client.component.ts | 9 +- .../pages/clients/clients-page.component.ts | 7 +- .../contributor-add-form.component.ts | 11 +- .../contributors/contributor.component.ts | 7 +- .../contributors-page.component.ts | 8 +- .../import-contributors-dialog.component.ts | 8 +- .../languages/language-add-form.component.ts | 7 +- .../pages/languages/language.component.ts | 9 +- .../languages/languages-page.component.ts | 1 - .../pages/more/more-page.component.ts | 9 +- .../pages/patterns/pattern.component.ts | 7 +- .../pages/patterns/patterns-page.component.ts | 6 +- .../settings/pages/plans/plan.component.ts | 1 - .../pages/plans/plans-page.component.ts | 7 +- .../pages/roles/role-add-form.component.ts | 1 - .../settings/pages/roles/role.component.ts | 10 +- .../pages/roles/roles-page.component.ts | 9 +- .../workflows/workflow-add-form.component.ts | 1 - .../workflows/workflow-step.component.ts | 10 +- .../workflow-transition.component.ts | 7 +- .../pages/workflows/workflow.component.ts | 13 +- .../workflows/workflows-page.component.ts | 9 +- .../settings/settings-area.component.ts | 1 - frontend/app/framework/angular/animations.ts | 9 +- .../app/framework/angular/avatar.component.ts | 1 - frontend/app/framework/angular/drag-helper.ts | 1 - .../angular/forms/confirm-click.directive.ts | 1 - .../angular/forms/control-errors.component.ts | 8 +- .../framework/angular/forms/copy.directive.ts | 7 +- .../angular/forms/editable-title.component.ts | 1 - .../forms/editors/autocomplete.component.ts | 8 +- .../forms/editors/checkbox-group.component.ts | 7 +- .../forms/editors/code-editor.component.ts | 8 +- .../forms/editors/color-picker.component.ts | 8 +- .../editors/date-time-editor.component.ts | 12 +- .../forms/editors/dropdown.component.ts | 8 +- .../forms/editors/iframe-editor.component.ts | 1 - .../forms/editors/json-editor.component.ts | 4 +- .../angular/forms/editors/stars.component.ts | 1 - .../forms/editors/tag-editor.component.ts | 11 +- .../angular/forms/editors/toggle.component.ts | 1 - .../angular/forms/error-formatting.spec.ts | 4 +- .../angular/forms/file-drop.directive.ts | 3 +- .../forms/focus-on-init.directive.spec.ts | 1 - .../angular/forms/focus-on-init.directive.ts | 1 - .../angular/forms/form-error.component.ts | 1 - .../angular/forms/forms-helper.spec.ts | 1 - .../framework/angular/forms/forms-helper.ts | 1 - .../forms/indeterminate-value.directive.ts | 3 +- .../angular/forms/progress-bar.component.ts | 1 - .../forms/transform-input.directive.ts | 6 +- .../angular/forms/validators.spec.ts | 2 - .../app/framework/angular/forms/validators.ts | 1 - .../app/framework/angular/highlight.pipe.ts | 1 - .../angular/http/caching.interceptor.ts | 5 +- .../angular/http/http-extensions.spec.ts | 3 +- .../framework/angular/http/http-extensions.ts | 8 +- .../angular/http/loading.interceptor.ts | 5 +- .../angular/image-source.directive.ts | 1 - .../framework/angular/list-view.component.ts | 1 - .../modals/dialog-renderer.component.ts | 11 +- .../angular/modals/modal-dialog.component.ts | 1 - .../modals/modal-placement.directive.ts | 3 +- .../angular/modals/modal.directive.ts | 9 +- .../modals/onboarding-tooltip.component.ts | 9 +- .../angular/modals/tooltip.directive.ts | 3 +- .../app/framework/angular/pager.component.ts | 1 - .../angular/panel-container.directive.ts | 1 - .../app/framework/angular/panel.component.ts | 2 - .../angular/pipes/date-time.pipes.spec.ts | 14 +- .../angular/pipes/date-time.pipes.ts | 1 - .../angular/pipes/money.pipe.spec.ts | 1 - .../app/framework/angular/pipes/money.pipe.ts | 1 - .../app/framework/angular/pipes/name.pipe.ts | 1 - .../framework/angular/resized.directive.ts | 7 +- .../routers/can-deactivate.guard.spec.ts | 1 - .../angular/routers/parent-link.directive.ts | 1 - .../angular/shortcut.component.spec.ts | 1 - .../framework/angular/shortcut.component.ts | 1 - .../framework/angular/stateful.component.ts | 4 +- .../framework/angular/sync-width.directive.ts | 7 +- .../app/framework/angular/title.component.ts | 1 - frontend/app/framework/declarations.ts | 40 ++-- frontend/app/framework/index.ts | 2 +- frontend/app/framework/internal.ts | 12 +- frontend/app/framework/module.ts | 94 +------- .../framework/services/analytics.service.ts | 3 +- .../framework/services/dialog.service.spec.ts | 8 +- .../app/framework/services/dialog.service.ts | 1 - .../services/loading.service.spec.ts | 1 - .../app/framework/services/loading.service.ts | 1 - .../framework/services/local-store.service.ts | 1 - .../services/onboarding.service.spec.ts | 3 +- .../framework/services/onboarding.service.ts | 4 +- .../app/framework/services/resize.service.ts | 1 - .../framework/services/shortcut.service.ts | 1 - .../framework/services/title.service.spec.ts | 6 +- frontend/app/framework/state.ts | 2 - frontend/app/framework/utils/date-time.ts | 1 - frontend/app/framework/utils/pager.spec.ts | 4 +- .../app/framework/utils/rxjs-extensions.ts | 8 +- .../shared/components/app-form.component.ts | 7 +- .../assets/asset-dialog.component.ts | 14 +- .../assets/asset-folder-dialog.component.ts | 7 +- .../assets/asset-folder.component.ts | 10 +- .../assets/asset-history.component.ts | 8 +- .../components/assets/asset-path.component.ts | 1 - .../assets/asset-uploader.component.ts | 11 +- .../components/assets/asset.component.ts | 11 +- .../assets/assets-list.component.ts | 9 +- .../assets/assets-selector.component.ts | 9 +- .../assets/image-cropper.component.ts | 3 +- .../assets/image-focus-point.component.ts | 4 +- .../app/shared/components/assets/pipes.ts | 10 +- .../components/comments/comment.component.ts | 9 +- .../components/comments/comments.component.ts | 14 +- .../forms/geolocation-editor.component.ts | 10 +- .../forms/language-selector.component.ts | 7 +- .../forms/markdown-editor.component.ts | 12 +- .../forms/references-dropdown.component.ts | 13 +- .../forms/references-tags.component.ts | 13 +- .../components/forms/rich-editor.component.ts | 14 +- .../shared/components/help/help.component.ts | 1 - .../history/history-list.component.ts | 1 - .../components/history/history.component.ts | 11 +- .../app/shared/components/history/pipes.ts | 9 +- frontend/app/shared/components/pipes.ts | 9 +- .../components/schema-category.component.ts | 10 +- .../queries/filter-comparison.component.ts | 9 +- .../queries/filter-logical.component.ts | 8 +- .../search/queries/filter-node.component.ts | 9 +- .../search/queries/query-path.component.ts | 1 - .../search/queries/query.component.ts | 7 +- .../search/queries/sorting.component.ts | 1 - .../components/search/query-list.component.ts | 7 +- .../search/search-form.component.ts | 11 +- .../search/shared-queries.component.ts | 1 - .../components/table-header.component.ts | 8 +- frontend/app/shared/declarations.ts | 14 +- .../guards/app-must-exist.guard.spec.ts | 4 +- .../app/shared/guards/app-must-exist.guard.ts | 1 - .../guards/content-must-exist.guard.spec.ts | 3 +- .../shared/guards/content-must-exist.guard.ts | 4 +- .../app/shared/guards/load-apps.guard.spec.ts | 4 +- frontend/app/shared/guards/load-apps.guard.ts | 1 - .../guards/load-languages.guard.spec.ts | 4 +- .../app/shared/guards/load-languages.guard.ts | 1 - .../must-be-authenticated.guard.spec.ts | 4 +- .../guards/must-be-authenticated.guard.ts | 4 +- .../must-be-not-authenticated.guard.spec.ts | 4 +- .../guards/must-be-not-authenticated.guard.ts | 4 +- .../schema-must-exist-published.guard.spec.ts | 3 +- .../schema-must-exist-published.guard.ts | 4 +- .../guards/schema-must-exist.guard.spec.ts | 3 +- .../shared/guards/schema-must-exist.guard.ts | 4 +- ...schema-must-not-be-singleton.guard.spec.ts | 3 +- .../schema-must-not-be-singleton.guard.ts | 1 - .../app/shared/guards/unset-app.guard.spec.ts | 4 +- frontend/app/shared/guards/unset-app.guard.ts | 1 - .../shared/guards/unset-content.guard.spec.ts | 3 +- .../app/shared/guards/unset-content.guard.ts | 1 - frontend/app/shared/index.ts | 2 +- .../interceptors/auth.interceptor.spec.ts | 3 +- .../shared/interceptors/auth.interceptor.ts | 6 +- frontend/app/shared/internal.ts | 16 +- frontend/app/shared/module.ts | 111 +--------- .../services/app-languages.service.spec.ts | 13 +- .../shared/services/app-languages.service.ts | 14 +- .../app/shared/services/apps.service.spec.ts | 13 +- frontend/app/shared/services/apps.service.ts | 17 +- .../shared/services/assets.service.spec.ts | 19 +- .../app/shared/services/assets.service.ts | 24 +-- frontend/app/shared/services/auth.service.ts | 11 +- .../shared/services/autosave.service.spec.ts | 7 +- .../app/shared/services/autosave.service.ts | 1 - .../shared/services/backups.service.spec.ts | 13 +- .../app/shared/services/backups.service.ts | 13 +- .../shared/services/clients.service.spec.ts | 14 +- .../app/shared/services/clients.service.ts | 14 +- .../shared/services/comments.service.spec.ts | 10 +- .../app/shared/services/comments.service.ts | 9 +- .../shared/services/contents.service.spec.ts | 16 +- .../app/shared/services/contents.service.ts | 18 +- .../services/contributors.service.spec.ts | 13 +- .../shared/services/contributors.service.ts | 14 +- .../shared/services/graphql.service.spec.ts | 1 - .../app/shared/services/graphql.service.ts | 3 +- .../app/shared/services/help.service.spec.ts | 1 - .../shared/services/history.service.spec.ts | 9 +- .../app/shared/services/history.service.ts | 9 +- .../shared/services/languages.service.spec.ts | 7 +- .../app/shared/services/languages.service.ts | 3 +- .../app/shared/services/news.service.spec.ts | 8 +- frontend/app/shared/services/news.service.ts | 3 +- .../shared/services/patterns.service.spec.ts | 13 +- .../app/shared/services/patterns.service.ts | 14 +- .../app/shared/services/plans.service.spec.ts | 11 +- frontend/app/shared/services/plans.service.ts | 11 +- .../app/shared/services/roles.service.spec.ts | 13 +- frontend/app/shared/services/roles.service.ts | 14 +- .../app/shared/services/rules.service.spec.ts | 54 +++-- frontend/app/shared/services/rules.service.ts | 53 +++-- .../shared/services/schemas.service.spec.ts | 18 +- .../app/shared/services/schemas.service.ts | 17 +- .../shared/services/search.service.spec.ts | 8 +- .../app/shared/services/search.service.ts | 7 +- .../services/stock-photo.service.spec.ts | 1 - .../services/translations.service.spec.ts | 7 +- .../shared/services/translations.service.ts | 3 +- .../app/shared/services/ui.service.spec.ts | 7 +- frontend/app/shared/services/ui.service.ts | 3 +- .../shared/services/usages.service.spec.ts | 11 +- .../app/shared/services/usages.service.ts | 7 +- .../services/users-provider.service.spec.ts | 9 +- .../shared/services/users-provider.service.ts | 4 +- .../app/shared/services/users.service.spec.ts | 8 +- frontend/app/shared/services/users.service.ts | 7 +- .../shared/services/workflows.service.spec.ts | 12 +- .../app/shared/services/workflows.service.ts | 17 +- frontend/app/shared/state/_test-helpers.ts | 8 +- frontend/app/shared/state/apps.forms.ts | 8 +- frontend/app/shared/state/apps.state.spec.ts | 9 +- frontend/app/shared/state/apps.state.ts | 17 +- .../shared/state/asset-uploader.state.spec.ts | 13 +- .../app/shared/state/asset-uploader.state.ts | 9 +- .../app/shared/state/assets.forms.spec.ts | 1 - frontend/app/shared/state/assets.forms.ts | 16 +- .../app/shared/state/assets.state.spec.ts | 16 +- frontend/app/shared/state/assets.state.ts | 21 +- frontend/app/shared/state/backups.forms.ts | 8 +- .../app/shared/state/backups.state.spec.ts | 12 +- frontend/app/shared/state/backups.state.ts | 11 +- frontend/app/shared/state/clients.forms.ts | 14 +- .../app/shared/state/clients.state.spec.ts | 11 +- frontend/app/shared/state/clients.state.ts | 18 +- frontend/app/shared/state/comments.form.ts | 2 - .../app/shared/state/comments.state.spec.ts | 11 +- frontend/app/shared/state/comments.state.ts | 10 +- .../app/shared/state/contents.forms.spec.ts | 25 +-- frontend/app/shared/state/contents.forms.ts | 31 +-- frontend/app/shared/state/contents.state.ts | 14 +- .../app/shared/state/contributors.forms.ts | 10 +- .../shared/state/contributors.state.spec.ts | 16 +- .../app/shared/state/contributors.state.ts | 22 +- frontend/app/shared/state/languages.forms.ts | 5 +- .../app/shared/state/languages.state.spec.ts | 13 +- frontend/app/shared/state/languages.state.ts | 18 +- frontend/app/shared/state/patterns.forms.ts | 2 - .../app/shared/state/patterns.state.spec.ts | 11 +- frontend/app/shared/state/patterns.state.ts | 18 +- frontend/app/shared/state/plans.state.spec.ts | 10 +- frontend/app/shared/state/plans.state.ts | 9 +- frontend/app/shared/state/queries.spec.ts | 9 +- frontend/app/shared/state/queries.ts | 11 +- frontend/app/shared/state/query.ts | 1 - frontend/app/shared/state/roles.forms.ts | 14 +- frontend/app/shared/state/roles.state.spec.ts | 11 +- frontend/app/shared/state/roles.state.ts | 18 +- .../shared/state/rule-events.state.spec.ts | 12 +- .../app/shared/state/rule-events.state.ts | 13 +- frontend/app/shared/state/rules.state.spec.ts | 43 ++-- frontend/app/shared/state/rules.state.ts | 50 +++-- .../app/shared/state/schema-tag-source.ts | 4 +- frontend/app/shared/state/schemas.forms.ts | 18 +- .../app/shared/state/schemas.state.spec.ts | 15 +- frontend/app/shared/state/schemas.state.ts | 28 +-- .../app/shared/state/table-fields.spec.ts | 14 +- frontend/app/shared/state/table-fields.ts | 8 +- frontend/app/shared/state/ui.state.spec.ts | 10 +- frontend/app/shared/state/ui.state.ts | 12 +- frontend/app/shared/state/workflows.forms.ts | 2 - .../app/shared/state/workflows.state.spec.ts | 11 +- frontend/app/shared/state/workflows.state.ts | 16 +- frontend/app/shell/declarations.ts | 2 +- frontend/app/shell/index.ts | 2 +- frontend/app/shell/module.ts | 20 +- .../app/shell/pages/app/app-area.component.ts | 1 - .../shell/pages/app/left-menu.component.ts | 1 - .../shell/pages/home/home-page.component.ts | 1 - .../pages/internal/apps-menu.component.ts | 10 +- .../pages/internal/internal-area.component.ts | 8 +- .../internal/notifications-menu.component.ts | 13 +- .../pages/internal/profile-menu.component.ts | 10 +- .../pages/internal/search-menu.component.ts | 11 +- .../shell/pages/login/login-page.component.ts | 1 - .../pages/logout/logout-page.component.ts | 1 - frontend/app/shims.ts | 75 +++---- 453 files changed, 1106 insertions(+), 3225 deletions(-) create mode 100644 backend/src/Squidex.Domain.Apps.Entities/Rules/RuleJobUpdate.cs create mode 100644 backend/src/Squidex.Domain.Apps.Entities/Rules/Runner/GrainRuleRunnerService.cs create mode 100644 backend/src/Squidex.Domain.Apps.Entities/Rules/Runner/IRuleRunnerGrain.cs create mode 100644 backend/src/Squidex.Domain.Apps.Entities/Rules/Runner/IRuleRunnerService.cs create mode 100644 backend/src/Squidex.Domain.Apps.Entities/Rules/Runner/RuleRunnerGrain.cs delete mode 100644 backend/src/Squidex.Infrastructure/UniqueConstraintException.cs diff --git a/backend/src/Squidex.Domain.Apps.Core.Model/Rules/RuleJob.cs b/backend/src/Squidex.Domain.Apps.Core.Model/Rules/RuleJob.cs index 559a4dfef..106358450 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Model/Rules/RuleJob.cs +++ b/backend/src/Squidex.Domain.Apps.Core.Model/Rules/RuleJob.cs @@ -12,7 +12,7 @@ namespace Squidex.Domain.Apps.Core.Rules { public sealed class RuleJob { - public Guid EventId { get; set; } + public Guid Id { get; set; } public Guid AppId { get; set; } diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/RuleService.cs b/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/RuleService.cs index f8e164f35..cdda03139 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/RuleService.cs +++ b/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/RuleService.cs @@ -67,7 +67,7 @@ namespace Squidex.Domain.Apps.Core.HandleRules this.log = log; } - public virtual async Task> CreateJobsAsync(Rule rule, Guid ruleId, Envelope @event) + public virtual async Task> CreateJobsAsync(Rule rule, Guid ruleId, Envelope @event, bool ignoreStale = false) { Guard.NotNull(rule); Guard.NotNull(@event); @@ -107,13 +107,13 @@ namespace Squidex.Domain.Apps.Core.HandleRules @event.Headers.Timestamp() : now; - var expires = eventTime.Plus(Constants.ExpirationTime); - - if (eventTime.Plus(Constants.StaleTime) < now) + if (!ignoreStale && eventTime.Plus(Constants.StaleTime) < now) { return result; } + var expires = eventTime.Plus(Constants.ExpirationTime); + if (!triggerHandler.Trigger(typed.Payload, rule.Trigger, ruleId)) { return result; @@ -141,12 +141,12 @@ namespace Squidex.Domain.Apps.Core.HandleRules var job = new RuleJob { + Id = Guid.NewGuid(), ActionData = json, ActionName = actionName, AppId = enrichedEvent.AppId.Id, Created = now, Description = actionData.Description, - EventId = @event.Headers.EventId(), EventName = enrichedEvent.Name, ExecutionPartition = enrichedEvent.Partition, Expires = expires, diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/DefaultValidatorsFactory.cs b/backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/DefaultValidatorsFactory.cs index 9542301e5..ec75360a2 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/DefaultValidatorsFactory.cs +++ b/backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/DefaultValidatorsFactory.cs @@ -5,7 +5,6 @@ // All rights reserved. Licensed under the MIT license. // ========================================================================== -using System; using System.Collections.Generic; using Squidex.Domain.Apps.Core.Schemas; using Squidex.Domain.Apps.Core.ValidateContent.Validators; diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/IValidatorsFactory.cs b/backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/IValidatorsFactory.cs index 87d5920ee..15e36d2f4 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/IValidatorsFactory.cs +++ b/backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/IValidatorsFactory.cs @@ -5,7 +5,6 @@ // All rights reserved. Licensed under the MIT license. // ========================================================================== -using System; using System.Collections.Generic; using Squidex.Domain.Apps.Core.Schemas; diff --git a/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Rules/MongoRuleEventRepository.cs b/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Rules/MongoRuleEventRepository.cs index 987cb629d..5b7097d45 100644 --- a/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Rules/MongoRuleEventRepository.cs +++ b/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Rules/MongoRuleEventRepository.cs @@ -59,7 +59,7 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Rules return Collection.Find(x => x.NextAttempt < now).ForEachAsync(callback, ct); } - public async Task> QueryByAppAsync(Guid appId, Guid? ruleId = null, int skip = 0, int take = 20) + public async Task> QueryByAppAsync(Guid appId, Guid? ruleId = null, int skip = 0, int take = 20) { var filter = Filter.Eq(x => x.AppId, appId); @@ -68,11 +68,12 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Rules filter = Filter.And(filter, Filter.Eq(x => x.RuleId, ruleId)); } - var ruleEventEntities = - await Collection.Find(filter).Skip(skip).Limit(take).SortByDescending(x => x.Created) - .ToListAsync(); + var taskForItems = Collection.Find(filter).Skip(skip).Limit(take).SortByDescending(x => x.Created).ToListAsync(); + var taskForCount = Collection.Find(filter).CountDocumentsAsync(); - return ruleEventEntities; + await Task.WhenAll(taskForItems, taskForCount); + + return ResultList.Create(taskForCount.Result, taskForItems.Result); } public async Task FindAsync(Guid id) @@ -84,37 +85,16 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Rules return ruleEvent; } - public async Task CountByAppAsync(Guid appId) - { - return (int)await Collection.CountDocumentsAsync(x => x.AppId == appId); - } - public Task EnqueueAsync(Guid id, Instant nextAttempt) { return Collection.UpdateOneAsync(x => x.Id == id, Update.Set(x => x.NextAttempt, nextAttempt)); } - public async Task EnqueueAsync(RuleJob job, Instant nextAttempt) + public async Task EnqueueAsync(RuleJob job, Instant nextAttempt, CancellationToken ct = default) { var entity = SimpleMapper.Map(job, new MongoRuleEventEntity { Job = job, Created = nextAttempt, NextAttempt = nextAttempt }); - if (job.EventId != default) - { - entity.Id = job.EventId; - } - else - { - entity.Id = Guid.NewGuid(); - } - - try - { - await Collection.InsertOneIfNotExistsAsync(entity); - } - catch (MongoWriteException ex) when (ex.WriteError.Category == ServerErrorCategory.DuplicateKey) - { - throw new UniqueConstraintException(); - } + await Collection.InsertOneIfNotExistsAsync(entity, ct); } public Task CancelAsync(Guid id) @@ -125,23 +105,26 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Rules .Set(x => x.JobResult, RuleJobResult.Cancelled)); } - public async Task MarkSentAsync(RuleJob job, string? dump, RuleResult result, RuleJobResult jobResult, TimeSpan elapsed, Instant finished, Instant? nextCall) + public async Task UpdateAsync(RuleJob job, RuleJobUpdate update) { - if (result == RuleResult.Success) + Guard.NotNull(job); + Guard.NotNull(update); + + if (update.ExecutionResult == RuleResult.Success) { - await statisticsCollection.IncrementSuccess(job.AppId, job.RuleId, finished); + await statisticsCollection.IncrementSuccess(job.AppId, job.RuleId, update.Finished); } else { - await statisticsCollection.IncrementFailed(job.AppId, job.RuleId, finished); + await statisticsCollection.IncrementFailed(job.AppId, job.RuleId, update.Finished); } - await Collection.UpdateOneAsync(x => x.Id == job.EventId, + await Collection.UpdateOneAsync(x => x.Id == job.Id, Update - .Set(x => x.Result, result) - .Set(x => x.LastDump, dump) - .Set(x => x.JobResult, jobResult) - .Set(x => x.NextAttempt, nextCall) + .Set(x => x.Result, update.ExecutionResult) + .Set(x => x.LastDump, update.ExecutionDump) + .Set(x => x.JobResult, update.JobResult) + .Set(x => x.NextAttempt, update.JobNext) .Inc(x => x.NumCalls, 1)); } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Rules/Repositories/IRuleEventRepository.cs b/backend/src/Squidex.Domain.Apps.Entities/Rules/Repositories/IRuleEventRepository.cs index d24502f06..706560fe0 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Rules/Repositories/IRuleEventRepository.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Rules/Repositories/IRuleEventRepository.cs @@ -10,28 +10,26 @@ using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using NodaTime; -using Squidex.Domain.Apps.Core.HandleRules; using Squidex.Domain.Apps.Core.Rules; +using Squidex.Infrastructure; namespace Squidex.Domain.Apps.Entities.Rules.Repositories { public interface IRuleEventRepository { - Task EnqueueAsync(RuleJob job, Instant nextAttempt); + Task UpdateAsync(RuleJob job, RuleJobUpdate update); + + Task EnqueueAsync(RuleJob job, Instant nextAttempt, CancellationToken ct = default); Task EnqueueAsync(Guid id, Instant nextAttempt); Task CancelAsync(Guid id); - Task MarkSentAsync(RuleJob job, string? dump, RuleResult result, RuleJobResult jobResult, TimeSpan elapsed, Instant finished, Instant? nextCall); - Task QueryPendingAsync(Instant now, Func callback, CancellationToken ct = default); - Task CountByAppAsync(Guid appId); - Task> QueryStatisticsByAppAsync(Guid appId); - Task> QueryByAppAsync(Guid appId, Guid? ruleId = null, int skip = 0, int take = 20); + Task> QueryByAppAsync(Guid appId, Guid? ruleId = null, int skip = 0, int take = 20); Task FindAsync(Guid id); } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Rules/RuleDequeuerGrain.cs b/backend/src/Squidex.Domain.Apps.Entities/Rules/RuleDequeuerGrain.cs index 12644c78f..92f3e6243 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Rules/RuleDequeuerGrain.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Rules/RuleDequeuerGrain.cs @@ -105,7 +105,17 @@ namespace Squidex.Domain.Apps.Entities.Rules var now = clock.GetCurrentInstant(); - await ruleEventRepository.MarkSentAsync(@event.Job, response.Dump, response.Status, jobResult, elapsed, now, jobDelay); + var update = new RuleJobUpdate + { + Elapsed = elapsed, + ExecutionDump = response.Dump, + ExecutionResult = response.Status, + Finished = now, + JobNext = jobDelay, + JobResult = ComputeJobResult(response.Status, jobDelay), + }; + + await ruleEventRepository.UpdateAsync(@event.Job, update); } catch (Exception ex) { diff --git a/backend/src/Squidex.Domain.Apps.Entities/Rules/RuleJobUpdate.cs b/backend/src/Squidex.Domain.Apps.Entities/Rules/RuleJobUpdate.cs new file mode 100644 index 000000000..13f523d10 --- /dev/null +++ b/backend/src/Squidex.Domain.Apps.Entities/Rules/RuleJobUpdate.cs @@ -0,0 +1,28 @@ +// ========================================================================== +// Squidex Headless CMS +// ========================================================================== +// Copyright (c) Squidex UG (haftungsbeschraenkt) +// All rights reserved. Licensed under the MIT license. +// ========================================================================== + +using System; +using NodaTime; +using Squidex.Domain.Apps.Core.HandleRules; + +namespace Squidex.Domain.Apps.Entities.Rules +{ + public sealed class RuleJobUpdate + { + public string? ExecutionDump { get; set; } + + public RuleResult ExecutionResult { get; set; } + + public RuleJobResult JobResult { get; set; } + + public TimeSpan Elapsed { get; set; } + + public Instant Finished { get; set; } + + public Instant? JobNext { get; set; } + } +} diff --git a/backend/src/Squidex.Domain.Apps.Entities/Rules/Runner/GrainRuleRunnerService.cs b/backend/src/Squidex.Domain.Apps.Entities/Rules/Runner/GrainRuleRunnerService.cs new file mode 100644 index 000000000..4262ad8cb --- /dev/null +++ b/backend/src/Squidex.Domain.Apps.Entities/Rules/Runner/GrainRuleRunnerService.cs @@ -0,0 +1,47 @@ +// ========================================================================== +// Squidex Headless CMS +// ========================================================================== +// Copyright (c) Squidex UG (haftungsbeschraenkt) +// All rights reserved. Licensed under the MIT license. +// ========================================================================== + +using System; +using System.Threading.Tasks; +using Orleans; +using Squidex.Infrastructure; + +namespace Squidex.Domain.Apps.Entities.Rules.Runner +{ + public sealed class GrainRuleRunnerService : IRuleRunnerService + { + private readonly IGrainFactory grainFactory; + + public GrainRuleRunnerService(IGrainFactory grainFactory) + { + Guard.NotNull(grainFactory, nameof(grainFactory)); + + this.grainFactory = grainFactory; + } + + public Task CancelAsync(Guid appId) + { + var grain = grainFactory.GetGrain(appId); + + return grain.CancelAsync(); + } + + public Task GetRunningRuleIdAsync(Guid appId) + { + var grain = grainFactory.GetGrain(appId); + + return grain.GetRunningRuleIdAsync(); + } + + public Task RunAsync(Guid appId, Guid ruleId) + { + var grain = grainFactory.GetGrain(appId); + + return grain.RunAsync(ruleId); + } + } +} \ No newline at end of file diff --git a/backend/src/Squidex.Domain.Apps.Entities/Rules/Runner/IRuleRunnerGrain.cs b/backend/src/Squidex.Domain.Apps.Entities/Rules/Runner/IRuleRunnerGrain.cs new file mode 100644 index 000000000..0aa9088a0 --- /dev/null +++ b/backend/src/Squidex.Domain.Apps.Entities/Rules/Runner/IRuleRunnerGrain.cs @@ -0,0 +1,22 @@ +// ========================================================================== +// Squidex Headless CMS +// ========================================================================== +// Copyright (c) Squidex UG (haftungsbeschraenkt) +// All rights reserved. Licensed under the MIT license. +// ========================================================================== + +using System; +using System.Threading.Tasks; +using Orleans; + +namespace Squidex.Domain.Apps.Entities.Rules.Runner +{ + public interface IRuleRunnerGrain : IGrainWithGuidKey + { + Task RunAsync(Guid ruleId); + + Task CancelAsync(); + + Task GetRunningRuleIdAsync(); + } +} diff --git a/backend/src/Squidex.Domain.Apps.Entities/Rules/Runner/IRuleRunnerService.cs b/backend/src/Squidex.Domain.Apps.Entities/Rules/Runner/IRuleRunnerService.cs new file mode 100644 index 000000000..b5021fcf1 --- /dev/null +++ b/backend/src/Squidex.Domain.Apps.Entities/Rules/Runner/IRuleRunnerService.cs @@ -0,0 +1,21 @@ +// ========================================================================== +// Squidex Headless CMS +// ========================================================================== +// Copyright (c) Squidex UG (haftungsbeschraenkt) +// All rights reserved. Licensed under the MIT license. +// ========================================================================== + +using System; +using System.Threading.Tasks; + +namespace Squidex.Domain.Apps.Entities.Rules.Runner +{ + public interface IRuleRunnerService + { + Task RunAsync(Guid appId, Guid ruleId); + + Task CancelAsync(Guid appId); + + Task GetRunningRuleIdAsync(Guid appId); + } +} diff --git a/backend/src/Squidex.Domain.Apps.Entities/Rules/Runner/RuleRunnerGrain.cs b/backend/src/Squidex.Domain.Apps.Entities/Rules/Runner/RuleRunnerGrain.cs new file mode 100644 index 000000000..e0c047afd --- /dev/null +++ b/backend/src/Squidex.Domain.Apps.Entities/Rules/Runner/RuleRunnerGrain.cs @@ -0,0 +1,202 @@ +// ========================================================================== +// Squidex Headless CMS +// ========================================================================== +// Copyright (c) Squidex UG (haftungsbeschraenkt) +// All rights reserved. Licensed under the MIT license. +// ========================================================================== + +using System; +using System.Threading; +using System.Threading.Tasks; +using Orleans; +using Orleans.Runtime; +using Squidex.Domain.Apps.Core.HandleRules; +using Squidex.Domain.Apps.Entities.Rules.Repositories; +using Squidex.Domain.Apps.Events; +using Squidex.Infrastructure; +using Squidex.Infrastructure.EventSourcing; +using Squidex.Infrastructure.Log; +using Squidex.Infrastructure.Orleans; +using Squidex.Infrastructure.States; +using Squidex.Infrastructure.Tasks; + +namespace Squidex.Domain.Apps.Entities.Rules.Runner +{ + public sealed class RuleRunnerGrain : GrainOfGuid, IRuleRunnerGrain, IRemindable + { + private readonly IGrainState state; + private readonly IAppProvider appProvider; + private readonly IEventStore eventStore; + private readonly IEventDataFormatter eventDataFormatter; + private readonly IRuleEventRepository ruleEventRepository; + private readonly RuleService ruleService; + private readonly ISemanticLog log; + private CancellationTokenSource? currentTaskToken; + private IGrainReminder? currentReminder; + private bool isStopping; + + [CollectionName("Rules_Runner")] + public sealed class State + { + public Guid? RuleId { get; set; } + + public string? Position { get; set; } + } + + public RuleRunnerGrain( + IGrainState state, + IAppProvider appProvider, + IEventStore eventStore, + IEventDataFormatter eventDataFormatter, + IRuleEventRepository ruleEventRepository, + RuleService ruleService, + ISemanticLog log) + { + Guard.NotNull(state); + Guard.NotNull(appProvider); + Guard.NotNull(eventStore); + Guard.NotNull(eventDataFormatter); + Guard.NotNull(ruleEventRepository); + Guard.NotNull(ruleService); + Guard.NotNull(log); + + this.state = state; + this.appProvider = appProvider; + this.eventStore = eventStore; + this.eventDataFormatter = eventDataFormatter; + this.ruleEventRepository = ruleEventRepository; + this.ruleService = ruleService; + this.log = log; + } + + protected override Task OnActivateAsync(Guid key) + { + EnsureIsRunning(); + + return base.OnActivateAsync(key); + } + + public override Task OnDeactivateAsync() + { + isStopping = true; + + currentTaskToken?.Cancel(); + + return base.OnDeactivateAsync(); + } + + public Task CancelAsync() + { + currentTaskToken?.Cancel(); + + return Task.CompletedTask; + } + + public Task GetRunningRuleIdAsync() + { + return Task.FromResult(state.Value.RuleId); + } + + public async Task RunAsync(Guid ruleId) + { + if (currentTaskToken != null) + { + throw new DomainException("Another rule is already running."); + } + + state.Value = new State + { + RuleId = ruleId + }; + + EnsureIsRunning(); + + await state.WriteAsync(); + } + + private void EnsureIsRunning() + { + if (state.Value.RuleId.HasValue && currentTaskToken == null) + { + currentTaskToken = new CancellationTokenSource(); + + Process(state.Value, currentTaskToken.Token); + } + } + + private void Process(State job, CancellationToken ct) + { + ProcessAsync(job, ct).Forget(); + } + + private async Task ProcessAsync(State job, CancellationToken ct) + { + try + { + currentReminder = await RegisterOrUpdateReminder("KeepAlive", TimeSpan.Zero, TimeSpan.FromMinutes(2)); + + var rules = await appProvider.GetRulesAsync(Key); + + var rule = rules.Find(x => x.Id == job.RuleId); + + if (rule == null) + { + throw new InvalidOperationException("Cannot find rule."); + } + + await eventStore.QueryAsync(async storedEvent => + { + var @event = eventDataFormatter.Parse(storedEvent.Data); + + var jobs = await ruleService.CreateJobsAsync(rule.RuleDef, rule.Id, @event); + + foreach (var job in jobs) + { + await ruleEventRepository.EnqueueAsync(job, job.Created, ct); + } + + job.Position = storedEvent.EventPosition; + + await state.WriteAsync(); + }, SquidexHeaders.AppId, Key.ToString(), job.Position, ct); + } + catch (OperationCanceledException) + { + return; + } + catch (Exception ex) + { + log.LogError(ex, w => w + .WriteProperty("action", "runeRule") + .WriteProperty("status", "failed") + .WriteProperty("ruleId", job.RuleId?.ToString())); + } + finally + { + if (!isStopping) + { + job.RuleId = null; + job.Position = null; + + await state.WriteAsync(); + + if (currentReminder != null) + { + await UnregisterReminder(currentReminder); + + currentReminder = null; + } + + currentTaskToken = null; + } + } + } + + public Task ReceiveReminder(string reminderName, TickStatus status) + { + EnsureIsRunning(); + + return Task.CompletedTask; + } + } +} diff --git a/backend/src/Squidex.Domain.Users/UserManagerExtensions.cs b/backend/src/Squidex.Domain.Users/UserManagerExtensions.cs index c14291680..eee722702 100644 --- a/backend/src/Squidex.Domain.Users/UserManagerExtensions.cs +++ b/backend/src/Squidex.Domain.Users/UserManagerExtensions.cs @@ -13,7 +13,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Identity; using Squidex.Infrastructure; using Squidex.Infrastructure.Validation; -using Squidex.Shared.Identity; namespace Squidex.Domain.Users { diff --git a/backend/src/Squidex.Domain.Users/UserValues.cs b/backend/src/Squidex.Domain.Users/UserValues.cs index 8e0f82b6d..21fea3f1b 100644 --- a/backend/src/Squidex.Domain.Users/UserValues.cs +++ b/backend/src/Squidex.Domain.Users/UserValues.cs @@ -51,6 +51,7 @@ namespace Squidex.Domain.Users void RemoveClaims(Func predicate) { + claimsToAdd.RemoveAll(x => predicate(x)); claimsToRemove.AddRange(current.Where(predicate)); } diff --git a/backend/src/Squidex.Infrastructure.MongoDb/MongoDb/MongoExtensions.cs b/backend/src/Squidex.Infrastructure.MongoDb/MongoDb/MongoExtensions.cs index 2aed963bb..d00c7b140 100644 --- a/backend/src/Squidex.Infrastructure.MongoDb/MongoDb/MongoExtensions.cs +++ b/backend/src/Squidex.Infrastructure.MongoDb/MongoDb/MongoExtensions.cs @@ -33,11 +33,11 @@ namespace Squidex.Infrastructure.MongoDb return (await database.ListCollectionNamesAsync(options)).Any(); } - public static async Task InsertOneIfNotExistsAsync(this IMongoCollection collection, T document) + public static async Task InsertOneIfNotExistsAsync(this IMongoCollection collection, T document, CancellationToken ct = default) { try { - await collection.InsertOneAsync(document); + await collection.InsertOneAsync(document, null, ct); } catch (MongoWriteException ex) { diff --git a/backend/src/Squidex.Infrastructure/UniqueConstraintException.cs b/backend/src/Squidex.Infrastructure/UniqueConstraintException.cs deleted file mode 100644 index 98825ca2f..000000000 --- a/backend/src/Squidex.Infrastructure/UniqueConstraintException.cs +++ /dev/null @@ -1,35 +0,0 @@ -// ========================================================================== -// Squidex Headless CMS -// ========================================================================== -// Copyright (c) Squidex UG (haftungsbeschraenkt) -// All rights reserved. Licensed under the MIT license. -// ========================================================================== - -using System; -using System.Runtime.Serialization; - -namespace Squidex.Infrastructure -{ - [Serializable] - public class UniqueConstraintException : Exception - { - public UniqueConstraintException() - { - } - - public UniqueConstraintException(string message) - : base(message) - { - } - - public UniqueConstraintException(string message, Exception inner) - : base(message, inner) - { - } - - protected UniqueConstraintException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - } - } -} diff --git a/backend/src/Squidex/Areas/Api/Controllers/Rules/Models/RuleDto.cs b/backend/src/Squidex/Areas/Api/Controllers/Rules/Models/RuleDto.cs index b280cab79..abfd42c0d 100644 --- a/backend/src/Squidex/Areas/Api/Controllers/Rules/Models/RuleDto.cs +++ b/backend/src/Squidex/Areas/Api/Controllers/Rules/Models/RuleDto.cs @@ -91,7 +91,7 @@ namespace Squidex.Areas.Api.Controllers.Rules.Models /// public Instant? LastExecuted { get; set; } - public static RuleDto FromRule(IEnrichedRuleEntity rule, ApiController controller, string app) + public static RuleDto FromRule(IEnrichedRuleEntity rule, Guid? runningRuleId, ApiController controller, string app) { var result = new RuleDto(); @@ -103,10 +103,10 @@ namespace Squidex.Areas.Api.Controllers.Rules.Models result.Trigger = RuleTriggerDtoFactory.Create(rule.RuleDef.Trigger); } - return result.CreateLinks(controller, app); + return result.CreateLinks(controller, runningRuleId, app); } - private RuleDto CreateLinks(ApiController controller, string app) + private RuleDto CreateLinks(ApiController controller, Guid? runningRuleId, string app) { var values = new { app, id = Id }; @@ -127,9 +127,14 @@ namespace Squidex.Areas.Api.Controllers.Rules.Models AddPutLink("update", controller.Url(x => nameof(x.PutRule), values)); } - if (controller.HasPermission(Permissions.AppRulesRead)) + if (controller.HasPermission(Permissions.AppRulesEvents)) { AddPutLink("trigger", controller.Url(x => nameof(x.TriggerRule), values)); + + if (runningRuleId == null) + { + AddPutLink("run", controller.Url(x => nameof(x.PutRuleRun), values)); + } } if (controller.HasPermission(Permissions.AppRulesDelete)) diff --git a/backend/src/Squidex/Areas/Api/Controllers/Rules/Models/RuleEventsDto.cs b/backend/src/Squidex/Areas/Api/Controllers/Rules/Models/RuleEventsDto.cs index d0f382f98..4f961e858 100644 --- a/backend/src/Squidex/Areas/Api/Controllers/Rules/Models/RuleEventsDto.cs +++ b/backend/src/Squidex/Areas/Api/Controllers/Rules/Models/RuleEventsDto.cs @@ -5,10 +5,10 @@ // All rights reserved. Licensed under the MIT license. // ========================================================================== -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using Squidex.Domain.Apps.Entities.Rules; +using Squidex.Infrastructure; using Squidex.Web; namespace Squidex.Areas.Api.Controllers.Rules.Models @@ -26,12 +26,12 @@ namespace Squidex.Areas.Api.Controllers.Rules.Models /// public long Total { get; set; } - public static RuleEventsDto FromRuleEvents(IReadOnlyList items, long total, ApiController controller, string app) + public static RuleEventsDto FromRuleEvents(IResultList ruleEvents, ApiController controller, string app) { var result = new RuleEventsDto { - Total = total, - Items = items.Select(x => RuleEventDto.FromRuleEvent(x, controller, app)).ToArray() + Total = ruleEvents.Total, + Items = ruleEvents.Select(x => RuleEventDto.FromRuleEvent(x, controller, app)).ToArray() }; return result.CreateLinks(controller, app); diff --git a/backend/src/Squidex/Areas/Api/Controllers/Rules/Models/RulesDto.cs b/backend/src/Squidex/Areas/Api/Controllers/Rules/Models/RulesDto.cs index e65e773c7..7c22a0e45 100644 --- a/backend/src/Squidex/Areas/Api/Controllers/Rules/Models/RulesDto.cs +++ b/backend/src/Squidex/Areas/Api/Controllers/Rules/Models/RulesDto.cs @@ -5,6 +5,7 @@ // All rights reserved. Licensed under the MIT license. // ========================================================================== +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; @@ -22,17 +23,24 @@ namespace Squidex.Areas.Api.Controllers.Rules.Models [Required] public RuleDto[] Items { get; set; } - public static RulesDto FromRules(IEnumerable items, ApiController controller, string app) + /// + /// The id of the rule that is currently rerunning. + /// + public Guid? RunningRuleId { get; set; } + + public static RulesDto FromRules(IEnumerable items, Guid? runningRuleId, ApiController controller, string app) { var result = new RulesDto { - Items = items.Select(x => RuleDto.FromRule(x, controller, app)).ToArray() + Items = items.Select(x => RuleDto.FromRule(x, runningRuleId, controller, app)).ToArray() }; - return result.CreateLinks(controller, app); + result.RunningRuleId = runningRuleId; + + return result.CreateLinks(controller, runningRuleId, app); } - private RulesDto CreateLinks(ApiController controller, string app) + private RulesDto CreateLinks(ApiController controller, Guid? runningRuleId, string app) { var values = new { app }; @@ -46,6 +54,11 @@ namespace Squidex.Areas.Api.Controllers.Rules.Models if (controller.HasPermission(Permissions.AppRulesEvents, app)) { AddGetLink("events", controller.Url(x => nameof(x.GetEvents), values)); + + if (runningRuleId != null) + { + AddDeleteLink("run/cancel", controller.Url(x => nameof(x.DeleteRuleRun), values)); + } } return this; diff --git a/backend/src/Squidex/Areas/Api/Controllers/Rules/RulesController.cs b/backend/src/Squidex/Areas/Api/Controllers/Rules/RulesController.cs index a03cc0f82..74b254e0a 100644 --- a/backend/src/Squidex/Areas/Api/Controllers/Rules/RulesController.cs +++ b/backend/src/Squidex/Areas/Api/Controllers/Rules/RulesController.cs @@ -17,6 +17,7 @@ using Squidex.Domain.Apps.Core.HandleRules; using Squidex.Domain.Apps.Entities.Rules; using Squidex.Domain.Apps.Entities.Rules.Commands; using Squidex.Domain.Apps.Entities.Rules.Repositories; +using Squidex.Domain.Apps.Entities.Rules.Runner; using Squidex.Infrastructure; using Squidex.Infrastructure.Commands; using Squidex.Shared; @@ -31,17 +32,20 @@ namespace Squidex.Areas.Api.Controllers.Rules public sealed class RulesController : ApiController { private readonly IRuleQueryService ruleQuery; + private readonly IRuleRunnerService ruleRunnerService; private readonly IRuleEventRepository ruleEventsRepository; private readonly RuleRegistry ruleRegistry; public RulesController(ICommandBus commandBus, IRuleEventRepository ruleEventsRepository, IRuleQueryService ruleQuery, + IRuleRunnerService ruleRunnerService, RuleRegistry ruleRegistry) : base(commandBus) { this.ruleEventsRepository = ruleEventsRepository; this.ruleQuery = ruleQuery; + this.ruleRunnerService = ruleRunnerService; this.ruleRegistry = ruleRegistry; } @@ -87,9 +91,11 @@ namespace Squidex.Areas.Api.Controllers.Rules { var rules = await ruleQuery.QueryAsync(Context); + var runningRuleId = await ruleRunnerService.GetRunningRuleIdAsync(Context.App.Id); + var response = Deferred.Response(() => { - return RulesDto.FromRules(rules, this, app); + return RulesDto.FromRules(rules, runningRuleId, this, app); }); return Ok(response); @@ -119,6 +125,25 @@ namespace Squidex.Areas.Api.Controllers.Rules return CreatedAtAction(nameof(GetRules), new { app }, response); } + /// + /// Cancel the current run. + /// + /// The name of the app. + /// + /// 204 => Rule run cancelled. + /// + [HttpDelete] + [Route("apps/{app}/rules/run")] + [ProducesResponseType(204)] + [ApiPermission(Permissions.AppRulesEvents)] + [ApiCosts(1)] + public async Task DeleteRuleRun(string app) + { + await ruleRunnerService.CancelAsync(App.Id); + + return NoContent(); + } + /// /// Update a rule. /// @@ -130,9 +155,6 @@ namespace Squidex.Areas.Api.Controllers.Rules /// 400 => Rule is not valid. /// 404 => Rule or app not found. /// - /// - /// All events for the specified schemas will be sent to the url. The timeout is 2 seconds. - /// [HttpPut] [Route("apps/{app}/rules/{id}/")] [ProducesResponseType(typeof(RuleDto), 200)] @@ -215,6 +237,26 @@ namespace Squidex.Areas.Api.Controllers.Rules return NoContent(); } + /// + /// Run a rule. + /// + /// The name of the app. + /// The id of the rule to run. + /// + /// 204 => Rule started. + /// + [HttpPut] + [Route("apps/{app}/rules/{id}/run")] + [ProducesResponseType(204)] + [ApiPermission(Permissions.AppRulesEvents)] + [ApiCosts(1)] + public async Task PutRuleRun(string app, Guid id) + { + await ruleRunnerService.RunAsync(App.Id, id); + + return NoContent(); + } + /// /// Delete a rule. /// @@ -253,12 +295,9 @@ namespace Squidex.Areas.Api.Controllers.Rules [ApiCosts(0)] public async Task GetEvents(string app, [FromQuery] Guid? ruleId = null, [FromQuery] int skip = 0, [FromQuery] int take = 20) { - var taskForItems = ruleEventsRepository.QueryByAppAsync(AppId, ruleId, skip, take); - var taskForCount = ruleEventsRepository.CountByAppAsync(AppId); - - await Task.WhenAll(taskForItems, taskForCount); + var ruleEvents = await ruleEventsRepository.QueryByAppAsync(AppId, ruleId, skip, take); - var response = RuleEventsDto.FromRuleEvents(taskForItems.Result, taskForCount.Result, this, app); + var response = RuleEventsDto.FromRuleEvents(ruleEvents, this, app); return Ok(response); } @@ -321,8 +360,10 @@ namespace Squidex.Areas.Api.Controllers.Rules { var context = await CommandBus.PublishAsync(command); + var runningRuleId = await ruleRunnerService.GetRunningRuleIdAsync(Context.App.Id); + var result = context.Result(); - var response = RuleDto.FromRule(result, this, app); + var response = RuleDto.FromRule(result, runningRuleId, this, app); return response; } diff --git a/backend/src/Squidex/Config/Domain/RuleServices.cs b/backend/src/Squidex/Config/Domain/RuleServices.cs index 80938ce15..7b4bab01a 100644 --- a/backend/src/Squidex/Config/Domain/RuleServices.cs +++ b/backend/src/Squidex/Config/Domain/RuleServices.cs @@ -15,6 +15,7 @@ using Squidex.Domain.Apps.Entities.Comments; using Squidex.Domain.Apps.Entities.Contents; using Squidex.Domain.Apps.Entities.Rules; using Squidex.Domain.Apps.Entities.Rules.Queries; +using Squidex.Domain.Apps.Entities.Rules.Runner; using Squidex.Domain.Apps.Entities.Rules.UsageTracking; using Squidex.Domain.Apps.Entities.Schemas; using Squidex.Infrastructure.EventSourcing; @@ -57,6 +58,9 @@ namespace Squidex.Config.Domain services.AddSingletonAs() .As(); + services.AddSingletonAs() + .As(); + services.AddSingletonAs() .As(); diff --git a/backend/tests/Squidex.Domain.Apps.Core.Tests/Model/Apps/RolesTests.cs b/backend/tests/Squidex.Domain.Apps.Core.Tests/Model/Apps/RolesTests.cs index 522f74ef2..8a02262a8 100644 --- a/backend/tests/Squidex.Domain.Apps.Core.Tests/Model/Apps/RolesTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Core.Tests/Model/Apps/RolesTests.cs @@ -5,7 +5,6 @@ // All rights reserved. Licensed under the MIT license. // ========================================================================== -using System; using System.Collections.Generic; using System.Linq; using FluentAssertions; diff --git a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/HandleRules/RuleServiceTests.cs b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/HandleRules/RuleServiceTests.cs index 970b2749d..6d34b5343 100644 --- a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/HandleRules/RuleServiceTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/HandleRules/RuleServiceTests.cs @@ -376,7 +376,7 @@ namespace Squidex.Domain.Apps.Core.Operations.HandleRules Assert.Equal(now, job.Created); Assert.Equal(now.Plus(Duration.FromDays(30)), job.Expires); - Assert.NotEqual(Guid.Empty, job.EventId); + Assert.NotEqual(Guid.Empty, job.Id); } } } diff --git a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ValidateContent/AssetsFieldTests.cs b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ValidateContent/AssetsFieldTests.cs index f289a8b7e..356b5fc44 100644 --- a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ValidateContent/AssetsFieldTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ValidateContent/AssetsFieldTests.cs @@ -10,10 +10,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using FluentAssertions; -using Squidex.Domain.Apps.Core.Assets; using Squidex.Domain.Apps.Core.Schemas; -using Squidex.Domain.Apps.Core.ValidateContent; -using Squidex.Infrastructure.Collections; using Squidex.Infrastructure.Json.Objects; using Xunit; diff --git a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ValidateContent/Validators/AssetsValidatorTests.cs b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ValidateContent/Validators/AssetsValidatorTests.cs index 3a52c3a38..c818327a5 100644 --- a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ValidateContent/Validators/AssetsValidatorTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ValidateContent/Validators/AssetsValidatorTests.cs @@ -15,7 +15,6 @@ using Squidex.Domain.Apps.Core.Schemas; using Squidex.Domain.Apps.Core.ValidateContent; using Squidex.Domain.Apps.Core.ValidateContent.Validators; using Squidex.Infrastructure.Collections; -using Squidex.Infrastructure.Json.Objects; using Xunit; namespace Squidex.Domain.Apps.Core.Operations.ValidateContent.Validators diff --git a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ValidateContent/Validators/ReferencesValidatorTests.cs b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ValidateContent/Validators/ReferencesValidatorTests.cs index 9434d8057..072999e06 100644 --- a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ValidateContent/Validators/ReferencesValidatorTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ValidateContent/Validators/ReferencesValidatorTests.cs @@ -11,7 +11,6 @@ using System.Linq; using System.Threading.Tasks; using FluentAssertions; using Squidex.Domain.Apps.Core.ValidateContent.Validators; -using Squidex.Infrastructure.Json.Objects; using Xunit; namespace Squidex.Domain.Apps.Core.Operations.ValidateContent diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Rules/RuleDequeuerTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Rules/RuleDequeuerTests.cs index b802bd6dc..b4fded291 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Rules/RuleDequeuerTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Rules/RuleDequeuerTests.cs @@ -126,7 +126,14 @@ namespace Squidex.Domain.Apps.Entities.Rules await sut.HandleAsync(@event); - A.CallTo(() => ruleEventRepository.MarkSentAsync(@event.Job, requestDump, result, jobResult, requestElapsed, now, nextCall)) + A.CallTo(() => ruleEventRepository.UpdateAsync(@event.Job, + A.That.Matches(x => + x.Elapsed == requestElapsed && + x.ExecutionDump == requestDump && + x.ExecutionResult == result && + x.Finished == now && + x.JobNext == nextCall && + x.JobResult == jobResult))) .MustHaveHappened(); } @@ -141,7 +148,7 @@ namespace Squidex.Domain.Apps.Entities.Rules var job = new RuleJob { - EventId = id, + Id = id, ActionData = actionData, ActionName = actionName, Created = clock.GetCurrentInstant() diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Rules/RuleEnqueuerTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Rules/RuleEnqueuerTests.cs index e96859273..c008c9650 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Rules/RuleEnqueuerTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Rules/RuleEnqueuerTests.cs @@ -74,12 +74,12 @@ namespace Squidex.Domain.Apps.Entities.Rules var job = new RuleJob { Created = now }; - A.CallTo(() => ruleService.CreateJobsAsync(rule.RuleDef, rule.Id, @event)) + A.CallTo(() => ruleService.CreateJobsAsync(rule.RuleDef, rule.Id, @event, false)) .Returns(new List { job }); await sut.Enqueue(rule.RuleDef, rule.Id, @event); - A.CallTo(() => ruleEventRepository.EnqueueAsync(job, now)) + A.CallTo(() => ruleEventRepository.EnqueueAsync(job, now, default)) .MustHaveHappened(); } @@ -96,15 +96,15 @@ namespace Squidex.Domain.Apps.Entities.Rules A.CallTo(() => appProvider.GetRulesAsync(appId.Id)) .Returns(new List { rule1, rule2 }); - A.CallTo(() => ruleService.CreateJobsAsync(rule1.RuleDef, rule1.Id, @event)) + A.CallTo(() => ruleService.CreateJobsAsync(rule1.RuleDef, rule1.Id, @event, false)) .Returns(new List { job1 }); - A.CallTo(() => ruleService.CreateJobsAsync(rule2.RuleDef, rule2.Id, @event)) + A.CallTo(() => ruleService.CreateJobsAsync(rule2.RuleDef, rule2.Id, @event, false)) .Returns(new List()); await sut.On(@event); - A.CallTo(() => ruleEventRepository.EnqueueAsync(job1, now)) + A.CallTo(() => ruleEventRepository.EnqueueAsync(job1, now, default)) .MustHaveHappened(); } diff --git a/frontend/app/app.module.ts b/frontend/app/app.module.ts index 151503f02..2d125c40a 100644 --- a/frontend/app/app.module.ts +++ b/frontend/app/app.module.ts @@ -12,22 +12,10 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { BrowserModule } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { RouterModule } from '@angular/router'; - import { AppComponent } from './app.component'; - -import { - ApiUrlConfig, - CurrencyConfig, - DecimalSeparatorConfig, - SqxFrameworkModule, - SqxSharedModule, - TitlesConfig, - UIOptions -} from './shared'; - -import { SqxShellModule } from './shell'; - import { routing } from './app.routes'; +import { ApiUrlConfig, CurrencyConfig, DecimalSeparatorConfig, SqxFrameworkModule, SqxSharedModule, TitlesConfig, UIOptions } from './shared'; +import { SqxShellModule } from './shell'; export function configApiUrl() { const baseElements = document.getElementsByTagName('base'); diff --git a/frontend/app/app.routes.ts b/frontend/app/app.routes.ts index 8620adf07..fb214fa90 100644 --- a/frontend/app/app.routes.ts +++ b/frontend/app/app.routes.ts @@ -7,24 +7,8 @@ import { ModuleWithProviders } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; - -import { - AppAreaComponent, - ForbiddenPageComponent, - HomePageComponent, - InternalAreaComponent, - LoginPageComponent, - LogoutPageComponent, - NotFoundPageComponent -} from './shell'; - -import { - AppMustExistGuard, - LoadAppsGuard, - MustBeAuthenticatedGuard, - MustBeNotAuthenticatedGuard, - UnsetAppGuard -} from './shared'; +import { AppMustExistGuard, LoadAppsGuard, MustBeAuthenticatedGuard, MustBeNotAuthenticatedGuard, UnsetAppGuard } from './shared'; +import { AppAreaComponent, ForbiddenPageComponent, HomePageComponent, InternalAreaComponent, LoginPageComponent, LogoutPageComponent, NotFoundPageComponent } from './shell'; export const routes: Routes = [ { diff --git a/frontend/app/app.ts b/frontend/app/app.ts index 4b7765637..99142eea5 100644 --- a/frontend/app/app.ts +++ b/frontend/app/app.ts @@ -5,12 +5,10 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import './theme/theme.scss'; - import { enableProdMode } from '@angular/core'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; - import { AppModule } from './app.module'; +import './theme/theme.scss'; if (process.env.NODE_ENV === 'production') { enableProdMode(); diff --git a/frontend/app/features/administration/administration-area.component.ts b/frontend/app/features/administration/administration-area.component.ts index c74360ff7..194a3a264 100644 --- a/frontend/app/features/administration/administration-area.component.ts +++ b/frontend/app/features/administration/administration-area.component.ts @@ -6,7 +6,6 @@ */ import { Component } from '@angular/core'; - import { UIState } from '@app/shared'; @Component({ diff --git a/frontend/app/features/administration/declarations.ts b/frontend/app/features/administration/declarations.ts index fe0767c3a..a32a9196b 100644 --- a/frontend/app/features/administration/declarations.ts +++ b/frontend/app/features/administration/declarations.ts @@ -6,16 +6,13 @@ */ export * from './administration-area.component'; - -export * from './guards/user-must-exist.guard'; export * from './guards/unset-user.guard'; - +export * from './guards/user-must-exist.guard'; +export * from './internal'; export * from './pages/cluster/cluster-page.component'; export * from './pages/event-consumers/event-consumer.component'; export * from './pages/event-consumers/event-consumers-page.component'; export * from './pages/restore/restore-page.component'; -export * from './pages/users/user.component'; export * from './pages/users/user-page.component'; -export * from './pages/users/users-page.component'; - -export * from './internal'; \ No newline at end of file +export * from './pages/users/user.component'; +export * from './pages/users/users-page.component'; \ No newline at end of file diff --git a/frontend/app/features/administration/guards/unset-user.guard.spec.ts b/frontend/app/features/administration/guards/unset-user.guard.spec.ts index d4dad973f..0bb971fbc 100644 --- a/frontend/app/features/administration/guards/unset-user.guard.spec.ts +++ b/frontend/app/features/administration/guards/unset-user.guard.spec.ts @@ -5,11 +5,9 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +import { UsersState } from '@app/features/administration/internal'; import { of } from 'rxjs'; import { IMock, Mock, Times } from 'typemoq'; - -import { UsersState } from '@app/features/administration/internal'; - import { UnsetUserGuard } from './unset-user.guard'; describe('UnsetUserGuard', () => { diff --git a/frontend/app/features/administration/guards/unset-user.guard.ts b/frontend/app/features/administration/guards/unset-user.guard.ts index bec813ee2..5efff84df 100644 --- a/frontend/app/features/administration/guards/unset-user.guard.ts +++ b/frontend/app/features/administration/guards/unset-user.guard.ts @@ -7,11 +7,10 @@ import { Injectable } from '@angular/core'; import { CanActivate } from '@angular/router'; +import { UsersState } from '@app/features/administration/internal'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { UsersState } from '@app/features/administration/internal'; - @Injectable() export class UnsetUserGuard implements CanActivate { constructor( diff --git a/frontend/app/features/administration/guards/user-must-exist.guard.spec.ts b/frontend/app/features/administration/guards/user-must-exist.guard.spec.ts index a12487077..eb1e97109 100644 --- a/frontend/app/features/administration/guards/user-must-exist.guard.spec.ts +++ b/frontend/app/features/administration/guards/user-must-exist.guard.spec.ts @@ -6,11 +6,9 @@ */ import { Router } from '@angular/router'; +import { UserDto, UsersState } from '@app/features/administration/internal'; import { of } from 'rxjs'; import { IMock, Mock, Times } from 'typemoq'; - -import { UserDto, UsersState } from '@app/features/administration/internal'; - import { UserMustExistGuard } from './user-must-exist.guard'; describe('UserMustExistGuard', () => { diff --git a/frontend/app/features/administration/guards/user-must-exist.guard.ts b/frontend/app/features/administration/guards/user-must-exist.guard.ts index 22b120ff3..bba3213d7 100644 --- a/frontend/app/features/administration/guards/user-must-exist.guard.ts +++ b/frontend/app/features/administration/guards/user-must-exist.guard.ts @@ -7,13 +7,11 @@ import { Injectable } from '@angular/core'; import { ActivatedRouteSnapshot, CanActivate, Router } from '@angular/router'; +import { UsersState } from '@app/features/administration/internal'; +import { allParams } from '@app/framework'; import { Observable } from 'rxjs'; import { map, tap } from 'rxjs/operators'; -import { allParams } from '@app/framework'; - -import { UsersState } from '@app/features/administration/internal'; - @Injectable() export class UserMustExistGuard implements CanActivate { constructor( diff --git a/frontend/app/features/administration/internal.ts b/frontend/app/features/administration/internal.ts index 5a182a4dc..ac0dd8762 100644 --- a/frontend/app/features/administration/internal.ts +++ b/frontend/app/features/administration/internal.ts @@ -7,7 +7,6 @@ export * from './services/event-consumers.service'; export * from './services/users.service'; - export * from './state/event-consumers.state'; export * from './state/users.forms'; export * from './state/users.state'; \ No newline at end of file diff --git a/frontend/app/features/administration/module.ts b/frontend/app/features/administration/module.ts index 6f9b923f0..57e6060d4 100644 --- a/frontend/app/features/administration/module.ts +++ b/frontend/app/features/administration/module.ts @@ -5,30 +5,12 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +// tslint:disable: max-line-length + import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; - -import { - SqxFrameworkModule, - SqxSharedModule -} from '@app/shared'; - -import { - AdministrationAreaComponent, - ClusterPageComponent, - EventConsumerComponent, - EventConsumersPageComponent, - EventConsumersService, - EventConsumersState, - RestorePageComponent, - UnsetUserGuard, - UserComponent, - UserMustExistGuard, - UserPageComponent, - UsersPageComponent, - UsersService, - UsersState -} from './declarations'; +import { SqxFrameworkModule, SqxSharedModule } from '@app/shared'; +import { AdministrationAreaComponent, ClusterPageComponent, EventConsumerComponent, EventConsumersPageComponent, EventConsumersService, EventConsumersState, RestorePageComponent, UnsetUserGuard, UserComponent, UserMustExistGuard, UserPageComponent, UsersPageComponent, UsersService, UsersState } from './declarations'; const routes: Routes = [ { diff --git a/frontend/app/features/administration/pages/cluster/cluster-page.component.ts b/frontend/app/features/administration/pages/cluster/cluster-page.component.ts index 2de7a2631..cc13a9700 100644 --- a/frontend/app/features/administration/pages/cluster/cluster-page.component.ts +++ b/frontend/app/features/administration/pages/cluster/cluster-page.component.ts @@ -6,7 +6,6 @@ */ import { Component } from '@angular/core'; - import { UIState } from '@app/shared'; @Component({ diff --git a/frontend/app/features/administration/pages/event-consumers/event-consumer.component.ts b/frontend/app/features/administration/pages/event-consumers/event-consumer.component.ts index 0c10f0a23..740b3e1e0 100644 --- a/frontend/app/features/administration/pages/event-consumers/event-consumer.component.ts +++ b/frontend/app/features/administration/pages/event-consumers/event-consumer.component.ts @@ -8,7 +8,6 @@ // tslint:disable: component-selector import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; - import { EventConsumerDto, EventConsumersState } from '@app/features/administration/internal'; @Component({ diff --git a/frontend/app/features/administration/pages/event-consumers/event-consumers-page.component.ts b/frontend/app/features/administration/pages/event-consumers/event-consumers-page.component.ts index 0de18d12f..3c871f8ce 100644 --- a/frontend/app/features/administration/pages/event-consumers/event-consumers-page.component.ts +++ b/frontend/app/features/administration/pages/event-consumers/event-consumers-page.component.ts @@ -6,13 +6,11 @@ */ import { Component, OnInit } from '@angular/core'; +import { EventConsumerDto, EventConsumersState } from '@app/features/administration/internal'; +import { DialogModel, ResourceOwner } from '@app/shared'; import { timer } from 'rxjs'; import { switchMap } from 'rxjs/operators'; -import { DialogModel, ResourceOwner } from '@app/shared'; - -import { EventConsumerDto, EventConsumersState } from '@app/features/administration/internal'; - @Component({ selector: 'sqx-event-consumers-page', styleUrls: ['./event-consumers-page.component.scss'], diff --git a/frontend/app/features/administration/pages/restore/restore-page.component.ts b/frontend/app/features/administration/pages/restore/restore-page.component.ts index 51cfa686e..ec2112539 100644 --- a/frontend/app/features/administration/pages/restore/restore-page.component.ts +++ b/frontend/app/features/administration/pages/restore/restore-page.component.ts @@ -7,16 +7,9 @@ import { Component } from '@angular/core'; import { FormBuilder } from '@angular/forms'; +import { AuthService, BackupsService, DialogService, RestoreForm, switchSafe } from '@app/shared'; import { timer } from 'rxjs'; -import { - AuthService, - BackupsService, - DialogService, - RestoreForm, - switchSafe -} from '@app/shared'; - @Component({ selector: 'sqx-restore-page', styleUrls: ['./restore-page.component.scss'], diff --git a/frontend/app/features/administration/pages/users/user-page.component.ts b/frontend/app/features/administration/pages/users/user-page.component.ts index 34d18e095..9af96b925 100644 --- a/frontend/app/features/administration/pages/users/user-page.component.ts +++ b/frontend/app/features/administration/pages/users/user-page.component.ts @@ -8,16 +8,9 @@ import { Component, OnInit } from '@angular/core'; import { FormBuilder } from '@angular/forms'; import { ActivatedRoute, Router } from '@angular/router'; - +import { CreateUserDto, UserDto, UserForm, UsersState } from '@app/features/administration/internal'; import { ResourceOwner } from '@app/shared'; -import { - CreateUserDto, - UserDto, - UserForm, - UsersState -} from '@app/features/administration/internal'; - @Component({ selector: 'sqx-user-page', styleUrls: ['./user-page.component.scss'], diff --git a/frontend/app/features/administration/pages/users/user.component.ts b/frontend/app/features/administration/pages/users/user.component.ts index 864980464..d2e436c8e 100644 --- a/frontend/app/features/administration/pages/users/user.component.ts +++ b/frontend/app/features/administration/pages/users/user.component.ts @@ -8,7 +8,6 @@ // tslint:disable: component-selector import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; - import { UserDto, UsersState } from '@app/features/administration/internal'; @Component({ diff --git a/frontend/app/features/administration/pages/users/users-page.component.ts b/frontend/app/features/administration/pages/users/users-page.component.ts index 61a39b691..d996ea2a0 100644 --- a/frontend/app/features/administration/pages/users/users-page.component.ts +++ b/frontend/app/features/administration/pages/users/users-page.component.ts @@ -7,7 +7,6 @@ import { Component, OnInit } from '@angular/core'; import { FormControl } from '@angular/forms'; - import { UserDto, UsersState } from '@app/features/administration/internal'; @Component({ diff --git a/frontend/app/features/administration/services/event-consumers.service.spec.ts b/frontend/app/features/administration/services/event-consumers.service.spec.ts index 8bb0607c2..54dcc6260 100644 --- a/frontend/app/features/administration/services/event-consumers.service.spec.ts +++ b/frontend/app/features/administration/services/event-consumers.service.spec.ts @@ -7,14 +7,8 @@ import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; - import { ApiUrlConfig, Resource, ResourceLinks } from '@app/framework'; - -import { - EventConsumerDto, - EventConsumersDto, - EventConsumersService -} from './event-consumers.service'; +import { EventConsumerDto, EventConsumersDto, EventConsumersService } from './event-consumers.service'; describe('EventConsumersService', () => { beforeEach(() => { diff --git a/frontend/app/features/administration/services/event-consumers.service.ts b/frontend/app/features/administration/services/event-consumers.service.ts index 10287e55a..ad2a372a3 100644 --- a/frontend/app/features/administration/services/event-consumers.service.ts +++ b/frontend/app/features/administration/services/event-consumers.service.ts @@ -7,17 +7,10 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; +import { ApiUrlConfig, hasAnyLink, pretifyError, Resource, ResourceLinks } from '@app/shared'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { - ApiUrlConfig, - hasAnyLink, - pretifyError, - Resource, - ResourceLinks -} from '@app/shared'; - export class EventConsumersDto { public readonly _links: ResourceLinks; diff --git a/frontend/app/features/administration/services/users.service.spec.ts b/frontend/app/features/administration/services/users.service.spec.ts index 028660711..6b1366a12 100644 --- a/frontend/app/features/administration/services/users.service.spec.ts +++ b/frontend/app/features/administration/services/users.service.spec.ts @@ -7,14 +7,8 @@ import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; - import { ApiUrlConfig, Resource, ResourceLinks } from '@app/framework'; - -import { - UserDto, - UsersDto, - UsersService -} from './users.service'; +import { UserDto, UsersDto, UsersService } from './users.service'; describe('UsersService', () => { beforeEach(() => { diff --git a/frontend/app/features/administration/services/users.service.ts b/frontend/app/features/administration/services/users.service.ts index 9858cb832..8bdfc70ee 100644 --- a/frontend/app/features/administration/services/users.service.ts +++ b/frontend/app/features/administration/services/users.service.ts @@ -7,18 +7,10 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; +import { ApiUrlConfig, hasAnyLink, pretifyError, Resource, ResourceLinks, ResultSet } from '@app/shared'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { - ApiUrlConfig, - hasAnyLink, - pretifyError, - Resource, - ResourceLinks, - ResultSet -} from '@app/shared'; - export class UsersDto extends ResultSet { public get canCreate() { return hasAnyLink(this._links, 'create'); diff --git a/frontend/app/features/administration/state/event-consumers.state.spec.ts b/frontend/app/features/administration/state/event-consumers.state.spec.ts index 82123f410..e8af21d2f 100644 --- a/frontend/app/features/administration/state/event-consumers.state.spec.ts +++ b/frontend/app/features/administration/state/event-consumers.state.spec.ts @@ -5,16 +5,13 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +import { EventConsumersDto, EventConsumersService } from '@app/features/administration/internal'; +import { DialogService } from '@app/framework'; import { of, throwError } from 'rxjs'; import { onErrorResumeNext } from 'rxjs/operators'; import { IMock, It, Mock, Times } from 'typemoq'; - -import { DialogService } from '@app/framework'; - -import { EventConsumersDto, EventConsumersService } from '@app/features/administration/internal'; -import { EventConsumersState } from './event-consumers.state'; - import { createEventConsumer } from './../services/event-consumers.service.spec'; +import { EventConsumersState } from './event-consumers.state'; describe('EventConsumersState', () => { const eventConsumer1 = createEventConsumer(1); diff --git a/frontend/app/features/administration/state/event-consumers.state.ts b/frontend/app/features/administration/state/event-consumers.state.ts index ceefabeb5..409873753 100644 --- a/frontend/app/features/administration/state/event-consumers.state.ts +++ b/frontend/app/features/administration/state/event-consumers.state.ts @@ -6,15 +6,9 @@ */ import { Injectable } from '@angular/core'; +import { DialogService, shareSubscribed, State } from '@app/shared'; import { Observable } from 'rxjs'; import { finalize, tap } from 'rxjs/operators'; - -import { - DialogService, - shareSubscribed, - State -} from '@app/shared'; - import { EventConsumerDto, EventConsumersService } from './../services/event-consumers.service'; interface Snapshot { diff --git a/frontend/app/features/administration/state/users.forms.ts b/frontend/app/features/administration/state/users.forms.ts index 5b34c84a4..a9df24667 100644 --- a/frontend/app/features/administration/state/users.forms.ts +++ b/frontend/app/features/administration/state/users.forms.ts @@ -6,9 +6,7 @@ */ import { FormBuilder, FormGroup, Validators } from '@angular/forms'; - import { Form, ValidatorsEx } from '@app/shared'; - import { UpdateUserDto, UserDto } from './../services/users.service'; export class UserForm extends Form { diff --git a/frontend/app/features/administration/state/users.state.spec.ts b/frontend/app/features/administration/state/users.state.spec.ts index c66ef5e87..03fc78de6 100644 --- a/frontend/app/features/administration/state/users.state.spec.ts +++ b/frontend/app/features/administration/state/users.state.spec.ts @@ -5,25 +5,13 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +import { UserDto, UsersDto, UsersService } from '@app/features/administration/internal'; +import { DialogService, LocalStoreService, Pager } from '@app/shared'; import { of, throwError } from 'rxjs'; import { onErrorResumeNext } from 'rxjs/operators'; import { IMock, It, Mock, Times } from 'typemoq'; - -import { - DialogService, - LocalStoreService, - Pager -} from '@app/shared'; - -import { - UserDto, - UsersDto, - UsersService -} from '@app/features/administration/internal'; - -import { UsersState } from './users.state'; - import { createUser } from './../services/users.service.spec'; +import { UsersState } from './users.state'; describe('UsersState', () => { const user1 = createUser(1); diff --git a/frontend/app/features/administration/state/users.state.ts b/frontend/app/features/administration/state/users.state.ts index b209cde2a..cec2d910c 100644 --- a/frontend/app/features/administration/state/users.state.ts +++ b/frontend/app/features/administration/state/users.state.ts @@ -6,25 +6,11 @@ */ import { Injectable } from '@angular/core'; +import '@app/framework/utils/rxjs-extensions'; +import { DialogService, LocalStoreService, Pager, shareSubscribed, State } from '@app/shared'; import { Observable, of } from 'rxjs'; import { catchError, finalize, tap } from 'rxjs/operators'; - -import '@app/framework/utils/rxjs-extensions'; - -import { - DialogService, - LocalStoreService, - Pager, - shareSubscribed, - State -} from '@app/shared'; - -import { - CreateUserDto, - UpdateUserDto, - UserDto, - UsersService -} from './../services/users.service'; +import { CreateUserDto, UpdateUserDto, UserDto, UsersService } from './../services/users.service'; interface Snapshot { // The current users. diff --git a/frontend/app/features/api/api-area.component.ts b/frontend/app/features/api/api-area.component.ts index 6e9e538cc..5e16f5fde 100644 --- a/frontend/app/features/api/api-area.component.ts +++ b/frontend/app/features/api/api-area.component.ts @@ -6,7 +6,6 @@ */ import { Component } from '@angular/core'; - import { AppsState } from '@app/shared'; @Component({ diff --git a/frontend/app/features/api/declarations.ts b/frontend/app/features/api/declarations.ts index f3049cc8c..bcec21790 100644 --- a/frontend/app/features/api/declarations.ts +++ b/frontend/app/features/api/declarations.ts @@ -5,6 +5,5 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +export * from './api-area.component'; export * from './pages/graphql/graphql-page.component'; - -export * from './api-area.component'; \ No newline at end of file diff --git a/frontend/app/features/api/index.ts b/frontend/app/features/api/index.ts index d34c6d2ae..da0f82225 100644 --- a/frontend/app/features/api/index.ts +++ b/frontend/app/features/api/index.ts @@ -6,4 +6,4 @@ */ export * from './declarations'; -export * from './module'; \ No newline at end of file +export * from './module'; diff --git a/frontend/app/features/api/module.ts b/frontend/app/features/api/module.ts index 471c3efd6..b4f79462b 100644 --- a/frontend/app/features/api/module.ts +++ b/frontend/app/features/api/module.ts @@ -7,16 +7,8 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; - -import { - SqxFrameworkModule, - SqxSharedModule -} from '@app/shared'; - -import { - ApiAreaComponent, - GraphQLPageComponent -} from './declarations'; +import { SqxFrameworkModule, SqxSharedModule } from '@app/shared'; +import { ApiAreaComponent, GraphQLPageComponent } from './declarations'; const routes: Routes = [ { diff --git a/frontend/app/features/api/pages/graphql/graphql-page.component.ts b/frontend/app/features/api/pages/graphql/graphql-page.component.ts index 05614135c..8afc0a1b2 100644 --- a/frontend/app/features/api/pages/graphql/graphql-page.component.ts +++ b/frontend/app/features/api/pages/graphql/graphql-page.component.ts @@ -6,15 +6,12 @@ */ import { AfterViewInit, Component, ElementRef, ViewChild } from '@angular/core'; -import { of } from 'rxjs'; -import { catchError } from 'rxjs/operators'; - +import { AppsState, GraphQlService } from '@app/shared'; +import GraphiQL from 'graphiql'; import * as React from 'react'; import * as ReactDOM from 'react-dom'; - -import GraphiQL from 'graphiql'; - -import { AppsState, GraphQlService } from '@app/shared'; +import { of } from 'rxjs'; +import { catchError } from 'rxjs/operators'; @Component({ selector: 'sqx-graphql-page', diff --git a/frontend/app/features/apps/declarations.ts b/frontend/app/features/apps/declarations.ts index 17e2a5940..cf67865fb 100644 --- a/frontend/app/features/apps/declarations.ts +++ b/frontend/app/features/apps/declarations.ts @@ -7,4 +7,4 @@ export * from './pages/apps-page.component'; export * from './pages/news-dialog.component'; -export * from './pages/onboarding-dialog.component'; \ No newline at end of file +export * from './pages/onboarding-dialog.component'; diff --git a/frontend/app/features/apps/index.ts b/frontend/app/features/apps/index.ts index d34c6d2ae..da0f82225 100644 --- a/frontend/app/features/apps/index.ts +++ b/frontend/app/features/apps/index.ts @@ -6,4 +6,4 @@ */ export * from './declarations'; -export * from './module'; \ No newline at end of file +export * from './module'; diff --git a/frontend/app/features/apps/module.ts b/frontend/app/features/apps/module.ts index cf43f604e..f091e3d9e 100644 --- a/frontend/app/features/apps/module.ts +++ b/frontend/app/features/apps/module.ts @@ -7,14 +7,8 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; - import { SqxFrameworkModule, SqxSharedModule } from '@app/shared'; - -import { - AppsPageComponent, - NewsDialogComponent, - OnboardingDialogComponent -} from './declarations'; +import { AppsPageComponent, NewsDialogComponent, OnboardingDialogComponent } from './declarations'; const routes: Routes = [ { diff --git a/frontend/app/features/apps/pages/apps-page.component.ts b/frontend/app/features/apps/pages/apps-page.component.ts index 0519c76a0..4b889156a 100644 --- a/frontend/app/features/apps/pages/apps-page.component.ts +++ b/frontend/app/features/apps/pages/apps-page.component.ts @@ -6,21 +6,9 @@ */ import { Component, OnInit } from '@angular/core'; +import { AppDto, AppsState, AuthService, DialogModel, FeatureDto, LocalStoreService, NewsService, OnboardingService, UIOptions, UIState } from '@app/shared'; import { take } from 'rxjs/operators'; -import { - AppDto, - AppsState, - AuthService, - DialogModel, - FeatureDto, - LocalStoreService, - NewsService, - OnboardingService, - UIOptions, - UIState -} from '@app/shared'; - @Component({ selector: 'sqx-apps-page', styleUrls: ['./apps-page.component.scss'], diff --git a/frontend/app/features/apps/pages/news-dialog.component.ts b/frontend/app/features/apps/pages/news-dialog.component.ts index 6ffeff783..001477bdd 100644 --- a/frontend/app/features/apps/pages/news-dialog.component.ts +++ b/frontend/app/features/apps/pages/news-dialog.component.ts @@ -6,7 +6,6 @@ */ import { Component, EventEmitter, Input, Output } from '@angular/core'; - import { FeatureDto } from '@app/shared'; @Component({ diff --git a/frontend/app/features/apps/pages/onboarding-dialog.component.ts b/frontend/app/features/apps/pages/onboarding-dialog.component.ts index 53fe2a8d7..897da9e80 100644 --- a/frontend/app/features/apps/pages/onboarding-dialog.component.ts +++ b/frontend/app/features/apps/pages/onboarding-dialog.component.ts @@ -6,7 +6,6 @@ */ import { Component, EventEmitter, Output } from '@angular/core'; - import { fadeAnimation, slideAnimation } from '@app/framework'; @Component({ diff --git a/frontend/app/features/assets/declarations.ts b/frontend/app/features/assets/declarations.ts index 365980ef5..3bd37c8d0 100644 --- a/frontend/app/features/assets/declarations.ts +++ b/frontend/app/features/assets/declarations.ts @@ -5,6 +5,6 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +export * from './pages/asset-tags.component'; export * from './pages/assets-filters-page.component'; export * from './pages/assets-page.component'; -export * from './pages/asset-tags.component'; \ No newline at end of file diff --git a/frontend/app/features/assets/index.ts b/frontend/app/features/assets/index.ts index d34c6d2ae..da0f82225 100644 --- a/frontend/app/features/assets/index.ts +++ b/frontend/app/features/assets/index.ts @@ -6,4 +6,4 @@ */ export * from './declarations'; -export * from './module'; \ No newline at end of file +export * from './module'; diff --git a/frontend/app/features/assets/module.ts b/frontend/app/features/assets/module.ts index 0b65d9fe4..f5a846a6e 100644 --- a/frontend/app/features/assets/module.ts +++ b/frontend/app/features/assets/module.ts @@ -7,14 +7,8 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; - import { SqxFrameworkModule, SqxSharedModule } from '@app/shared'; - -import { - AssetsFiltersPageComponent, - AssetsPageComponent, - AssetTagsComponent -} from './declarations'; +import { AssetsFiltersPageComponent, AssetsPageComponent, AssetTagsComponent } from './declarations'; const routes: Routes = [ { diff --git a/frontend/app/features/assets/pages/asset-tags.component.ts b/frontend/app/features/assets/pages/asset-tags.component.ts index f011ad8b4..c2868e822 100644 --- a/frontend/app/features/assets/pages/asset-tags.component.ts +++ b/frontend/app/features/assets/pages/asset-tags.component.ts @@ -6,7 +6,6 @@ */ import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; - import { Tag, TagsSelected } from '@app/shared'; @Component({ diff --git a/frontend/app/features/assets/pages/assets-filters-page.component.ts b/frontend/app/features/assets/pages/assets-filters-page.component.ts index 2435d4159..c1e067904 100644 --- a/frontend/app/features/assets/pages/assets-filters-page.component.ts +++ b/frontend/app/features/assets/pages/assets-filters-page.component.ts @@ -6,13 +6,7 @@ */ import { Component } from '@angular/core'; - -import { - AssetsState, - Queries, - Query, - UIState -} from '@app/shared'; +import { AssetsState, Queries, Query, UIState } from '@app/shared'; @Component({ selector: 'sqx-assets-filters-page', diff --git a/frontend/app/features/assets/pages/assets-page.component.ts b/frontend/app/features/assets/pages/assets-page.component.ts index e039250fc..47cdd69db 100644 --- a/frontend/app/features/assets/pages/assets-page.component.ts +++ b/frontend/app/features/assets/pages/assets-page.component.ts @@ -8,16 +8,7 @@ import { Component, OnInit } from '@angular/core'; import { FormControl } from '@angular/forms'; import { ActivatedRoute } from '@angular/router'; - -import { - AssetsState, - DialogModel, - LocalStoreService, - Queries, - Query, - ResourceOwner, - UIState -} from '@app/shared'; +import { AssetsState, DialogModel, LocalStoreService, Queries, Query, ResourceOwner, UIState } from '@app/shared'; @Component({ selector: 'sqx-assets-page', diff --git a/frontend/app/features/content/declarations.ts b/frontend/app/features/content/declarations.ts index 7164ff7d7..9fb9c819b 100644 --- a/frontend/app/features/content/declarations.ts +++ b/frontend/app/features/content/declarations.ts @@ -15,26 +15,22 @@ export * from './pages/contents/contents-filters-page.component'; export * from './pages/contents/contents-page.component'; export * from './pages/contents/custom-view-editor.component'; export * from './pages/schemas/schemas-page.component'; - export * from './shared/content-status.component'; export * from './shared/due-time-selector.component'; -export * from './shared/preview-button.component'; - export * from './shared/forms/array-editor.component'; export * from './shared/forms/array-item.component'; export * from './shared/forms/assets-editor.component'; export * from './shared/forms/field-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/preview-button.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/content-creator.component'; export * from './shared/references/reference-item.component'; -export * from './shared/references/references-editor.component'; \ No newline at end of file +export * from './shared/references/references-editor.component'; diff --git a/frontend/app/features/content/index.ts b/frontend/app/features/content/index.ts index d34c6d2ae..da0f82225 100644 --- a/frontend/app/features/content/index.ts +++ b/frontend/app/features/content/index.ts @@ -6,4 +6,4 @@ */ export * from './declarations'; -export * from './module'; \ No newline at end of file +export * from './module'; diff --git a/frontend/app/features/content/module.ts b/frontend/app/features/content/module.ts index cc2f1433f..bb3a6fa5d 100644 --- a/frontend/app/features/content/module.ts +++ b/frontend/app/features/content/module.ts @@ -5,52 +5,12 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +// tslint:disable: max-line-length + import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; - -import { - CanDeactivateGuard, - ContentMustExistGuard, - LoadLanguagesGuard, - SchemaMustExistPublishedGuard, - SchemaMustNotBeSingletonGuard, - SqxFrameworkModule, - SqxSharedModule, - UnsetContentGuard -} from '@app/shared'; - -import { - ArrayEditorComponent, - ArrayItemComponent, - AssetsEditorComponent, - CommentsPageComponent, - ContentComponent, - ContentCreatorComponent, - ContentEventComponent, - ContentFieldComponent, - ContentHistoryPageComponent, - ContentListCellDirective, - ContentListFieldComponent, - ContentListHeaderComponent, - ContentListWidthPipe, - ContentPageComponent, - ContentSelectorComponent, - ContentSelectorItemComponent, - ContentsFiltersPageComponent, - ContentsPageComponent, - ContentStatusComponent, - ContentValueComponent, - ContentValueEditorComponent, - CustomViewEditorComponent, - DueTimeSelectorComponent, - FieldEditorComponent, - FieldLanguagesComponent, - PreviewButtonComponent, - ReferenceItemComponent, - ReferencesEditorComponent, - SchemasPageComponent, - StockPhotoEditorComponent -} from './declarations'; +import { CanDeactivateGuard, ContentMustExistGuard, LoadLanguagesGuard, SchemaMustExistPublishedGuard, SchemaMustNotBeSingletonGuard, SqxFrameworkModule, SqxSharedModule, UnsetContentGuard } from '@app/shared'; +import { ArrayEditorComponent, ArrayItemComponent, AssetsEditorComponent, CommentsPageComponent, ContentComponent, ContentCreatorComponent, ContentEventComponent, ContentFieldComponent, ContentHistoryPageComponent, ContentListCellDirective, ContentListFieldComponent, ContentListHeaderComponent, ContentListWidthPipe, ContentPageComponent, ContentSelectorComponent, ContentSelectorItemComponent, ContentsFiltersPageComponent, ContentsPageComponent, ContentStatusComponent, ContentValueComponent, ContentValueEditorComponent, CustomViewEditorComponent, DueTimeSelectorComponent, FieldEditorComponent, FieldLanguagesComponent, PreviewButtonComponent, ReferenceItemComponent, ReferencesEditorComponent, SchemasPageComponent, StockPhotoEditorComponent } from './declarations'; const routes: Routes = [ { diff --git a/frontend/app/features/content/pages/comments/comments-page.component.ts b/frontend/app/features/content/pages/comments/comments-page.component.ts index 58ff057f2..10be2ca86 100644 --- a/frontend/app/features/content/pages/comments/comments-page.component.ts +++ b/frontend/app/features/content/pages/comments/comments-page.component.ts @@ -7,7 +7,6 @@ import { Component, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; - import { allParams } from '@app/shared'; @Component({ diff --git a/frontend/app/features/content/pages/content/content-event.component.ts b/frontend/app/features/content/pages/content/content-event.component.ts index 6a2664b63..d9d9e82f9 100644 --- a/frontend/app/features/content/pages/content/content-event.component.ts +++ b/frontend/app/features/content/pages/content/content-event.component.ts @@ -6,7 +6,6 @@ */ import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, Output } from '@angular/core'; - import { ContentDto, HistoryEventDto } from '@app/shared'; @Component({ diff --git a/frontend/app/features/content/pages/content/content-field.component.ts b/frontend/app/features/content/pages/content/content-field.component.ts index 254302c77..c3b186536 100644 --- a/frontend/app/features/content/pages/content/content-field.component.ts +++ b/frontend/app/features/content/pages/content/content-field.component.ts @@ -7,23 +7,10 @@ import { Component, DoCheck, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core'; import { AbstractControl, FormGroup } from '@angular/forms'; +import { AppLanguageDto, AppsState, EditContentForm, fieldInvariant, invalid$, LocalStoreService, RootFieldDto, SchemaDto, TranslationsService, Types, value$ } from '@app/shared'; import { Observable } from 'rxjs'; import { combineLatest } from 'rxjs/operators'; -import { - AppLanguageDto, - AppsState, - EditContentForm, - fieldInvariant, - invalid$, - LocalStoreService, - RootFieldDto, - SchemaDto, - TranslationsService, - Types, - value$ -} from '@app/shared'; - @Component({ selector: 'sqx-content-field', styleUrls: ['./content-field.component.scss'], diff --git a/frontend/app/features/content/pages/content/content-history-page.component.ts b/frontend/app/features/content/pages/content/content-history-page.component.ts index c14a87a5c..2505e0aae 100644 --- a/frontend/app/features/content/pages/content/content-history-page.component.ts +++ b/frontend/app/features/content/pages/content/content-history-page.component.ts @@ -8,23 +8,9 @@ // tslint:disable: triple-equals import { Component, OnInit, ViewChild } from '@angular/core'; +import { AppsState, ContentDto, ContentsState, fadeAnimation, HistoryEventDto, HistoryService, ModalModel, ResourceOwner, SchemaDetailsDto, SchemasState, switchSafe } from '@app/shared'; import { Observable, timer } from 'rxjs'; import { filter, map, onErrorResumeNext, switchMap } from 'rxjs/operators'; - -import { - AppsState, - ContentDto, - ContentsState, - fadeAnimation, - HistoryEventDto, - HistoryService, - ModalModel, - ResourceOwner, - SchemaDetailsDto, - SchemasState, - switchSafe -} from '@app/shared'; - import { DueTimeSelectorComponent } from './../../shared/due-time-selector.component'; import { ContentPageComponent } from './content-page.component'; diff --git a/frontend/app/features/content/pages/content/content-page.component.ts b/frontend/app/features/content/pages/content/content-page.component.ts index f235d00f9..c57c39a81 100644 --- a/frontend/app/features/content/pages/content/content-page.component.ts +++ b/frontend/app/features/content/pages/content/content-page.component.ts @@ -5,33 +5,14 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +// tslint:disable: max-line-length + import { Component, OnInit } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; +import { ApiUrlConfig, AppLanguageDto, AuthService, AutoSaveKey, AutoSaveService, CanComponentDeactivate, ContentDto, ContentsState, DialogService, EditContentForm, fadeAnimation, FieldDto, LanguagesState, ModalModel, ResourceOwner, SchemaDetailsDto, SchemasState, TempService, Version } from '@app/shared'; import { Observable, of } from 'rxjs'; import { debounceTime, filter, onErrorResumeNext, tap } from 'rxjs/operators'; -import { - ApiUrlConfig, - AppLanguageDto, - AuthService, - AutoSaveKey, - AutoSaveService, - CanComponentDeactivate, - ContentDto, - ContentsState, - DialogService, - EditContentForm, - fadeAnimation, - FieldDto, - LanguagesState, - ModalModel, - ResourceOwner, - SchemaDetailsDto, - SchemasState, - TempService, - Version -} from '@app/shared'; - @Component({ selector: 'sqx-content-page', styleUrls: ['./content-page.component.scss'], diff --git a/frontend/app/features/content/pages/content/field-languages.component.ts b/frontend/app/features/content/pages/content/field-languages.component.ts index 3f56fde76..a4d843a49 100644 --- a/frontend/app/features/content/pages/content/field-languages.component.ts +++ b/frontend/app/features/content/pages/content/field-languages.component.ts @@ -6,7 +6,6 @@ */ import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; - import { AppLanguageDto, RootFieldDto } from '@app/shared'; @Component({ diff --git a/frontend/app/features/content/pages/contents/contents-filters-page.component.ts b/frontend/app/features/content/pages/contents/contents-filters-page.component.ts index 8432c095b..cd13f40c4 100644 --- a/frontend/app/features/content/pages/contents/contents-filters-page.component.ts +++ b/frontend/app/features/content/pages/contents/contents-filters-page.component.ts @@ -6,15 +6,7 @@ */ import { Component, OnInit } from '@angular/core'; - -import { - ContentsState, - Queries, - Query, - ResourceOwner, - SchemasState, - UIState -} from '@app/shared'; +import { ContentsState, Queries, Query, ResourceOwner, SchemasState, UIState } from '@app/shared'; @Component({ selector: 'sqx-contents-filters-page', diff --git a/frontend/app/features/content/pages/contents/contents-page.component.ts b/frontend/app/features/content/pages/contents/contents-page.component.ts index 1334d5f53..47c393d04 100644 --- a/frontend/app/features/content/pages/contents/contents-page.component.ts +++ b/frontend/app/features/content/pages/contents/contents-page.component.ts @@ -7,27 +7,8 @@ import { Component, OnInit, ViewChild } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; +import { AppLanguageDto, ContentDto, ContentsState, fadeAnimation, LanguagesState, ModalModel, Queries, Query, QueryModel, queryModelFromSchema, ResourceOwner, SchemaDetailsDto, SchemasState, TableFields, TempService, UIState } from '@app/shared'; import { onErrorResumeNext, switchMap, tap } from 'rxjs/operators'; - -import { - AppLanguageDto, - ContentDto, - ContentsState, - fadeAnimation, - LanguagesState, - ModalModel, - Queries, - Query, - QueryModel, - queryModelFromSchema, - ResourceOwner, - SchemaDetailsDto, - SchemasState, - TableFields, - TempService, - UIState -} from '@app/shared'; - import { DueTimeSelectorComponent } from './../../shared/due-time-selector.component'; @Component({ diff --git a/frontend/app/features/content/pages/schemas/schemas-page.component.ts b/frontend/app/features/content/pages/schemas/schemas-page.component.ts index 1af3b3357..356d9c897 100644 --- a/frontend/app/features/content/pages/schemas/schemas-page.component.ts +++ b/frontend/app/features/content/pages/schemas/schemas-page.component.ts @@ -7,7 +7,6 @@ import { Component, OnInit } from '@angular/core'; import { FormControl } from '@angular/forms'; - import { LocalStoreService, SchemaCategory, SchemasState } from '@app/shared'; @Component({ diff --git a/frontend/app/features/content/shared/content-status.component.ts b/frontend/app/features/content/shared/content-status.component.ts index 82af1c9bf..3e0b50d71 100644 --- a/frontend/app/features/content/shared/content-status.component.ts +++ b/frontend/app/features/content/shared/content-status.component.ts @@ -6,7 +6,6 @@ */ import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; - import { ScheduleDto } from '@app/shared'; @Component({ diff --git a/frontend/app/features/content/shared/due-time-selector.component.ts b/frontend/app/features/content/shared/due-time-selector.component.ts index c3f760dcc..0c1abfa79 100644 --- a/frontend/app/features/content/shared/due-time-selector.component.ts +++ b/frontend/app/features/content/shared/due-time-selector.component.ts @@ -6,9 +6,8 @@ */ import { Component } from '@angular/core'; -import { Observable, of, Subject } from 'rxjs'; - import { DialogModel, UIOptions } from '@app/shared'; +import { Observable, of, Subject } from 'rxjs'; const OPTION_IMMEDIATELY = 'Immediately'; diff --git a/frontend/app/features/content/shared/forms/array-editor.component.ts b/frontend/app/features/content/shared/forms/array-editor.component.ts index 50df5e855..c860663a8 100644 --- a/frontend/app/features/content/shared/forms/array-editor.component.ts +++ b/frontend/app/features/content/shared/forms/array-editor.component.ts @@ -8,14 +8,7 @@ import { CdkDragDrop } from '@angular/cdk/drag-drop'; import { ChangeDetectionStrategy, Component, Input, QueryList, ViewChildren } from '@angular/core'; import { AbstractControl, FormArray, FormGroup } from '@angular/forms'; - -import { - AppLanguageDto, - EditContentForm, - RootFieldDto, - sorted -} from '@app/shared'; - +import { AppLanguageDto, EditContentForm, RootFieldDto, sorted } from '@app/shared'; import { ArrayItemComponent } from './array-item.component'; @Component({ diff --git a/frontend/app/features/content/shared/forms/array-item.component.ts b/frontend/app/features/content/shared/forms/array-item.component.ts index e9731a851..24b61e525 100644 --- a/frontend/app/features/content/shared/forms/array-item.component.ts +++ b/frontend/app/features/content/shared/forms/array-item.component.ts @@ -7,18 +7,8 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, OnChanges, OnDestroy, Output, QueryList, SimpleChanges, ViewChildren } from '@angular/core'; import { AbstractControl, FormGroup } from '@angular/forms'; +import { AppLanguageDto, EditContentForm, FieldDto, FieldFormatter, invalid$, RootFieldDto, value$ } from '@app/shared'; import { Observable, Subscription } from 'rxjs'; - -import { - AppLanguageDto, - EditContentForm, - FieldDto, - FieldFormatter, - invalid$, - RootFieldDto, - value$ -} from '@app/shared'; - import { FieldEditorComponent } from './field-editor.component'; type FieldControl = { field: FieldDto, control: AbstractControl }; diff --git a/frontend/app/features/content/shared/forms/assets-editor.component.ts b/frontend/app/features/content/shared/forms/assets-editor.component.ts index 78b6d1700..abeba63b0 100644 --- a/frontend/app/features/content/shared/forms/assets-editor.component.ts +++ b/frontend/app/features/content/shared/forms/assets-editor.component.ts @@ -8,18 +8,7 @@ import { CdkDragDrop } from '@angular/cdk/drag-drop'; import { ChangeDetectionStrategy, ChangeDetectorRef, Component, forwardRef, OnInit } from '@angular/core'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; - -import { - AppsState, - AssetDto, - AssetsService, - DialogModel, - LocalStoreService, - MessageBus, - sorted, - StatefulControlComponent, - Types -} from '@app/shared'; +import { AppsState, AssetDto, AssetsService, DialogModel, LocalStoreService, MessageBus, sorted, StatefulControlComponent, Types } from '@app/shared'; export const SQX_ASSETS_EDITOR_CONTROL_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => AssetsEditorComponent), multi: true diff --git a/frontend/app/features/content/shared/forms/field-editor.component.ts b/frontend/app/features/content/shared/forms/field-editor.component.ts index 974cd8d5b..8498fcb4d 100644 --- a/frontend/app/features/content/shared/forms/field-editor.component.ts +++ b/frontend/app/features/content/shared/forms/field-editor.component.ts @@ -7,15 +7,7 @@ import { Component, ElementRef, Input, ViewChild } from '@angular/core'; import { AbstractControl, FormArray, FormControl } from '@angular/forms'; - -import { - AppLanguageDto, - EditContentForm, - FieldDto, - MathHelper, - RootFieldDto, - Types -} from '@app/shared'; +import { AppLanguageDto, EditContentForm, FieldDto, MathHelper, RootFieldDto, Types } from '@app/shared'; @Component({ selector: 'sqx-field-editor', diff --git a/frontend/app/features/content/shared/forms/stock-photo-editor.component.ts b/frontend/app/features/content/shared/forms/stock-photo-editor.component.ts index b352ec3d6..9eb45dfb6 100644 --- a/frontend/app/features/content/shared/forms/stock-photo-editor.component.ts +++ b/frontend/app/features/content/shared/forms/stock-photo-editor.component.ts @@ -7,18 +7,10 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, forwardRef, OnInit } from '@angular/core'; import { FormControl, NG_VALUE_ACCESSOR } from '@angular/forms'; +import { StatefulControlComponent, StockPhotoDto, StockPhotoService, thumbnail, Types, value$ } from '@app/shared'; import { of } from 'rxjs'; import { debounceTime, map, switchMap, tap } from 'rxjs/operators'; -import { - StatefulControlComponent, - StockPhotoDto, - StockPhotoService, - thumbnail, - Types, - value$ -} from '@app/shared'; - interface State { // True when loading assets. isLoading?: boolean; diff --git a/frontend/app/features/content/shared/list/content-list-cell.directive.ts b/frontend/app/features/content/shared/list/content-list-cell.directive.ts index c380c0237..00bc89856 100644 --- a/frontend/app/features/content/shared/list/content-list-cell.directive.ts +++ b/frontend/app/features/content/shared/list/content-list-cell.directive.ts @@ -6,13 +6,7 @@ */ import { Directive, ElementRef, Input, OnChanges, Pipe, PipeTransform, Renderer2 } from '@angular/core'; - -import { - MetaFields, - RootFieldDto, - TableField, - Types -} from '@app/shared'; +import { MetaFields, RootFieldDto, TableField, Types } from '@app/shared'; export function getTableWidth(fields: ReadonlyArray) { let result = 0; diff --git a/frontend/app/features/content/shared/list/content-list-field.component.ts b/frontend/app/features/content/shared/list/content-list-field.component.ts index 637342aca..15caacb1a 100644 --- a/frontend/app/features/content/shared/list/content-list-field.component.ts +++ b/frontend/app/features/content/shared/list/content-list-field.component.ts @@ -7,16 +7,7 @@ import { ChangeDetectionStrategy, Component, Input, OnChanges } from '@angular/core'; import { FormGroup } from '@angular/forms'; - -import { - ContentDto, - getContentValue, - LanguageDto, - MetaFields, - RootFieldDto, - TableField, - Types -} from '@app/shared'; +import { ContentDto, getContentValue, LanguageDto, MetaFields, RootFieldDto, TableField, Types } from '@app/shared'; @Component({ selector: 'sqx-content-list-field', diff --git a/frontend/app/features/content/shared/list/content-list-header.component.ts b/frontend/app/features/content/shared/list/content-list-header.component.ts index b27256014..e8600cac1 100644 --- a/frontend/app/features/content/shared/list/content-list-header.component.ts +++ b/frontend/app/features/content/shared/list/content-list-header.component.ts @@ -6,15 +6,7 @@ */ import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; - -import { - LanguageDto, - MetaFields, - Query, - RootFieldDto, - TableField, - Types -} from '@app/shared'; +import { LanguageDto, MetaFields, Query, RootFieldDto, TableField, Types } from '@app/shared'; @Component({ selector: 'sqx-content-list-header', diff --git a/frontend/app/features/content/shared/list/content-value-editor.component.ts b/frontend/app/features/content/shared/list/content-value-editor.component.ts index 233a58994..725ec897b 100644 --- a/frontend/app/features/content/shared/list/content-value-editor.component.ts +++ b/frontend/app/features/content/shared/list/content-value-editor.component.ts @@ -7,7 +7,6 @@ import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; import { FormGroup } from '@angular/forms'; - import { FieldDto } from '@app/shared'; @Component({ diff --git a/frontend/app/features/content/shared/list/content-value.component.ts b/frontend/app/features/content/shared/list/content-value.component.ts index 51d5b18bb..834588a75 100644 --- a/frontend/app/features/content/shared/list/content-value.component.ts +++ b/frontend/app/features/content/shared/list/content-value.component.ts @@ -6,7 +6,6 @@ */ import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; - import { HtmlValue, Types } from '@app/shared'; @Component({ diff --git a/frontend/app/features/content/shared/list/content.component.ts b/frontend/app/features/content/shared/list/content.component.ts index 4a5a85b4e..4ef1516d7 100644 --- a/frontend/app/features/content/shared/list/content.component.ts +++ b/frontend/app/features/content/shared/list/content.component.ts @@ -6,22 +6,10 @@ */ 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, 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({ selector: '[sqxContent]', diff --git a/frontend/app/features/content/shared/preview-button.component.ts b/frontend/app/features/content/shared/preview-button.component.ts index d02095c61..40d8d614a 100644 --- a/frontend/app/features/content/shared/preview-button.component.ts +++ b/frontend/app/features/content/shared/preview-button.component.ts @@ -6,16 +6,7 @@ */ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnInit } from '@angular/core'; - -import { - ContentDto, - fadeAnimation, - interpolate, - LocalStoreService, - ModalModel, - SchemaDetailsDto, - StatefulComponent -} from '@app/shared'; +import { ContentDto, fadeAnimation, interpolate, LocalStoreService, ModalModel, SchemaDetailsDto, StatefulComponent } from '@app/shared'; interface State { // The name of the selected preview config. diff --git a/frontend/app/features/content/shared/references/content-creator.component.ts b/frontend/app/features/content/shared/references/content-creator.component.ts index eee52effc..1817f8f3e 100644 --- a/frontend/app/features/content/shared/references/content-creator.component.ts +++ b/frontend/app/features/content/shared/references/content-creator.component.ts @@ -6,22 +6,7 @@ */ import { ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; - -import { - ApiUrlConfig, - AppLanguageDto, - AppsState, - AuthService, - ContentDto, - EditContentForm, - LanguageDto, - ManualContentsState, - ResourceOwner, - SchemaDetailsDto, - SchemaDto, - SchemasState, - Types -} from '@app/shared'; +import { ApiUrlConfig, AppLanguageDto, AppsState, AuthService, ContentDto, EditContentForm, LanguageDto, ManualContentsState, ResourceOwner, SchemaDetailsDto, SchemaDto, SchemasState, Types } from '@app/shared'; @Component({ selector: 'sqx-content-creator', diff --git a/frontend/app/features/content/shared/references/content-selector-item.component.ts b/frontend/app/features/content/shared/references/content-selector-item.component.ts index 09e39730b..abbb06f67 100644 --- a/frontend/app/features/content/shared/references/content-selector-item.component.ts +++ b/frontend/app/features/content/shared/references/content-selector-item.component.ts @@ -5,15 +5,10 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -/* tslint:disable:component-selector */ +/* tslint:disable: component-selector */ import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; - -import { - ContentDto, - LanguageDto, - SchemaDetailsDto -} from '@app/shared'; +import { ContentDto, LanguageDto, SchemaDetailsDto } from '@app/shared'; @Component({ selector: '[sqxContentSelectorItem]', diff --git a/frontend/app/features/content/shared/references/content-selector.component.ts b/frontend/app/features/content/shared/references/content-selector.component.ts index 5ef7557f9..cb62e60b1 100644 --- a/frontend/app/features/content/shared/references/content-selector.component.ts +++ b/frontend/app/features/content/shared/references/content-selector.component.ts @@ -6,22 +6,7 @@ */ import { ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; - -import { - ApiUrlConfig, - AppsState, - ContentDto, - LanguageDto, - ManualContentsState, - Query, - QueryModel, - queryModelFromSchema, - ResourceOwner, - SchemaDetailsDto, - SchemaDto, - SchemasState, - Types -} from '@app/shared'; +import { ApiUrlConfig, AppsState, ContentDto, LanguageDto, ManualContentsState, Query, QueryModel, queryModelFromSchema, ResourceOwner, SchemaDetailsDto, SchemaDto, SchemasState, Types } from '@app/shared'; @Component({ selector: 'sqx-content-selector', diff --git a/frontend/app/features/content/shared/references/reference-item.component.ts b/frontend/app/features/content/shared/references/reference-item.component.ts index 47adb7a5e..06620abf1 100644 --- a/frontend/app/features/content/shared/references/reference-item.component.ts +++ b/frontend/app/features/content/shared/references/reference-item.component.ts @@ -5,15 +5,10 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -/* tslint:disable:component-selector */ +/* tslint:disable: component-selector */ import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, Output } from '@angular/core'; - -import { - AppLanguageDto, - ContentDto, - getContentValue -} from '@app/shared'; +import { AppLanguageDto, ContentDto, getContentValue } from '@app/shared'; @Component({ selector: '[sqxReferenceItem]', diff --git a/frontend/app/features/content/shared/references/references-editor.component.ts b/frontend/app/features/content/shared/references/references-editor.component.ts index 88d4a918c..7bf2d0b32 100644 --- a/frontend/app/features/content/shared/references/references-editor.component.ts +++ b/frontend/app/features/content/shared/references/references-editor.component.ts @@ -8,17 +8,7 @@ import { CdkDragDrop } from '@angular/cdk/drag-drop'; import { ChangeDetectionStrategy, ChangeDetectorRef, Component, forwardRef, Input } from '@angular/core'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; - -import { - AppLanguageDto, - AppsState, - ContentDto, - ContentsService, - DialogModel, - sorted, - StatefulControlComponent, - Types -} from '@app/shared'; +import { AppLanguageDto, AppsState, ContentDto, ContentsService, DialogModel, sorted, StatefulControlComponent, Types } from '@app/shared'; export const SQX_REFERENCES_EDITOR_CONTROL_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => ReferencesEditorComponent), multi: true diff --git a/frontend/app/features/dashboard/declarations.ts b/frontend/app/features/dashboard/declarations.ts index c0bfafd9a..8378cb66c 100644 --- a/frontend/app/features/dashboard/declarations.ts +++ b/frontend/app/features/dashboard/declarations.ts @@ -5,4 +5,4 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -export * from './pages/dashboard-page.component'; \ No newline at end of file +export * from './pages/dashboard-page.component'; diff --git a/frontend/app/features/dashboard/index.ts b/frontend/app/features/dashboard/index.ts index d34c6d2ae..da0f82225 100644 --- a/frontend/app/features/dashboard/index.ts +++ b/frontend/app/features/dashboard/index.ts @@ -6,4 +6,4 @@ */ export * from './declarations'; -export * from './module'; \ No newline at end of file +export * from './module'; diff --git a/frontend/app/features/dashboard/module.ts b/frontend/app/features/dashboard/module.ts index d821eb1f6..578c80a2c 100644 --- a/frontend/app/features/dashboard/module.ts +++ b/frontend/app/features/dashboard/module.ts @@ -7,13 +7,9 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; -import { ChartModule } from 'angular2-chartjs'; - import { SqxFrameworkModule, SqxSharedModule } from '@app/shared'; - -import { - DashboardPageComponent -} from './declarations'; +import { ChartModule } from 'angular2-chartjs'; +import { DashboardPageComponent } from './declarations'; const routes: Routes = [ { diff --git a/frontend/app/features/dashboard/pages/dashboard-page.component.ts b/frontend/app/features/dashboard/pages/dashboard-page.component.ts index ac67a6aa9..a3b88dc37 100644 --- a/frontend/app/features/dashboard/pages/dashboard-page.component.ts +++ b/frontend/app/features/dashboard/pages/dashboard-page.component.ts @@ -6,20 +6,9 @@ */ import { Component, OnInit } from '@angular/core'; +import { AppsState, AuthService, DateTime, fadeAnimation, HistoryEventDto, HistoryService, LocalStoreService, ResourceOwner, UsagesService } from '@app/shared'; import { switchMap } from 'rxjs/operators'; -import { - AppsState, - AuthService, - DateTime, - fadeAnimation, - HistoryEventDto, - HistoryService, - LocalStoreService, - ResourceOwner, - UsagesService -} from '@app/shared'; - const COLORS: ReadonlyArray = [ ' 51, 137, 213', '211, 50, 50', diff --git a/frontend/app/features/rules/declarations.ts b/frontend/app/features/rules/declarations.ts index c8c5e4a06..8ec9a27ad 100644 --- a/frontend/app/features/rules/declarations.ts +++ b/frontend/app/features/rules/declarations.ts @@ -5,19 +5,16 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +export * from './pages/events/pipes'; +export * from './pages/events/rule-events-page.component'; export * from './pages/rules/actions/generic-action.component'; - -export * from './pages/rules/triggers/asset-changed-trigger.component'; -export * from './pages/rules/triggers/comment-trigger.component'; -export * from './pages/rules/triggers/content-changed-trigger.component'; -export * from './pages/rules/triggers/schema-changed-trigger.component'; -export * from './pages/rules/triggers/usage-trigger.component'; - export * from './pages/rules/rule-element.component'; export * from './pages/rules/rule-icon.component'; export * from './pages/rules/rule-wizard.component'; export * from './pages/rules/rule.component'; export * from './pages/rules/rules-page.component'; - -export * from './pages/events/pipes'; -export * from './pages/events/rule-events-page.component'; \ No newline at end of file +export * from './pages/rules/triggers/asset-changed-trigger.component'; +export * from './pages/rules/triggers/comment-trigger.component'; +export * from './pages/rules/triggers/content-changed-trigger.component'; +export * from './pages/rules/triggers/schema-changed-trigger.component'; +export * from './pages/rules/triggers/usage-trigger.component'; \ No newline at end of file diff --git a/frontend/app/features/rules/index.ts b/frontend/app/features/rules/index.ts index d34c6d2ae..da0f82225 100644 --- a/frontend/app/features/rules/index.ts +++ b/frontend/app/features/rules/index.ts @@ -6,4 +6,4 @@ */ export * from './declarations'; -export * from './module'; \ No newline at end of file +export * from './module'; diff --git a/frontend/app/features/rules/module.ts b/frontend/app/features/rules/module.ts index 3f6d7307f..917e399b1 100644 --- a/frontend/app/features/rules/module.ts +++ b/frontend/app/features/rules/module.ts @@ -5,30 +5,12 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +// tslint:disable: max-line-length + import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; - -import { - HelpComponent, - SqxFrameworkModule, - SqxSharedModule -} from '@app/shared'; - -import { - AssetChangedTriggerComponent, - CommentTriggerComponent, - ContentChangedTriggerComponent, - GenericActionComponent, - RuleComponent, - RuleElementComponent, - RuleEventBadgeClassPipe, - RuleEventsPageComponent, - RuleIconComponent, - RulesPageComponent, - RuleWizardComponent, - SchemaChangedTriggerComponent, - UsageTriggerComponent -} from './declarations'; +import { HelpComponent, SqxFrameworkModule, SqxSharedModule } from '@app/shared'; +import { AssetChangedTriggerComponent, CommentTriggerComponent, ContentChangedTriggerComponent, GenericActionComponent, RuleComponent, RuleElementComponent, RuleEventBadgeClassPipe, RuleEventsPageComponent, RuleIconComponent, RulesPageComponent, RuleWizardComponent, SchemaChangedTriggerComponent, UsageTriggerComponent } from './declarations'; const routes: Routes = [ { diff --git a/frontend/app/features/rules/pages/events/rule-events-page.component.ts b/frontend/app/features/rules/pages/events/rule-events-page.component.ts index 9f482080d..e30b7685b 100644 --- a/frontend/app/features/rules/pages/events/rule-events-page.component.ts +++ b/frontend/app/features/rules/pages/events/rule-events-page.component.ts @@ -7,12 +7,7 @@ import { Component, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; - -import { - ResourceOwner, - RuleEventDto, - RuleEventsState -} from '@app/shared'; +import { ResourceOwner, RuleEventDto, RuleEventsState } from '@app/shared'; @Component({ selector: 'sqx-rule-events-page', diff --git a/frontend/app/features/rules/pages/rules/actions/generic-action.component.ts b/frontend/app/features/rules/pages/rules/actions/generic-action.component.ts index 70484d156..ec8fc4aa7 100644 --- a/frontend/app/features/rules/pages/rules/actions/generic-action.component.ts +++ b/frontend/app/features/rules/pages/rules/actions/generic-action.component.ts @@ -7,7 +7,6 @@ import { Component, Input, OnInit } from '@angular/core'; import { FormControl, FormGroup, Validators } from '@angular/forms'; - import { RuleElementDto } from '@app/shared'; @Component({ diff --git a/frontend/app/features/rules/pages/rules/rule-element.component.ts b/frontend/app/features/rules/pages/rules/rule-element.component.ts index 18da4f75e..21d190256 100644 --- a/frontend/app/features/rules/pages/rules/rule-element.component.ts +++ b/frontend/app/features/rules/pages/rules/rule-element.component.ts @@ -6,7 +6,6 @@ */ import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; - import { RuleElementDto } from '@app/shared'; @Component({ diff --git a/frontend/app/features/rules/pages/rules/rule-icon.component.ts b/frontend/app/features/rules/pages/rules/rule-icon.component.ts index ae5a09374..36e63bb6e 100644 --- a/frontend/app/features/rules/pages/rules/rule-icon.component.ts +++ b/frontend/app/features/rules/pages/rules/rule-icon.component.ts @@ -8,7 +8,6 @@ // tslint:disable: component-selector import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; - import { RuleElementDto } from '@app/shared'; @Component({ diff --git a/frontend/app/features/rules/pages/rules/rule-wizard.component.ts b/frontend/app/features/rules/pages/rules/rule-wizard.component.ts index 75070f7f7..138bd6826 100644 --- a/frontend/app/features/rules/pages/rules/rule-wizard.component.ts +++ b/frontend/app/features/rules/pages/rules/rule-wizard.component.ts @@ -7,15 +7,7 @@ import { AfterViewInit, Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { FormGroup } from '@angular/forms'; - -import { - Form, - RuleDto, - RuleElementDto, - RulesState, - SchemaDto, - TriggerType -} from '@app/shared'; +import { Form, RuleDto, RuleElementDto, RulesState, SchemaDto, TriggerType } from '@app/shared'; const MODE_WIZARD = 'Wizard'; const MODE_EDIT_TRIGGER = 'EditTrigger'; diff --git a/frontend/app/features/rules/pages/rules/rule.component.html b/frontend/app/features/rules/pages/rules/rule.component.html index 38fd856d3..5e39376f4 100644 --- a/frontend/app/features/rules/pages/rules/rule.component.html +++ b/frontend/app/features/rules/pages/rules/rule.component.html @@ -11,14 +11,28 @@ [disabled]="!rule.canUpdate"> -
- + + + +
diff --git a/frontend/app/features/rules/pages/rules/rule.component.ts b/frontend/app/features/rules/pages/rules/rule.component.ts index 320903968..b2643e341 100644 --- a/frontend/app/features/rules/pages/rules/rule.component.ts +++ b/frontend/app/features/rules/pages/rules/rule.component.ts @@ -8,18 +8,15 @@ // tslint:disable: component-selector import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; - -import { - ActionsDto, - RuleDto, - RulesState, - TriggersDto -} from '@app/shared'; +import { ActionsDto, fadeAnimation, ModalModel, RuleDto, RulesState, TriggersDto } from '@app/shared'; @Component({ selector: 'sqx-rule', styleUrls: ['./rule.component.scss'], templateUrl: './rule.component.html', + animations: [ + fadeAnimation + ], changeDetection: ChangeDetectionStrategy.OnPush }) export class RuleComponent { @@ -38,6 +35,8 @@ export class RuleComponent { @Input() public rule: RuleDto; + public dropdown = new ModalModel(); + public get isManual() { return this.rule.triggerType === 'Manual'; } @@ -51,6 +50,10 @@ export class RuleComponent { this.rulesState.delete(this.rule); } + public run() { + this.rulesState.run(this.rule); + } + public rename(name: string) { this.rulesState.rename(this.rule, name); } diff --git a/frontend/app/features/rules/pages/rules/rules-page.component.html b/frontend/app/features/rules/pages/rules/rules-page.component.html index ef97afaa6..50bef4b44 100644 --- a/frontend/app/features/rules/pages/rules/rules-page.component.html +++ b/frontend/app/features/rules/pages/rules/rules-page.component.html @@ -23,6 +23,16 @@ + +
+
+ Cancel +
+ + Rule '{{runningRule.name || 'Unnamed Rule'}}' is currently running. +
+
+
diff --git a/frontend/app/features/rules/pages/rules/rules-page.component.ts b/frontend/app/features/rules/pages/rules/rules-page.component.ts index 2f3f66e0d..d563a4d1c 100644 --- a/frontend/app/features/rules/pages/rules/rules-page.component.ts +++ b/frontend/app/features/rules/pages/rules/rules-page.component.ts @@ -6,16 +6,7 @@ */ import { Component, OnInit } from '@angular/core'; - -import { - ALL_TRIGGERS, - DialogModel, - RuleDto, - RuleElementDto, - RulesService, - RulesState, - SchemasState -} from '@app/shared'; +import { ALL_TRIGGERS, DialogModel, RuleDto, RuleElementDto, RulesService, RulesState, SchemasState } from '@app/shared'; @Component({ selector: 'sqx-rules-page', @@ -53,6 +44,10 @@ export class RulesPageComponent implements OnInit { this.rulesState.load(true); } + public cancelRun() { + this.rulesState.runCancel(); + } + public delete(rule: RuleDto) { this.rulesState.delete(rule); } diff --git a/frontend/app/features/rules/pages/rules/triggers/content-changed-trigger.component.ts b/frontend/app/features/rules/pages/rules/triggers/content-changed-trigger.component.ts index 4fbf7ba67..589c1595b 100644 --- a/frontend/app/features/rules/pages/rules/triggers/content-changed-trigger.component.ts +++ b/frontend/app/features/rules/pages/rules/triggers/content-changed-trigger.component.ts @@ -7,7 +7,6 @@ import { Component, Input, OnInit } from '@angular/core'; import { FormControl, FormGroup } from '@angular/forms'; - import { SchemaDto, Types } from '@app/shared'; export interface TriggerSchemaForm { diff --git a/frontend/app/features/rules/pages/rules/triggers/usage-trigger.component.ts b/frontend/app/features/rules/pages/rules/triggers/usage-trigger.component.ts index 6fa94dd64..b1ae1dc6b 100644 --- a/frontend/app/features/rules/pages/rules/triggers/usage-trigger.component.ts +++ b/frontend/app/features/rules/pages/rules/triggers/usage-trigger.component.ts @@ -7,7 +7,6 @@ import { Component, Input, OnInit } from '@angular/core'; import { FormControl, FormGroup, Validators } from '@angular/forms'; - import { ValidatorsEx } from '@app/shared'; @Component({ diff --git a/frontend/app/features/schemas/declarations.ts b/frontend/app/features/schemas/declarations.ts index 808e22af9..69818c416 100644 --- a/frontend/app/features/schemas/declarations.ts +++ b/frontend/app/features/schemas/declarations.ts @@ -5,12 +5,8 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -export * from './pages/schema/schema-page.component'; - export * from './pages/schema/common/schema-edit-form.component'; - export * from './pages/schema/export/schema-export-form.component'; - export * from './pages/schema/fields/field-wizard.component'; export * from './pages/schema/fields/field.component'; export * from './pages/schema/fields/forms/field-form-common.component'; @@ -37,13 +33,10 @@ export * from './pages/schema/fields/types/string-ui.component'; export * from './pages/schema/fields/types/string-validation.component'; export * from './pages/schema/fields/types/tags-ui.component'; export * from './pages/schema/fields/types/tags-validation.component'; - export * from './pages/schema/preview/schema-preview-urls-form.component'; - +export * from './pages/schema/schema-page.component'; export * from './pages/schema/scripts/schema-scripts-form.component'; - export * from './pages/schema/ui/field-list.component'; export * from './pages/schema/ui/schema-ui-form.component'; - export * from './pages/schemas/schema-form.component'; export * from './pages/schemas/schemas-page.component'; \ No newline at end of file diff --git a/frontend/app/features/schemas/index.ts b/frontend/app/features/schemas/index.ts index d34c6d2ae..da0f82225 100644 --- a/frontend/app/features/schemas/index.ts +++ b/frontend/app/features/schemas/index.ts @@ -6,4 +6,4 @@ */ export * from './declarations'; -export * from './module'; \ No newline at end of file +export * from './module'; diff --git a/frontend/app/features/schemas/module.ts b/frontend/app/features/schemas/module.ts index 9bd44f027..8b49ddbc9 100644 --- a/frontend/app/features/schemas/module.ts +++ b/frontend/app/features/schemas/module.ts @@ -5,53 +5,12 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +// tslint:disable: max-line-length + import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; - -import { - HelpComponent, - SchemaMustExistGuard, - SqxFrameworkModule, - SqxSharedModule -} from '@app/shared'; - -import { - ArrayValidationComponent, - AssetsUIComponent, - AssetsValidationComponent, - BooleanUIComponent, - BooleanValidationComponent, - DateTimeUIComponent, - DateTimeValidationComponent, - FieldComponent, - FieldFormCommonComponent, - FieldFormComponent, - FieldFormUIComponent, - FieldFormValidationComponent, - FieldListComponent, - FieldWizardComponent, - GeolocationUIComponent, - GeolocationValidationComponent, - JsonUIComponent, - JsonValidationComponent, - NumberUIComponent, - NumberValidationComponent, - ReferencesUIComponent, - ReferencesValidationComponent, - SchemaEditFormComponent, - SchemaExportFormComponent, - SchemaFieldsComponent, - SchemaFormComponent, - SchemaPageComponent, - SchemaPreviewUrlsFormComponent, - SchemaScriptsFormComponent, - SchemasPageComponent, - SchemaUIFormComponent, - StringUIComponent, - StringValidationComponent, - TagsUIComponent, - TagsValidationComponent -} from './declarations'; +import { HelpComponent, SchemaMustExistGuard, SqxFrameworkModule, SqxSharedModule } from '@app/shared'; +import { ArrayValidationComponent, AssetsUIComponent, AssetsValidationComponent, BooleanUIComponent, BooleanValidationComponent, DateTimeUIComponent, DateTimeValidationComponent, FieldComponent, FieldFormCommonComponent, FieldFormComponent, FieldFormUIComponent, FieldFormValidationComponent, FieldListComponent, FieldWizardComponent, GeolocationUIComponent, GeolocationValidationComponent, JsonUIComponent, JsonValidationComponent, NumberUIComponent, NumberValidationComponent, ReferencesUIComponent, ReferencesValidationComponent, SchemaEditFormComponent, SchemaExportFormComponent, SchemaFieldsComponent, SchemaFormComponent, SchemaPageComponent, SchemaPreviewUrlsFormComponent, SchemaScriptsFormComponent, SchemasPageComponent, SchemaUIFormComponent, StringUIComponent, StringValidationComponent, TagsUIComponent, TagsValidationComponent } from './declarations'; const routes: Routes = [ { diff --git a/frontend/app/features/schemas/pages/schema/common/schema-edit-form.component.ts b/frontend/app/features/schemas/pages/schema/common/schema-edit-form.component.ts index ccc511566..6f7b556fe 100644 --- a/frontend/app/features/schemas/pages/schema/common/schema-edit-form.component.ts +++ b/frontend/app/features/schemas/pages/schema/common/schema-edit-form.component.ts @@ -7,12 +7,7 @@ import { Component, Input, OnChanges } from '@angular/core'; import { FormBuilder } from '@angular/forms'; - -import { - EditSchemaForm, - SchemaDetailsDto, - SchemasState -} from '@app/shared'; +import { EditSchemaForm, SchemaDetailsDto, SchemasState } from '@app/shared'; @Component({ selector: 'sqx-schema-edit-form', diff --git a/frontend/app/features/schemas/pages/schema/export/schema-export-form.component.ts b/frontend/app/features/schemas/pages/schema/export/schema-export-form.component.ts index 730a46867..fbc6f98ba 100644 --- a/frontend/app/features/schemas/pages/schema/export/schema-export-form.component.ts +++ b/frontend/app/features/schemas/pages/schema/export/schema-export-form.component.ts @@ -7,12 +7,7 @@ import { Component, Input, OnChanges } from '@angular/core'; import { FormBuilder } from '@angular/forms'; - -import { - SchemaDetailsDto, - SchemasState, - SynchronizeSchemaForm -} from '@app/shared'; +import { SchemaDetailsDto, SchemasState, SynchronizeSchemaForm } from '@app/shared'; @Component({ selector: 'sqx-schema-export-form', diff --git a/frontend/app/features/schemas/pages/schema/fields/field-wizard.component.ts b/frontend/app/features/schemas/pages/schema/fields/field-wizard.component.ts index c3f57e844..f5a525696 100644 --- a/frontend/app/features/schemas/pages/schema/fields/field-wizard.component.ts +++ b/frontend/app/features/schemas/pages/schema/fields/field-wizard.component.ts @@ -7,19 +7,7 @@ import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core'; import { FormBuilder } from '@angular/forms'; - -import { - AddFieldForm, - createProperties, - EditFieldForm, - FieldDto, - fieldTypes, - PatternsState, - RootFieldDto, - SchemaDetailsDto, - SchemasState, - Types -} from '@app/shared'; +import { AddFieldForm, createProperties, EditFieldForm, FieldDto, fieldTypes, PatternsState, RootFieldDto, SchemaDetailsDto, SchemasState, Types } from '@app/shared'; const DEFAULT_FIELD = { name: '', partitioning: 'invariant', properties: createProperties('String') }; diff --git a/frontend/app/features/schemas/pages/schema/fields/field.component.ts b/frontend/app/features/schemas/pages/schema/fields/field.component.ts index ee8d24b71..964cddc6c 100644 --- a/frontend/app/features/schemas/pages/schema/fields/field.component.ts +++ b/frontend/app/features/schemas/pages/schema/fields/field.component.ts @@ -8,20 +8,7 @@ import { CdkDragDrop } from '@angular/cdk/drag-drop'; import { Component, Input, OnChanges, SimpleChanges } from '@angular/core'; import { FormBuilder } from '@angular/forms'; - -import { - createProperties, - DialogModel, - EditFieldForm, - fadeAnimation, - ModalModel, - NestedFieldDto, - PatternDto, - RootFieldDto, - SchemaDetailsDto, - SchemasState, - sorted -} from '@app/shared'; +import { createProperties, DialogModel, EditFieldForm, fadeAnimation, ModalModel, NestedFieldDto, PatternDto, RootFieldDto, SchemaDetailsDto, SchemasState, sorted } from '@app/shared'; @Component({ selector: 'sqx-field', diff --git a/frontend/app/features/schemas/pages/schema/fields/forms/field-form-common.component.ts b/frontend/app/features/schemas/pages/schema/fields/forms/field-form-common.component.ts index dbf44ac44..bb7b649ad 100644 --- a/frontend/app/features/schemas/pages/schema/fields/forms/field-form-common.component.ts +++ b/frontend/app/features/schemas/pages/schema/fields/forms/field-form-common.component.ts @@ -7,7 +7,6 @@ import { Component, Input } from '@angular/core'; import { FormGroup } from '@angular/forms'; - import { FieldDto } from '@app/shared'; @Component({ diff --git a/frontend/app/features/schemas/pages/schema/fields/forms/field-form-ui.component.ts b/frontend/app/features/schemas/pages/schema/fields/forms/field-form-ui.component.ts index e5134c0bf..45044b6ea 100644 --- a/frontend/app/features/schemas/pages/schema/fields/forms/field-form-ui.component.ts +++ b/frontend/app/features/schemas/pages/schema/fields/forms/field-form-ui.component.ts @@ -7,7 +7,6 @@ import { Component, Input } from '@angular/core'; import { FormGroup } from '@angular/forms'; - import { FieldDto } from '@app/shared'; @Component({ diff --git a/frontend/app/features/schemas/pages/schema/fields/forms/field-form-validation.component.ts b/frontend/app/features/schemas/pages/schema/fields/forms/field-form-validation.component.ts index 0bdc39371..073be28ed 100644 --- a/frontend/app/features/schemas/pages/schema/fields/forms/field-form-validation.component.ts +++ b/frontend/app/features/schemas/pages/schema/fields/forms/field-form-validation.component.ts @@ -7,7 +7,6 @@ import { Component, Input } from '@angular/core'; import { FormGroup } from '@angular/forms'; - import { FieldDto, PatternDto } from '@app/shared'; @Component({ diff --git a/frontend/app/features/schemas/pages/schema/fields/forms/field-form.component.ts b/frontend/app/features/schemas/pages/schema/fields/forms/field-form.component.ts index de35bbdec..f9e109f01 100644 --- a/frontend/app/features/schemas/pages/schema/fields/forms/field-form.component.ts +++ b/frontend/app/features/schemas/pages/schema/fields/forms/field-form.component.ts @@ -7,7 +7,6 @@ import { AfterViewInit, Component, EventEmitter, Input, Output } from '@angular/core'; import { FormGroup } from '@angular/forms'; - import { FieldDto, PatternDto } from '@app/shared'; @Component({ diff --git a/frontend/app/features/schemas/pages/schema/fields/schema-fields.component.ts b/frontend/app/features/schemas/pages/schema/fields/schema-fields.component.ts index 74e6703da..3866ada01 100644 --- a/frontend/app/features/schemas/pages/schema/fields/schema-fields.component.ts +++ b/frontend/app/features/schemas/pages/schema/fields/schema-fields.component.ts @@ -7,16 +7,7 @@ import { CdkDragDrop } from '@angular/cdk/drag-drop'; import { Component, Input, OnInit } from '@angular/core'; - -import { - DialogModel, - FieldDto, - fieldTypes, - PatternsState, - SchemaDetailsDto, - SchemasState, - sorted -} from '@app/shared'; +import { DialogModel, FieldDto, fieldTypes, PatternsState, SchemaDetailsDto, SchemasState, sorted } from '@app/shared'; @Component({ selector: 'sqx-schema-fields', diff --git a/frontend/app/features/schemas/pages/schema/fields/types/array-validation.component.ts b/frontend/app/features/schemas/pages/schema/fields/types/array-validation.component.ts index 92f343e10..714e04a67 100644 --- a/frontend/app/features/schemas/pages/schema/fields/types/array-validation.component.ts +++ b/frontend/app/features/schemas/pages/schema/fields/types/array-validation.component.ts @@ -7,12 +7,7 @@ import { Component, Input, OnInit } from '@angular/core'; import { FormControl, FormGroup } from '@angular/forms'; - -import { - ArrayFieldPropertiesDto, - FieldDto, - SchemaTagSource -} from '@app/shared'; +import { ArrayFieldPropertiesDto, FieldDto, SchemaTagSource } from '@app/shared'; @Component({ selector: 'sqx-array-validation', diff --git a/frontend/app/features/schemas/pages/schema/fields/types/assets-ui.component.ts b/frontend/app/features/schemas/pages/schema/fields/types/assets-ui.component.ts index 2eb1db758..685daf2f8 100644 --- a/frontend/app/features/schemas/pages/schema/fields/types/assets-ui.component.ts +++ b/frontend/app/features/schemas/pages/schema/fields/types/assets-ui.component.ts @@ -7,7 +7,6 @@ import { Component, Input, OnInit } from '@angular/core'; import { FormControl, FormGroup } from '@angular/forms'; - import { AssetsFieldPropertiesDto, FieldDto } from '@app/shared'; @Component({ diff --git a/frontend/app/features/schemas/pages/schema/fields/types/assets-validation.component.ts b/frontend/app/features/schemas/pages/schema/fields/types/assets-validation.component.ts index 811ce0351..d5889a051 100644 --- a/frontend/app/features/schemas/pages/schema/fields/types/assets-validation.component.ts +++ b/frontend/app/features/schemas/pages/schema/fields/types/assets-validation.component.ts @@ -7,7 +7,6 @@ import { Component, Input, OnInit } from '@angular/core'; import { FormControl, FormGroup } from '@angular/forms'; - import { AssetsFieldPropertiesDto, FieldDto } from '@app/shared'; @Component({ diff --git a/frontend/app/features/schemas/pages/schema/fields/types/boolean-ui.component.ts b/frontend/app/features/schemas/pages/schema/fields/types/boolean-ui.component.ts index 130698031..838a76b67 100644 --- a/frontend/app/features/schemas/pages/schema/fields/types/boolean-ui.component.ts +++ b/frontend/app/features/schemas/pages/schema/fields/types/boolean-ui.component.ts @@ -7,7 +7,6 @@ import { Component, Input, OnInit } from '@angular/core'; import { FormControl, FormGroup, Validators } from '@angular/forms'; - import { BooleanFieldPropertiesDto, FieldDto } from '@app/shared'; @Component({ diff --git a/frontend/app/features/schemas/pages/schema/fields/types/boolean-validation.component.ts b/frontend/app/features/schemas/pages/schema/fields/types/boolean-validation.component.ts index 0a5f6d787..f96432de2 100644 --- a/frontend/app/features/schemas/pages/schema/fields/types/boolean-validation.component.ts +++ b/frontend/app/features/schemas/pages/schema/fields/types/boolean-validation.component.ts @@ -7,14 +7,9 @@ import { Component, Input, OnInit } from '@angular/core'; import { FormControl, FormGroup } from '@angular/forms'; +import { BooleanFieldPropertiesDto, FieldDto, hasNoValue$ } from '@app/shared'; import { Observable } from 'rxjs'; -import { - BooleanFieldPropertiesDto, - FieldDto, - hasNoValue$ -} from '@app/shared'; - @Component({ selector: 'sqx-boolean-validation', styleUrls: ['boolean-validation.component.scss'], diff --git a/frontend/app/features/schemas/pages/schema/fields/types/date-time-ui.component.ts b/frontend/app/features/schemas/pages/schema/fields/types/date-time-ui.component.ts index b145acbed..9931a5a52 100644 --- a/frontend/app/features/schemas/pages/schema/fields/types/date-time-ui.component.ts +++ b/frontend/app/features/schemas/pages/schema/fields/types/date-time-ui.component.ts @@ -7,9 +7,8 @@ import { Component, Input, OnInit } from '@angular/core'; import { FormControl, FormGroup, Validators } from '@angular/forms'; -import { Observable } from 'rxjs'; - import { FieldDto, FloatConverter, NumberFieldPropertiesDto } from '@app/shared'; +import { Observable } from 'rxjs'; @Component({ selector: 'sqx-date-time-ui', diff --git a/frontend/app/features/schemas/pages/schema/fields/types/date-time-validation.component.ts b/frontend/app/features/schemas/pages/schema/fields/types/date-time-validation.component.ts index 381284eb5..87f7fd0fe 100644 --- a/frontend/app/features/schemas/pages/schema/fields/types/date-time-validation.component.ts +++ b/frontend/app/features/schemas/pages/schema/fields/types/date-time-validation.component.ts @@ -7,15 +7,9 @@ import { Component, Input, OnInit } from '@angular/core'; import { FormControl, FormGroup } from '@angular/forms'; +import { DateTimeFieldPropertiesDto, FieldDto, hasNoValue$, ValidatorsEx } from '@app/shared'; import { Observable } from 'rxjs'; -import { - DateTimeFieldPropertiesDto, - FieldDto, - hasNoValue$, - ValidatorsEx -} from '@app/shared'; - @Component({ selector: 'sqx-date-time-validation', styleUrls: ['date-time-validation.component.scss'], diff --git a/frontend/app/features/schemas/pages/schema/fields/types/geolocation-ui.component.ts b/frontend/app/features/schemas/pages/schema/fields/types/geolocation-ui.component.ts index d6cc501c0..2ff302b61 100644 --- a/frontend/app/features/schemas/pages/schema/fields/types/geolocation-ui.component.ts +++ b/frontend/app/features/schemas/pages/schema/fields/types/geolocation-ui.component.ts @@ -7,7 +7,6 @@ import { Component, Input, OnInit } from '@angular/core'; import { FormControl, FormGroup, Validators } from '@angular/forms'; - import { FieldDto, GeolocationFieldPropertiesDto } from '@app/shared'; @Component({ diff --git a/frontend/app/features/schemas/pages/schema/fields/types/geolocation-validation.component.ts b/frontend/app/features/schemas/pages/schema/fields/types/geolocation-validation.component.ts index 4712b26a3..78fbf4e23 100644 --- a/frontend/app/features/schemas/pages/schema/fields/types/geolocation-validation.component.ts +++ b/frontend/app/features/schemas/pages/schema/fields/types/geolocation-validation.component.ts @@ -7,7 +7,6 @@ import { Component, Input } from '@angular/core'; import { FormGroup } from '@angular/forms'; - import { FieldDto, GeolocationFieldPropertiesDto } from '@app/shared'; @Component({ diff --git a/frontend/app/features/schemas/pages/schema/fields/types/json-ui.component.ts b/frontend/app/features/schemas/pages/schema/fields/types/json-ui.component.ts index ab3619ec4..ce1901f90 100644 --- a/frontend/app/features/schemas/pages/schema/fields/types/json-ui.component.ts +++ b/frontend/app/features/schemas/pages/schema/fields/types/json-ui.component.ts @@ -7,7 +7,6 @@ import { Component, Input } from '@angular/core'; import { FormGroup } from '@angular/forms'; - import { FieldDto, JsonFieldPropertiesDto } from '@app/shared'; @Component({ diff --git a/frontend/app/features/schemas/pages/schema/fields/types/json-validation.component.ts b/frontend/app/features/schemas/pages/schema/fields/types/json-validation.component.ts index bbca1fd48..d25b609ba 100644 --- a/frontend/app/features/schemas/pages/schema/fields/types/json-validation.component.ts +++ b/frontend/app/features/schemas/pages/schema/fields/types/json-validation.component.ts @@ -7,7 +7,6 @@ import { Component, Input } from '@angular/core'; import { FormGroup } from '@angular/forms'; - import { FieldDto, JsonFieldPropertiesDto } from '@app/shared'; @Component({ diff --git a/frontend/app/features/schemas/pages/schema/fields/types/number-ui.component.ts b/frontend/app/features/schemas/pages/schema/fields/types/number-ui.component.ts index 3a7535919..e3844d814 100644 --- a/frontend/app/features/schemas/pages/schema/fields/types/number-ui.component.ts +++ b/frontend/app/features/schemas/pages/schema/fields/types/number-ui.component.ts @@ -7,17 +7,10 @@ import { Component, Input, OnInit } from '@angular/core'; import { FormControl, FormGroup, Validators } from '@angular/forms'; +import { FieldDto, FloatConverter, NumberFieldPropertiesDto, ResourceOwner, value$ } from '@app/shared'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { - FieldDto, - FloatConverter, - NumberFieldPropertiesDto, - ResourceOwner, - value$ -} from '@app/shared'; - @Component({ selector: 'sqx-number-ui', styleUrls: ['number-ui.component.scss'], diff --git a/frontend/app/features/schemas/pages/schema/fields/types/number-validation.component.ts b/frontend/app/features/schemas/pages/schema/fields/types/number-validation.component.ts index 082aed6f4..694b7f35a 100644 --- a/frontend/app/features/schemas/pages/schema/fields/types/number-validation.component.ts +++ b/frontend/app/features/schemas/pages/schema/fields/types/number-validation.component.ts @@ -7,16 +7,9 @@ import { Component, Input, OnInit } from '@angular/core'; import { FormControl, FormGroup } from '@angular/forms'; +import { FieldDto, hasNoValue$, NumberFieldPropertiesDto, RootFieldDto, Types } from '@app/shared'; import { Observable } from 'rxjs'; -import { - FieldDto, - hasNoValue$, - NumberFieldPropertiesDto, - RootFieldDto, - Types -} from '@app/shared'; - @Component({ selector: 'sqx-number-validation', styleUrls: ['number-validation.component.scss'], diff --git a/frontend/app/features/schemas/pages/schema/fields/types/references-ui.component.ts b/frontend/app/features/schemas/pages/schema/fields/types/references-ui.component.ts index 775dd7ea1..f33e119eb 100644 --- a/frontend/app/features/schemas/pages/schema/fields/types/references-ui.component.ts +++ b/frontend/app/features/schemas/pages/schema/fields/types/references-ui.component.ts @@ -7,7 +7,6 @@ import { Component, Input, OnInit } from '@angular/core'; import { FormControl, FormGroup, Validators } from '@angular/forms'; - import { FieldDto, ReferencesFieldPropertiesDto } from '@app/shared'; @Component({ diff --git a/frontend/app/features/schemas/pages/schema/fields/types/references-validation.component.ts b/frontend/app/features/schemas/pages/schema/fields/types/references-validation.component.ts index bafbaf5bb..f88d71801 100644 --- a/frontend/app/features/schemas/pages/schema/fields/types/references-validation.component.ts +++ b/frontend/app/features/schemas/pages/schema/fields/types/references-validation.component.ts @@ -7,12 +7,7 @@ import { Component, Input, OnInit } from '@angular/core'; import { FormControl, FormGroup } from '@angular/forms'; - -import { - FieldDto, - ReferencesFieldPropertiesDto, - SchemaTagSource -} from '@app/shared'; +import { FieldDto, ReferencesFieldPropertiesDto, SchemaTagSource } from '@app/shared'; @Component({ selector: 'sqx-references-validation', diff --git a/frontend/app/features/schemas/pages/schema/fields/types/string-ui.component.ts b/frontend/app/features/schemas/pages/schema/fields/types/string-ui.component.ts index b2af7c388..e143b47ac 100644 --- a/frontend/app/features/schemas/pages/schema/fields/types/string-ui.component.ts +++ b/frontend/app/features/schemas/pages/schema/fields/types/string-ui.component.ts @@ -7,16 +7,10 @@ import { Component, Input, OnInit } from '@angular/core'; import { FormControl, FormGroup, Validators } from '@angular/forms'; +import { FieldDto, ResourceOwner, StringFieldPropertiesDto, value$ } from '@app/shared'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { - FieldDto, - ResourceOwner, - StringFieldPropertiesDto, - value$ -} from '@app/shared'; - @Component({ selector: 'sqx-string-ui', styleUrls: ['string-ui.component.scss'], diff --git a/frontend/app/features/schemas/pages/schema/fields/types/string-validation.component.ts b/frontend/app/features/schemas/pages/schema/fields/types/string-validation.component.ts index 0d2758b5c..98ecdbf54 100644 --- a/frontend/app/features/schemas/pages/schema/fields/types/string-validation.component.ts +++ b/frontend/app/features/schemas/pages/schema/fields/types/string-validation.component.ts @@ -7,22 +7,9 @@ import { Component, Input, OnChanges, OnInit } from '@angular/core'; import { FormControl, FormGroup } from '@angular/forms'; +import { fadeAnimation, FieldDto, hasNoValue$, hasValue$, ModalModel, PatternDto, ResourceOwner, RootFieldDto, StringFieldPropertiesDto, Types, value$ } from '@app/shared'; import { Observable } from 'rxjs'; -import { - fadeAnimation, - FieldDto, - hasNoValue$, - hasValue$, - ModalModel, - PatternDto, - ResourceOwner, - RootFieldDto, - StringFieldPropertiesDto, - Types, - value$ -} from '@app/shared'; - @Component({ selector: 'sqx-string-validation', styleUrls: ['string-validation.component.scss'], diff --git a/frontend/app/features/schemas/pages/schema/fields/types/tags-ui.component.ts b/frontend/app/features/schemas/pages/schema/fields/types/tags-ui.component.ts index 260698455..a2358c4e8 100644 --- a/frontend/app/features/schemas/pages/schema/fields/types/tags-ui.component.ts +++ b/frontend/app/features/schemas/pages/schema/fields/types/tags-ui.component.ts @@ -7,7 +7,6 @@ import { Component, Input, OnInit } from '@angular/core'; import { FormControl, FormGroup, Validators } from '@angular/forms'; - import { FieldDto, TagsFieldPropertiesDto } from '@app/shared'; @Component({ diff --git a/frontend/app/features/schemas/pages/schema/fields/types/tags-validation.component.ts b/frontend/app/features/schemas/pages/schema/fields/types/tags-validation.component.ts index 89bd67fb7..8fc19f5eb 100644 --- a/frontend/app/features/schemas/pages/schema/fields/types/tags-validation.component.ts +++ b/frontend/app/features/schemas/pages/schema/fields/types/tags-validation.component.ts @@ -7,7 +7,6 @@ import { Component, Input, OnInit } from '@angular/core'; import { FormControl, FormGroup } from '@angular/forms'; - import { FieldDto, TagsFieldPropertiesDto } from '@app/shared'; @Component({ diff --git a/frontend/app/features/schemas/pages/schema/preview/schema-preview-urls-form.component.ts b/frontend/app/features/schemas/pages/schema/preview/schema-preview-urls-form.component.ts index 2f9f75200..089254dba 100644 --- a/frontend/app/features/schemas/pages/schema/preview/schema-preview-urls-form.component.ts +++ b/frontend/app/features/schemas/pages/schema/preview/schema-preview-urls-form.component.ts @@ -7,13 +7,7 @@ import { Component, Input, OnChanges } from '@angular/core'; import { FormBuilder } from '@angular/forms'; - -import { - AddPreviewUrlForm, - ConfigurePreviewUrlsForm, - SchemaDetailsDto, - SchemasState -} from '@app/shared'; +import { AddPreviewUrlForm, ConfigurePreviewUrlsForm, SchemaDetailsDto, SchemasState } from '@app/shared'; @Component({ selector: 'sqx-schema-preview-urls-form', diff --git a/frontend/app/features/schemas/pages/schema/schema-page.component.ts b/frontend/app/features/schemas/pages/schema/schema-page.component.ts index 3ad257bf1..67655228e 100644 --- a/frontend/app/features/schemas/pages/schema/schema-page.component.ts +++ b/frontend/app/features/schemas/pages/schema/schema-page.component.ts @@ -7,19 +7,8 @@ import { Component, OnInit } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; - -import { - fadeAnimation, - MessageBus, - ModalModel, - ResourceOwner, - SchemaDetailsDto, - SchemasState -} from '@app/shared'; - -import { - SchemaCloning -} from './../messages'; +import { fadeAnimation, MessageBus, ModalModel, ResourceOwner, SchemaDetailsDto, SchemasState } from '@app/shared'; +import { SchemaCloning } from './../messages'; @Component({ selector: 'sqx-schema-page', diff --git a/frontend/app/features/schemas/pages/schema/scripts/schema-scripts-form.component.ts b/frontend/app/features/schemas/pages/schema/scripts/schema-scripts-form.component.ts index 2e438cf5e..b0c0a014c 100644 --- a/frontend/app/features/schemas/pages/schema/scripts/schema-scripts-form.component.ts +++ b/frontend/app/features/schemas/pages/schema/scripts/schema-scripts-form.component.ts @@ -7,12 +7,7 @@ import { Component, Input, OnChanges } from '@angular/core'; import { FormBuilder } from '@angular/forms'; - -import { - EditScriptsForm, - SchemaDetailsDto, - SchemasState -} from '@app/shared'; +import { EditScriptsForm, SchemaDetailsDto, SchemasState } from '@app/shared'; @Component({ selector: 'sqx-schema-scripts-form', diff --git a/frontend/app/features/schemas/pages/schema/ui/field-list.component.ts b/frontend/app/features/schemas/pages/schema/ui/field-list.component.ts index 7ac410342..687776a36 100644 --- a/frontend/app/features/schemas/pages/schema/ui/field-list.component.ts +++ b/frontend/app/features/schemas/pages/schema/ui/field-list.component.ts @@ -9,7 +9,6 @@ import { CdkDragDrop, moveItemInArray, transferArrayItem } from '@angular/cdk/drag-drop'; import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, Output } from '@angular/core'; - import { MetaFields, SchemaDetailsDto } from '@app/shared'; const META_FIELD_NAMES = Object.values(MetaFields); diff --git a/frontend/app/features/schemas/pages/schema/ui/schema-ui-form.component.ts b/frontend/app/features/schemas/pages/schema/ui/schema-ui-form.component.ts index 48b5afcec..fada14647 100644 --- a/frontend/app/features/schemas/pages/schema/ui/schema-ui-form.component.ts +++ b/frontend/app/features/schemas/pages/schema/ui/schema-ui-form.component.ts @@ -6,7 +6,6 @@ */ import { Component, Input, OnChanges } from '@angular/core'; - import { SchemaDetailsDto, SchemasState } from '@app/shared'; type State = { fieldsInLists: ReadonlyArray, fieldsInReferences: ReadonlyArray }; diff --git a/frontend/app/features/schemas/pages/schemas/schema-form.component.ts b/frontend/app/features/schemas/pages/schemas/schema-form.component.ts index 5fab111e5..70edb0fed 100644 --- a/frontend/app/features/schemas/pages/schemas/schema-form.component.ts +++ b/frontend/app/features/schemas/pages/schemas/schema-form.component.ts @@ -7,14 +7,7 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { FormBuilder } from '@angular/forms'; - -import { - ApiUrlConfig, - AppsState, - CreateSchemaForm, - SchemaDto, - SchemasState -} from '@app/shared'; +import { ApiUrlConfig, AppsState, CreateSchemaForm, SchemaDto, SchemasState } from '@app/shared'; @Component({ selector: 'sqx-schema-form', diff --git a/frontend/app/features/schemas/pages/schemas/schemas-page.component.ts b/frontend/app/features/schemas/pages/schemas/schemas-page.component.ts index a0425dacc..5624b2536 100644 --- a/frontend/app/features/schemas/pages/schemas/schemas-page.component.ts +++ b/frontend/app/features/schemas/pages/schemas/schemas-page.component.ts @@ -8,18 +8,8 @@ import { Component, OnInit } from '@angular/core'; import { FormBuilder, FormControl } from '@angular/forms'; import { ActivatedRoute, Router } from '@angular/router'; +import { CreateCategoryForm, DialogModel, MessageBus, ResourceOwner, SchemaCategory, SchemaDto, SchemasState } from '@app/shared'; import { map } from 'rxjs/operators'; - -import { - CreateCategoryForm, - DialogModel, - MessageBus, - ResourceOwner, - SchemaCategory, - SchemaDto, - SchemasState -} from '@app/shared'; - import { SchemaCloning } from './../messages'; @Component({ diff --git a/frontend/app/features/settings/declarations.ts b/frontend/app/features/settings/declarations.ts index e0c7dfdee..039727896 100644 --- a/frontend/app/features/settings/declarations.ts +++ b/frontend/app/features/settings/declarations.ts @@ -31,5 +31,4 @@ export * from './pages/workflows/workflow-step.component'; export * from './pages/workflows/workflow-transition.component'; export * from './pages/workflows/workflow.component'; export * from './pages/workflows/workflows-page.component'; - export * from './settings-area.component'; \ No newline at end of file diff --git a/frontend/app/features/settings/index.ts b/frontend/app/features/settings/index.ts index d34c6d2ae..da0f82225 100644 --- a/frontend/app/features/settings/index.ts +++ b/frontend/app/features/settings/index.ts @@ -6,4 +6,4 @@ */ export * from './declarations'; -export * from './module'; \ No newline at end of file +export * from './module'; diff --git a/frontend/app/features/settings/module.ts b/frontend/app/features/settings/module.ts index 1bf8ccae0..436bd3183 100644 --- a/frontend/app/features/settings/module.ts +++ b/frontend/app/features/settings/module.ts @@ -5,45 +5,12 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +// tslint:disable: max-line-length + import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; - -import { - HelpComponent, - HistoryComponent, - SqxFrameworkModule, - SqxSharedModule -} from '@app/shared'; - -import { - BackupComponent, - BackupsPageComponent, - ClientAddFormComponent, - ClientComponent, - ClientConnectFormComponent, - ClientsPageComponent, - ContributorAddFormComponent, - ContributorComponent, - ContributorsPageComponent, - ImportContributorsDialogComponent, - LanguageAddFormComponent, - LanguageComponent, - LanguagesPageComponent, - MorePageComponent, - PatternComponent, - PatternsPageComponent, - PlanComponent, - PlansPageComponent, - RoleAddFormComponent, - RoleComponent, - RolesPageComponent, - SettingsAreaComponent, - WorkflowAddFormComponent, - WorkflowComponent, - WorkflowsPageComponent, - WorkflowStepComponent, - WorkflowTransitionComponent -} from './declarations'; +import { HelpComponent, HistoryComponent, SqxFrameworkModule, SqxSharedModule } from '@app/shared'; +import { BackupComponent, BackupsPageComponent, ClientAddFormComponent, ClientComponent, ClientConnectFormComponent, ClientsPageComponent, ContributorAddFormComponent, ContributorComponent, ContributorsPageComponent, ImportContributorsDialogComponent, LanguageAddFormComponent, LanguageComponent, LanguagesPageComponent, MorePageComponent, PatternComponent, PatternsPageComponent, PlanComponent, PlansPageComponent, RoleAddFormComponent, RoleComponent, RolesPageComponent, SettingsAreaComponent, WorkflowAddFormComponent, WorkflowComponent, WorkflowsPageComponent, WorkflowStepComponent, WorkflowTransitionComponent } from './declarations'; const routes: Routes = [ { diff --git a/frontend/app/features/settings/pages/backups/backup.component.ts b/frontend/app/features/settings/pages/backups/backup.component.ts index e1202c77b..1420e7c86 100644 --- a/frontend/app/features/settings/pages/backups/backup.component.ts +++ b/frontend/app/features/settings/pages/backups/backup.component.ts @@ -6,13 +6,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({ selector: 'sqx-backup', diff --git a/frontend/app/features/settings/pages/backups/backups-page.component.ts b/frontend/app/features/settings/pages/backups/backups-page.component.ts index 81c173e16..78a8a3995 100644 --- a/frontend/app/features/settings/pages/backups/backups-page.component.ts +++ b/frontend/app/features/settings/pages/backups/backups-page.component.ts @@ -6,16 +6,10 @@ */ import { Component, OnInit } from '@angular/core'; +import { ApiUrlConfig, BackupDto, BackupsState, ResourceOwner } from '@app/shared'; import { timer } from 'rxjs'; import { switchMap } from 'rxjs/operators'; -import { - ApiUrlConfig, - BackupDto, - BackupsState, - ResourceOwner -} from '@app/shared'; - @Component({ selector: 'sqx-backups-page', styleUrls: ['./backups-page.component.scss'], diff --git a/frontend/app/features/settings/pages/clients/client-add-form.component.ts b/frontend/app/features/settings/pages/clients/client-add-form.component.ts index 058ce5cad..d94f15985 100644 --- a/frontend/app/features/settings/pages/clients/client-add-form.component.ts +++ b/frontend/app/features/settings/pages/clients/client-add-form.component.ts @@ -7,7 +7,6 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; import { FormBuilder } from '@angular/forms'; - import { AddClientForm, ClientsState } from '@app/shared'; @Component({ diff --git a/frontend/app/features/settings/pages/clients/client-connect-form.component.ts b/frontend/app/features/settings/pages/clients/client-connect-form.component.ts index b42e0b412..8419d8dd2 100644 --- a/frontend/app/features/settings/pages/clients/client-connect-form.component.ts +++ b/frontend/app/features/settings/pages/clients/client-connect-form.component.ts @@ -6,16 +6,7 @@ */ import { ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; - -import { - AccessTokenDto, - ApiUrlConfig, - AppsState, - ClientDto, - ClientsService, - DialogService, - RoleDto -} from '@app/shared'; +import { AccessTokenDto, ApiUrlConfig, AppsState, ClientDto, ClientsService, DialogService, RoleDto } from '@app/shared'; @Component({ selector: 'sqx-client-connect-form', diff --git a/frontend/app/features/settings/pages/clients/client.component.ts b/frontend/app/features/settings/pages/clients/client.component.ts index fb7ca02bc..044dba6c6 100644 --- a/frontend/app/features/settings/pages/clients/client.component.ts +++ b/frontend/app/features/settings/pages/clients/client.component.ts @@ -6,14 +6,7 @@ */ import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; - -import { - AppsState, - ClientDto, - ClientsState, - DialogModel, - RoleDto -} from '@app/shared'; +import { AppsState, ClientDto, ClientsState, DialogModel, RoleDto } from '@app/shared'; @Component({ selector: 'sqx-client', diff --git a/frontend/app/features/settings/pages/clients/clients-page.component.ts b/frontend/app/features/settings/pages/clients/clients-page.component.ts index 23420c795..5811ead46 100644 --- a/frontend/app/features/settings/pages/clients/clients-page.component.ts +++ b/frontend/app/features/settings/pages/clients/clients-page.component.ts @@ -6,12 +6,7 @@ */ import { Component, OnInit } from '@angular/core'; - -import { - ClientDto, - ClientsState, - RolesState -} from '@app/shared'; +import { ClientDto, ClientsState, RolesState } from '@app/shared'; @Component({ selector: 'sqx-clients-page', diff --git a/frontend/app/features/settings/pages/contributors/contributor-add-form.component.ts b/frontend/app/features/settings/pages/contributors/contributor-add-form.component.ts index b4c94911e..4eac1ea83 100644 --- a/frontend/app/features/settings/pages/contributors/contributor-add-form.component.ts +++ b/frontend/app/features/settings/pages/contributors/contributor-add-form.component.ts @@ -7,19 +7,10 @@ import { Component, Injectable, Input, OnChanges } from '@angular/core'; import { FormBuilder } from '@angular/forms'; +import { AssignContributorForm, AutocompleteSource, ContributorsState, DialogModel, DialogService, RoleDto, UsersService } from '@app/shared'; import { Observable } from 'rxjs'; import { withLatestFrom } from 'rxjs/operators'; -import { - AssignContributorForm, - AutocompleteSource, - ContributorsState, - DialogModel, - DialogService, - RoleDto, - UsersService -} from '@app/shared'; - @Injectable() export class UsersDataSource implements AutocompleteSource { constructor( diff --git a/frontend/app/features/settings/pages/contributors/contributor.component.ts b/frontend/app/features/settings/pages/contributors/contributor.component.ts index 9d9ef23ac..0db2ef804 100644 --- a/frontend/app/features/settings/pages/contributors/contributor.component.ts +++ b/frontend/app/features/settings/pages/contributors/contributor.component.ts @@ -8,12 +8,7 @@ // tslint:disable: component-selector import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; - -import { - ContributorDto, - ContributorsState, - RoleDto -} from '@app/shared'; +import { ContributorDto, ContributorsState, RoleDto } from '@app/shared'; @Component({ selector: '[sqxContributor]', diff --git a/frontend/app/features/settings/pages/contributors/contributors-page.component.ts b/frontend/app/features/settings/pages/contributors/contributors-page.component.ts index 4d52d82cd..e395ad3b6 100644 --- a/frontend/app/features/settings/pages/contributors/contributors-page.component.ts +++ b/frontend/app/features/settings/pages/contributors/contributors-page.component.ts @@ -6,13 +6,7 @@ */ import { Component, OnInit } from '@angular/core'; - -import { - ContributorDto, - ContributorsState, - DialogModel, - RolesState -} from '@app/shared'; +import { ContributorDto, ContributorsState, DialogModel, RolesState } from '@app/shared'; @Component({ selector: 'sqx-contributors-page', diff --git a/frontend/app/features/settings/pages/contributors/import-contributors-dialog.component.ts b/frontend/app/features/settings/pages/contributors/import-contributors-dialog.component.ts index a61137211..56fce682f 100644 --- a/frontend/app/features/settings/pages/contributors/import-contributors-dialog.component.ts +++ b/frontend/app/features/settings/pages/contributors/import-contributors-dialog.component.ts @@ -7,16 +7,10 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'; import { FormBuilder } from '@angular/forms'; +import { ContributorsState, ErrorDto, ImportContributorsForm, RoleDto } from '@app/shared'; import { empty, of } from 'rxjs'; import { catchError, mergeMap, tap } from 'rxjs/operators'; -import { - ContributorsState, - ErrorDto, - ImportContributorsForm, - RoleDto -} from '@app/shared'; - type ImportStatus = { email: string; result: 'Pending' | 'Failed' | 'Success'; diff --git a/frontend/app/features/settings/pages/languages/language-add-form.component.ts b/frontend/app/features/settings/pages/languages/language-add-form.component.ts index c307bc348..c10062187 100644 --- a/frontend/app/features/settings/pages/languages/language-add-form.component.ts +++ b/frontend/app/features/settings/pages/languages/language-add-form.component.ts @@ -7,12 +7,7 @@ import { ChangeDetectionStrategy, Component, Input, OnChanges } from '@angular/core'; import { FormBuilder } from '@angular/forms'; - -import { - AddLanguageForm, - LanguageDto, - LanguagesState -} from '@app/shared'; +import { AddLanguageForm, LanguageDto, LanguagesState } from '@app/shared'; @Component({ selector: 'sqx-language-add-form', diff --git a/frontend/app/features/settings/pages/languages/language.component.ts b/frontend/app/features/settings/pages/languages/language.component.ts index 8d75e2541..977005018 100644 --- a/frontend/app/features/settings/pages/languages/language.component.ts +++ b/frontend/app/features/settings/pages/languages/language.component.ts @@ -8,14 +8,7 @@ import { CdkDragDrop } from '@angular/cdk/drag-drop'; import { Component, Input, OnChanges } from '@angular/core'; import { FormBuilder } from '@angular/forms'; - -import { - AppLanguageDto, - EditLanguageForm, - LanguageDto, - LanguagesState, - sorted -} from '@app/shared'; +import { AppLanguageDto, EditLanguageForm, LanguageDto, LanguagesState, sorted } from '@app/shared'; @Component({ selector: 'sqx-language', diff --git a/frontend/app/features/settings/pages/languages/languages-page.component.ts b/frontend/app/features/settings/pages/languages/languages-page.component.ts index 3b75d29fe..97a09f1d8 100644 --- a/frontend/app/features/settings/pages/languages/languages-page.component.ts +++ b/frontend/app/features/settings/pages/languages/languages-page.component.ts @@ -6,7 +6,6 @@ */ import { Component, OnInit } from '@angular/core'; - import { AppLanguageDto, LanguagesState } from '@app/shared'; @Component({ diff --git a/frontend/app/features/settings/pages/more/more-page.component.ts b/frontend/app/features/settings/pages/more/more-page.component.ts index 94c5e3347..b93a52023 100644 --- a/frontend/app/features/settings/pages/more/more-page.component.ts +++ b/frontend/app/features/settings/pages/more/more-page.component.ts @@ -8,14 +8,7 @@ import { Component, OnInit } from '@angular/core'; import { FormBuilder } from '@angular/forms'; import { Router } from '@angular/router'; - -import { - AppDto, - AppsState, - ResourceOwner, - Types, - UpdateAppForm -} from '@app/shared'; +import { AppDto, AppsState, ResourceOwner, Types, UpdateAppForm } from '@app/shared'; @Component({ selector: 'sqx-more-page', diff --git a/frontend/app/features/settings/pages/patterns/pattern.component.ts b/frontend/app/features/settings/pages/patterns/pattern.component.ts index 419726a72..082bd698a 100644 --- a/frontend/app/features/settings/pages/patterns/pattern.component.ts +++ b/frontend/app/features/settings/pages/patterns/pattern.component.ts @@ -7,12 +7,7 @@ import { ChangeDetectionStrategy, Component, Input, OnChanges, SimpleChanges } from '@angular/core'; import { FormBuilder } from '@angular/forms'; - -import { - EditPatternForm, - PatternDto, - PatternsState -} from '@app/shared'; +import { EditPatternForm, PatternDto, PatternsState } from '@app/shared'; @Component({ selector: 'sqx-pattern', diff --git a/frontend/app/features/settings/pages/patterns/patterns-page.component.ts b/frontend/app/features/settings/pages/patterns/patterns-page.component.ts index fef441487..334566191 100644 --- a/frontend/app/features/settings/pages/patterns/patterns-page.component.ts +++ b/frontend/app/features/settings/pages/patterns/patterns-page.component.ts @@ -6,11 +6,7 @@ */ import { Component, OnInit } from '@angular/core'; - -import { - PatternDto, - PatternsState -} from '@app/shared'; +import { PatternDto, PatternsState } from '@app/shared'; @Component({ selector: 'sqx-patterns-page', diff --git a/frontend/app/features/settings/pages/plans/plan.component.ts b/frontend/app/features/settings/pages/plans/plan.component.ts index be39a7599..a28f65a13 100644 --- a/frontend/app/features/settings/pages/plans/plan.component.ts +++ b/frontend/app/features/settings/pages/plans/plan.component.ts @@ -6,7 +6,6 @@ */ import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; - import { PlanInfo, PlansState } from '@app/shared'; @Component({ diff --git a/frontend/app/features/settings/pages/plans/plans-page.component.ts b/frontend/app/features/settings/pages/plans/plans-page.component.ts index 35a642df6..211e39539 100644 --- a/frontend/app/features/settings/pages/plans/plans-page.component.ts +++ b/frontend/app/features/settings/pages/plans/plans-page.component.ts @@ -7,12 +7,7 @@ import { Component, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; - -import { - ApiUrlConfig, - PlanDto, - PlansState -} from '@app/shared'; +import { ApiUrlConfig, PlanDto, PlansState } from '@app/shared'; @Component({ selector: 'sqx-plans-page', diff --git a/frontend/app/features/settings/pages/roles/role-add-form.component.ts b/frontend/app/features/settings/pages/roles/role-add-form.component.ts index fc77d5f22..245e39603 100644 --- a/frontend/app/features/settings/pages/roles/role-add-form.component.ts +++ b/frontend/app/features/settings/pages/roles/role-add-form.component.ts @@ -7,7 +7,6 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; import { FormBuilder } from '@angular/forms'; - import { AddRoleForm, RolesState } from '@app/shared'; @Component({ diff --git a/frontend/app/features/settings/pages/roles/role.component.ts b/frontend/app/features/settings/pages/roles/role.component.ts index 9073d794e..c1335ac70 100644 --- a/frontend/app/features/settings/pages/roles/role.component.ts +++ b/frontend/app/features/settings/pages/roles/role.component.ts @@ -7,15 +7,7 @@ import { ChangeDetectionStrategy, Component, Input, OnChanges, SimpleChanges, ViewChild } from '@angular/core'; import { FormBuilder } from '@angular/forms'; - -import { - AddPermissionForm, - AutocompleteComponent, - AutocompleteSource, - EditRoleForm, - RoleDto, - RolesState -} from '@app/shared'; +import { AddPermissionForm, AutocompleteComponent, AutocompleteSource, EditRoleForm, RoleDto, RolesState } from '@app/shared'; const Descriptions = { Developer: 'Can use the API view, edit assets, contents, schemas, rules, workflows and patterns.', diff --git a/frontend/app/features/settings/pages/roles/roles-page.component.ts b/frontend/app/features/settings/pages/roles/roles-page.component.ts index 56d07759d..cfff3e963 100644 --- a/frontend/app/features/settings/pages/roles/roles-page.component.ts +++ b/frontend/app/features/settings/pages/roles/roles-page.component.ts @@ -6,16 +6,9 @@ */ import { Component, OnInit } from '@angular/core'; +import { AppsState, AutocompleteSource, RoleDto, RolesService, RolesState } from '@app/shared'; import { Observable, of } from 'rxjs'; -import { - AppsState, - AutocompleteSource, - RoleDto, - RolesService, - RolesState -} from '@app/shared'; - class PermissionsAutocomplete implements AutocompleteSource { private permissions: ReadonlyArray = []; diff --git a/frontend/app/features/settings/pages/workflows/workflow-add-form.component.ts b/frontend/app/features/settings/pages/workflows/workflow-add-form.component.ts index 56f47c739..951ba7d68 100644 --- a/frontend/app/features/settings/pages/workflows/workflow-add-form.component.ts +++ b/frontend/app/features/settings/pages/workflows/workflow-add-form.component.ts @@ -7,7 +7,6 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; import { FormBuilder } from '@angular/forms'; - import { AddWorkflowForm, WorkflowsState } from '@app/shared'; @Component({ diff --git a/frontend/app/features/settings/pages/workflows/workflow-step.component.ts b/frontend/app/features/settings/pages/workflows/workflow-step.component.ts index bf83e7b00..7a885030f 100644 --- a/frontend/app/features/settings/pages/workflows/workflow-step.component.ts +++ b/frontend/app/features/settings/pages/workflows/workflow-step.component.ts @@ -6,15 +6,7 @@ */ import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core'; - -import { - WorkflowDto, - WorkflowStep, - WorkflowStepValues, - WorkflowTransition, - WorkflowTransitionValues, - WorkflowTransitionView -} from '@app/shared'; +import { WorkflowDto, WorkflowStep, WorkflowStepValues, WorkflowTransition, WorkflowTransitionValues, WorkflowTransitionView } from '@app/shared'; @Component({ selector: 'sqx-workflow-step', diff --git a/frontend/app/features/settings/pages/workflows/workflow-transition.component.ts b/frontend/app/features/settings/pages/workflows/workflow-transition.component.ts index fab3a4519..ff0785d94 100644 --- a/frontend/app/features/settings/pages/workflows/workflow-transition.component.ts +++ b/frontend/app/features/settings/pages/workflows/workflow-transition.component.ts @@ -6,12 +6,7 @@ */ import { Component, EventEmitter, Input, Output } from '@angular/core'; - -import { - RoleDto, - WorkflowTransitionValues, - WorkflowTransitionView -} from '@app/shared'; +import { RoleDto, WorkflowTransitionValues, WorkflowTransitionView } from '@app/shared'; @Component({ selector: 'sqx-workflow-transition', diff --git a/frontend/app/features/settings/pages/workflows/workflow.component.ts b/frontend/app/features/settings/pages/workflows/workflow.component.ts index 3a89fd476..f14dd157e 100644 --- a/frontend/app/features/settings/pages/workflows/workflow.component.ts +++ b/frontend/app/features/settings/pages/workflows/workflow.component.ts @@ -8,18 +8,7 @@ // tslint:disable: readonly-array import { Component, Input, OnChanges } from '@angular/core'; - -import { - ErrorDto, - MathHelper, - SchemaTagSource, - WorkflowDto, - WorkflowsState, - WorkflowStep, - WorkflowStepValues, - WorkflowTransition, - WorkflowTransitionValues -} from '@app/shared'; +import { ErrorDto, MathHelper, SchemaTagSource, WorkflowDto, WorkflowsState, WorkflowStep, WorkflowStepValues, WorkflowTransition, WorkflowTransitionValues } from '@app/shared'; @Component({ selector: 'sqx-workflow', diff --git a/frontend/app/features/settings/pages/workflows/workflows-page.component.ts b/frontend/app/features/settings/pages/workflows/workflows-page.component.ts index 1dc3793d3..d9ab1f747 100644 --- a/frontend/app/features/settings/pages/workflows/workflows-page.component.ts +++ b/frontend/app/features/settings/pages/workflows/workflows-page.component.ts @@ -6,14 +6,7 @@ */ import { Component, OnInit } from '@angular/core'; - -import { - ResourceOwner, - RolesState, - SchemaTagSource, - WorkflowDto, - WorkflowsState -} from '@app/shared'; +import { ResourceOwner, RolesState, SchemaTagSource, WorkflowDto, WorkflowsState } from '@app/shared'; @Component({ selector: 'sqx-workflows-page', diff --git a/frontend/app/features/settings/settings-area.component.ts b/frontend/app/features/settings/settings-area.component.ts index 716b48757..6f54934fe 100644 --- a/frontend/app/features/settings/settings-area.component.ts +++ b/frontend/app/features/settings/settings-area.component.ts @@ -6,7 +6,6 @@ */ import { Component } from '@angular/core'; - import { AppsState } from '@app/shared'; @Component({ diff --git a/frontend/app/framework/angular/animations.ts b/frontend/app/framework/angular/animations.ts index 66777ef26..6713d34e4 100644 --- a/frontend/app/framework/angular/animations.ts +++ b/frontend/app/framework/angular/animations.ts @@ -5,14 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { - animate, - AnimationTriggerMetadata, - state, - style, - transition, - trigger -} from '@angular/animations'; +import { animate, AnimationTriggerMetadata, state, style, transition, trigger } from '@angular/animations'; export function buildSlideRightAnimation(name = 'slideRight', timing = '150ms'): AnimationTriggerMetadata { return trigger( diff --git a/frontend/app/framework/angular/avatar.component.ts b/frontend/app/framework/angular/avatar.component.ts index 13e5ffd4c..c3ac0b4b7 100644 --- a/frontend/app/framework/angular/avatar.component.ts +++ b/frontend/app/framework/angular/avatar.component.ts @@ -6,7 +6,6 @@ */ import { ChangeDetectionStrategy, Component, Input, OnChanges, SimpleChanges } from '@angular/core'; - import { picasso } from '@app/framework/internal'; @Component({ diff --git a/frontend/app/framework/angular/drag-helper.ts b/frontend/app/framework/angular/drag-helper.ts index fa4620fe3..c6b7152f3 100644 --- a/frontend/app/framework/angular/drag-helper.ts +++ b/frontend/app/framework/angular/drag-helper.ts @@ -8,7 +8,6 @@ // tslint:disable: prefer-for-of import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop'; - import { Types } from './../utils/types'; export function sorted(event: CdkDragDrop>): ReadonlyArray { diff --git a/frontend/app/framework/angular/forms/confirm-click.directive.ts b/frontend/app/framework/angular/forms/confirm-click.directive.ts index c1329d588..1cd2189d3 100644 --- a/frontend/app/framework/angular/forms/confirm-click.directive.ts +++ b/frontend/app/framework/angular/forms/confirm-click.directive.ts @@ -8,7 +8,6 @@ // tslint:disable: readonly-array import { Directive, EventEmitter, HostListener, Input, OnDestroy, Output } from '@angular/core'; - import { DialogService } from '@app/framework/internal'; class DelayEventEmitter extends EventEmitter { diff --git a/frontend/app/framework/angular/forms/control-errors.component.ts b/frontend/app/framework/angular/forms/control-errors.component.ts index 1a6d72dda..cfb5833f8 100644 --- a/frontend/app/framework/angular/forms/control-errors.component.ts +++ b/frontend/app/framework/angular/forms/control-errors.component.ts @@ -7,14 +7,8 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Host, Input, OnChanges, OnDestroy, Optional } from '@angular/core'; import { AbstractControl, FormArray, FormGroupDirective } from '@angular/forms'; +import { fadeAnimation, StatefulComponent, Types } from '@app/framework/internal'; import { merge } from 'rxjs'; - -import { - fadeAnimation, - StatefulComponent, - Types -} from '@app/framework/internal'; - import { formatError } from './error-formatting'; interface State { diff --git a/frontend/app/framework/angular/forms/copy.directive.ts b/frontend/app/framework/angular/forms/copy.directive.ts index 3f7c3fdf0..e51fd8cb7 100644 --- a/frontend/app/framework/angular/forms/copy.directive.ts +++ b/frontend/app/framework/angular/forms/copy.directive.ts @@ -6,12 +6,7 @@ */ import { Directive, HostListener, Input, Renderer2 } from '@angular/core'; - -import { - DialogService, - Notification, - Types -} from '@app/framework/internal'; +import { DialogService, Notification, Types } from '@app/framework/internal'; @Directive({ selector: '[sqxCopy]' diff --git a/frontend/app/framework/angular/forms/editable-title.component.ts b/frontend/app/framework/angular/forms/editable-title.component.ts index 2bfc3b1dd..c9a2bc0e6 100644 --- a/frontend/app/framework/angular/forms/editable-title.component.ts +++ b/frontend/app/framework/angular/forms/editable-title.component.ts @@ -7,7 +7,6 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'; import { FormBuilder, Validators } from '@angular/forms'; - import { Keys } from '@app/framework/internal'; @Component({ diff --git a/frontend/app/framework/angular/forms/editors/autocomplete.component.ts b/frontend/app/framework/angular/forms/editors/autocomplete.component.ts index 9fd94eb9b..de662a67a 100644 --- a/frontend/app/framework/angular/forms/editors/autocomplete.component.ts +++ b/frontend/app/framework/angular/forms/editors/autocomplete.component.ts @@ -7,16 +7,10 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChild, ElementRef, forwardRef, Input, OnDestroy, OnInit, TemplateRef, ViewChild } from '@angular/core'; import { FormControl, NG_VALUE_ACCESSOR } from '@angular/forms'; +import { fadeAnimation, Keys, StatefulControlComponent, Types } from '@app/framework/internal'; import { Observable, of } from 'rxjs'; import { catchError, debounceTime, distinctUntilChanged, finalize, map, switchMap, tap } from 'rxjs/operators'; -import { - fadeAnimation, - Keys, - StatefulControlComponent, - Types -} from '@app/framework/internal'; - export interface AutocompleteSource { find(query: string): Observable>; } diff --git a/frontend/app/framework/angular/forms/editors/checkbox-group.component.ts b/frontend/app/framework/angular/forms/editors/checkbox-group.component.ts index e1107bdcd..25a3a2212 100644 --- a/frontend/app/framework/angular/forms/editors/checkbox-group.component.ts +++ b/frontend/app/framework/angular/forms/editors/checkbox-group.component.ts @@ -9,12 +9,7 @@ import { AfterViewChecked, AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, forwardRef, Input, OnChanges, ViewChild } from '@angular/core'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; - -import { - MathHelper, - StatefulControlComponent, - Types -} from '@app/framework/internal'; +import { MathHelper, StatefulControlComponent, Types } from '@app/framework/internal'; export const SQX_CHECKBOX_GROUP_CONTROL_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => CheckboxGroupComponent), multi: true diff --git a/frontend/app/framework/angular/forms/editors/code-editor.component.ts b/frontend/app/framework/angular/forms/editors/code-editor.component.ts index f28b0b2bc..f2cb279a6 100644 --- a/frontend/app/framework/angular/forms/editors/code-editor.component.ts +++ b/frontend/app/framework/angular/forms/editors/code-editor.component.ts @@ -7,15 +7,9 @@ import { AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, forwardRef, Input, ViewChild } from '@angular/core'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; +import { ResourceLoaderService, StatefulControlComponent, Types } from '@app/framework/internal'; import { Subject } from 'rxjs'; import { debounceTime } from 'rxjs/operators'; - -import { - ResourceLoaderService, - StatefulControlComponent, - Types -} from '@app/framework/internal'; - import { FocusComponent } from './../forms-helper'; declare var ace: any; diff --git a/frontend/app/framework/angular/forms/editors/color-picker.component.ts b/frontend/app/framework/angular/forms/editors/color-picker.component.ts index 3b49ba9ac..2446971ba 100644 --- a/frontend/app/framework/angular/forms/editors/color-picker.component.ts +++ b/frontend/app/framework/angular/forms/editors/color-picker.component.ts @@ -7,13 +7,7 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, forwardRef, Input } from '@angular/core'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; - -import { - MathHelper, - ModalModel, - StatefulControlComponent -} from '@app/framework/internal'; - +import { MathHelper, ModalModel, StatefulControlComponent } from '@app/framework/internal'; import { FocusComponent } from './../forms-helper'; export const SQX_COLOR_PICKER_CONTROL_VALUE_ACCESSOR: any = { diff --git a/frontend/app/framework/angular/forms/editors/date-time-editor.component.ts b/frontend/app/framework/angular/forms/editors/date-time-editor.component.ts index d598cc929..61e51ea9a 100644 --- a/frontend/app/framework/angular/forms/editors/date-time-editor.component.ts +++ b/frontend/app/framework/angular/forms/editors/date-time-editor.component.ts @@ -7,20 +7,12 @@ import { AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, forwardRef, Input, OnInit, ViewChild } from '@angular/core'; import { FormControl, NG_VALUE_ACCESSOR } from '@angular/forms'; - -import { - DateHelper, - DateTime, - StatefulControlComponent, - UIOptions -} from '@app/framework/internal'; - +import { DateHelper, DateTime, StatefulControlComponent, UIOptions } from '@app/framework/internal'; +import * as Pikaday from 'pikaday/pikaday'; import { FocusComponent } from './../forms-helper'; declare module 'pikaday/pikaday'; -import * as Pikaday from 'pikaday/pikaday'; - export const SQX_DATE_TIME_EDITOR_CONTROL_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => DateTimeEditorComponent), multi: true }; diff --git a/frontend/app/framework/angular/forms/editors/dropdown.component.ts b/frontend/app/framework/angular/forms/editors/dropdown.component.ts index fd32c8b8c..4d09c6c04 100644 --- a/frontend/app/framework/angular/forms/editors/dropdown.component.ts +++ b/frontend/app/framework/angular/forms/editors/dropdown.component.ts @@ -7,15 +7,9 @@ import { AfterContentInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChildren, forwardRef, Input, OnChanges, OnInit, QueryList, SimpleChanges, TemplateRef } from '@angular/core'; import { ControlValueAccessor, FormControl, NG_VALUE_ACCESSOR } from '@angular/forms'; +import { Keys, ModalModel, StatefulControlComponent, Types } from '@app/framework/internal'; import { map } from 'rxjs/operators'; -import { - Keys, - ModalModel, - StatefulControlComponent, - Types -} from '@app/framework/internal'; - export const SQX_DROPDOWN_CONTROL_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => DropdownComponent), multi: true }; diff --git a/frontend/app/framework/angular/forms/editors/iframe-editor.component.ts b/frontend/app/framework/angular/forms/editors/iframe-editor.component.ts index 7c6a8d518..510e04b1d 100644 --- a/frontend/app/framework/angular/forms/editors/iframe-editor.component.ts +++ b/frontend/app/framework/angular/forms/editors/iframe-editor.component.ts @@ -7,7 +7,6 @@ import { AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, forwardRef, Input, OnChanges, Renderer2, SimpleChanges, ViewChild } from '@angular/core'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; - import { StatefulControlComponent, Types } from '@app/framework/internal'; export const SQX_IFRAME_EDITOR_CONTROL_VALUE_ACCESSOR: any = { diff --git a/frontend/app/framework/angular/forms/editors/json-editor.component.ts b/frontend/app/framework/angular/forms/editors/json-editor.component.ts index 09c55144e..8e114304f 100644 --- a/frontend/app/framework/angular/forms/editors/json-editor.component.ts +++ b/frontend/app/framework/angular/forms/editors/json-editor.component.ts @@ -7,11 +7,9 @@ import { AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, forwardRef, Input, ViewChild } from '@angular/core'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; +import { ResourceLoaderService, StatefulControlComponent } from '@app/framework/internal'; import { Subject } from 'rxjs'; import { debounceTime } from 'rxjs/operators'; - -import { ResourceLoaderService, StatefulControlComponent } from '@app/framework/internal'; - import { FocusComponent } from './../forms-helper'; declare var ace: any; diff --git a/frontend/app/framework/angular/forms/editors/stars.component.ts b/frontend/app/framework/angular/forms/editors/stars.component.ts index 676a937b7..1540c5cbb 100644 --- a/frontend/app/framework/angular/forms/editors/stars.component.ts +++ b/frontend/app/framework/angular/forms/editors/stars.component.ts @@ -7,7 +7,6 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, forwardRef, Input } from '@angular/core'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; - import { StatefulControlComponent, Types } from '@app/framework/internal'; export const SQX_STARS_CONTROL_VALUE_ACCESSOR: any = { diff --git a/frontend/app/framework/angular/forms/editors/tag-editor.component.ts b/frontend/app/framework/angular/forms/editors/tag-editor.component.ts index bdd5ce782..baaf20460 100644 --- a/frontend/app/framework/angular/forms/editors/tag-editor.component.ts +++ b/frontend/app/framework/angular/forms/editors/tag-editor.component.ts @@ -5,20 +5,13 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -// tslint:disable:template-use-track-by-function +// tslint:disable: template-use-track-by-function import { AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, forwardRef, Input, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core'; import { FormControl, NG_VALUE_ACCESSOR } from '@angular/forms'; +import { fadeAnimation, Keys, ModalModel, StatefulControlComponent, Types } from '@app/framework/internal'; import { distinctUntilChanged, map, tap } from 'rxjs/operators'; -import { - fadeAnimation, - Keys, - ModalModel, - StatefulControlComponent, - Types -} from '@app/framework/internal'; - export const CONVERSION_FAILED = {}; export class TagValue { diff --git a/frontend/app/framework/angular/forms/editors/toggle.component.ts b/frontend/app/framework/angular/forms/editors/toggle.component.ts index 2eed005a0..623b36a9b 100644 --- a/frontend/app/framework/angular/forms/editors/toggle.component.ts +++ b/frontend/app/framework/angular/forms/editors/toggle.component.ts @@ -7,7 +7,6 @@ import { ChangeDetectorRef, Component, forwardRef, Input } from '@angular/core'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; - import { StatefulControlComponent, Types } from '@app/framework/internal'; export const SQX_TOGGLE_CONTROL_VALUE_ACCESSOR: any = { diff --git a/frontend/app/framework/angular/forms/error-formatting.spec.ts b/frontend/app/framework/angular/forms/error-formatting.spec.ts index 88b4206ad..ea683ac25 100644 --- a/frontend/app/framework/angular/forms/error-formatting.spec.ts +++ b/frontend/app/framework/angular/forms/error-formatting.spec.ts @@ -6,10 +6,8 @@ */ import { FormControl, FormGroup, ValidatorFn, Validators } from '@angular/forms'; - -import { ValidatorsEx } from './validators'; - import { formatError } from './error-formatting'; +import { ValidatorsEx } from './validators'; describe('formatErrors', () => { it('should format min', () => { diff --git a/frontend/app/framework/angular/forms/file-drop.directive.ts b/frontend/app/framework/angular/forms/file-drop.directive.ts index 2057356a4..ad112f5ff 100644 --- a/frontend/app/framework/angular/forms/file-drop.directive.ts +++ b/frontend/app/framework/angular/forms/file-drop.directive.ts @@ -5,10 +5,9 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -// tslint:disable:prefer-for-of +// tslint:disable: prefer-for-of import { Directive, ElementRef, EventEmitter, HostListener, Input, Output, Renderer2 } from '@angular/core'; - import { Types } from '@app/framework/internal'; const ImageTypes: ReadonlyArray = [ diff --git a/frontend/app/framework/angular/forms/focus-on-init.directive.spec.ts b/frontend/app/framework/angular/forms/focus-on-init.directive.spec.ts index ec13649f4..44ba6bbdc 100644 --- a/frontend/app/framework/angular/forms/focus-on-init.directive.spec.ts +++ b/frontend/app/framework/angular/forms/focus-on-init.directive.spec.ts @@ -6,7 +6,6 @@ */ import { ElementRef } from '@angular/core'; - import { FocusOnInitDirective } from './focus-on-init.directive'; describe('FocusOnInitDirective', () => { diff --git a/frontend/app/framework/angular/forms/focus-on-init.directive.ts b/frontend/app/framework/angular/forms/focus-on-init.directive.ts index be647873a..2885496ba 100644 --- a/frontend/app/framework/angular/forms/focus-on-init.directive.ts +++ b/frontend/app/framework/angular/forms/focus-on-init.directive.ts @@ -6,7 +6,6 @@ */ import { AfterViewInit, Directive, ElementRef, Input } from '@angular/core'; - import { Types } from '@app/framework/internal'; @Directive({ diff --git a/frontend/app/framework/angular/forms/form-error.component.ts b/frontend/app/framework/angular/forms/form-error.component.ts index 56c7b9ba8..ce5f31531 100644 --- a/frontend/app/framework/angular/forms/form-error.component.ts +++ b/frontend/app/framework/angular/forms/form-error.component.ts @@ -6,7 +6,6 @@ */ import { ChangeDetectionStrategy, Component, Input, OnChanges, SimpleChanges } from '@angular/core'; - import { ErrorDto } from '@app/framework/internal'; @Component({ diff --git a/frontend/app/framework/angular/forms/forms-helper.spec.ts b/frontend/app/framework/angular/forms/forms-helper.spec.ts index 1d47da0d9..86725ff02 100644 --- a/frontend/app/framework/angular/forms/forms-helper.spec.ts +++ b/frontend/app/framework/angular/forms/forms-helper.spec.ts @@ -6,7 +6,6 @@ */ import { FormControl, Validators } from '@angular/forms'; - import { value$ } from './forms-helper'; describe('FormHelpers', () => { diff --git a/frontend/app/framework/angular/forms/forms-helper.ts b/frontend/app/framework/angular/forms/forms-helper.ts index e3953a948..0d89d65a6 100644 --- a/frontend/app/framework/angular/forms/forms-helper.ts +++ b/frontend/app/framework/angular/forms/forms-helper.ts @@ -8,7 +8,6 @@ import { AbstractControl, FormArray, FormGroup } from '@angular/forms'; import { Observable } from 'rxjs'; import { distinctUntilChanged, map, startWith } from 'rxjs/operators'; - import { Types } from './../../utils/types'; export interface FocusComponent { diff --git a/frontend/app/framework/angular/forms/indeterminate-value.directive.ts b/frontend/app/framework/angular/forms/indeterminate-value.directive.ts index e6017136e..6a8810b28 100644 --- a/frontend/app/framework/angular/forms/indeterminate-value.directive.ts +++ b/frontend/app/framework/angular/forms/indeterminate-value.directive.ts @@ -6,8 +6,7 @@ */ import { Directive, ElementRef, forwardRef, HostListener, Renderer2 } from '@angular/core'; -import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; - +import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; import { Types } from '@app/framework/internal'; export const SQX_INDETERMINATE_VALUE_CONTROL_VALUE_ACCESSOR: any = { diff --git a/frontend/app/framework/angular/forms/progress-bar.component.ts b/frontend/app/framework/angular/forms/progress-bar.component.ts index b62869716..8fe0377cc 100644 --- a/frontend/app/framework/angular/forms/progress-bar.component.ts +++ b/frontend/app/framework/angular/forms/progress-bar.component.ts @@ -6,7 +6,6 @@ */ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, Input, OnChanges, OnInit, Renderer2, SimpleChanges } from '@angular/core'; - import * as ProgressBar from 'progressbar.js'; @Component({ diff --git a/frontend/app/framework/angular/forms/transform-input.directive.ts b/frontend/app/framework/angular/forms/transform-input.directive.ts index 490e6a9c9..8c31909f1 100644 --- a/frontend/app/framework/angular/forms/transform-input.directive.ts +++ b/frontend/app/framework/angular/forms/transform-input.directive.ts @@ -6,8 +6,8 @@ */ import { Directive, ElementRef, forwardRef, HostListener, Input, Renderer2 } from '@angular/core'; -import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; - +import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; +import { Types } from '@app/framework/internal'; import slugify from 'slugify'; type Transform = (value: string) => string; @@ -18,8 +18,6 @@ export const TransformSlugify: Transform = value => slugify(value, { lower: true export const TransformSlugifyCased: Transform = value => slugify(value, { lower: false }); export const TransformUpperCase: Transform = value => value.toUpperCase(); -import { Types } from '@app/framework/internal'; - export const SQX_TRANSFORM_INPUT_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => TransformInputDirective), multi: true }; diff --git a/frontend/app/framework/angular/forms/validators.spec.ts b/frontend/app/framework/angular/forms/validators.spec.ts index bb65bcd78..b36b5d601 100644 --- a/frontend/app/framework/angular/forms/validators.spec.ts +++ b/frontend/app/framework/angular/forms/validators.spec.ts @@ -6,9 +6,7 @@ */ import { FormControl, FormGroup, Validators } from '@angular/forms'; - import { DateTime } from '@app/framework/internal'; - import { ValidatorsEx } from './validators'; describe('ValidatorsEx.between', () => { diff --git a/frontend/app/framework/angular/forms/validators.ts b/frontend/app/framework/angular/forms/validators.ts index 3bb0f5091..07772a80a 100644 --- a/frontend/app/framework/angular/forms/validators.ts +++ b/frontend/app/framework/angular/forms/validators.ts @@ -6,7 +6,6 @@ */ import { AbstractControl, ValidatorFn, Validators } from '@angular/forms'; - import { DateTime, Types } from '@app/framework/internal'; function isEmptyInputValue(value: any): boolean { diff --git a/frontend/app/framework/angular/highlight.pipe.ts b/frontend/app/framework/angular/highlight.pipe.ts index 93206fbe5..f9d0694ac 100644 --- a/frontend/app/framework/angular/highlight.pipe.ts +++ b/frontend/app/framework/angular/highlight.pipe.ts @@ -8,7 +8,6 @@ // tslint:disable: no-pipe-impure import { Pipe, PipeTransform } from '@angular/core'; - import { Types } from '@app/framework/internal'; @Pipe({ diff --git a/frontend/app/framework/angular/http/caching.interceptor.ts b/frontend/app/framework/angular/http/caching.interceptor.ts index 3058f13cd..1d82083c8 100644 --- a/frontend/app/framework/angular/http/caching.interceptor.ts +++ b/frontend/app/framework/angular/http/caching.interceptor.ts @@ -6,12 +6,11 @@ */ import { HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest, HttpResponse } from '@angular/common/http'; -import { Injectable} from '@angular/core'; +import { Injectable } from '@angular/core'; +import { Types } from '@app/framework/internal'; import { Observable, of, throwError } from 'rxjs'; import { catchError, tap } from 'rxjs/operators'; -import { Types } from '@app/framework/internal'; - @Injectable() export class CachingInterceptor implements HttpInterceptor { private readonly cache: { [url: string]: HttpResponse } = {}; diff --git a/frontend/app/framework/angular/http/http-extensions.spec.ts b/frontend/app/framework/angular/http/http-extensions.spec.ts index b303ad175..d5bee8a32 100644 --- a/frontend/app/framework/angular/http/http-extensions.spec.ts +++ b/frontend/app/framework/angular/http/http-extensions.spec.ts @@ -5,9 +5,8 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { parseError } from './http-extensions'; - import { ErrorDto } from './../../utils/error'; +import { parseError } from './http-extensions'; describe('ErrorParsing', () => { it('should return default when error is javascript exception', () => { diff --git a/frontend/app/framework/angular/http/http-extensions.ts b/frontend/app/framework/angular/http/http-extensions.ts index 1ed09caa1..1b6cb7b3d 100644 --- a/frontend/app/framework/angular/http/http-extensions.ts +++ b/frontend/app/framework/angular/http/http-extensions.ts @@ -6,16 +6,10 @@ */ import { HttpClient, HttpErrorResponse, HttpEvent, HttpHeaders, HttpRequest, HttpResponse } from '@angular/common/http'; +import { ErrorDto, Types, Version, Versioned } from '@app/framework/internal'; import { Observable, throwError } from 'rxjs'; import { catchError, map } from 'rxjs/operators'; -import { - ErrorDto, - Types, - Version, - Versioned -} from '@app/framework/internal'; - export module HTTP { export function upload(http: HttpClient, method: string, url: string, file: Blob, version?: Version): Observable> { const req = new HttpRequest(method, url, getFormData(file), { headers: createHeaders(version), reportProgress: true }); diff --git a/frontend/app/framework/angular/http/loading.interceptor.ts b/frontend/app/framework/angular/http/loading.interceptor.ts index 049bd0346..6b6573553 100644 --- a/frontend/app/framework/angular/http/loading.interceptor.ts +++ b/frontend/app/framework/angular/http/loading.interceptor.ts @@ -6,12 +6,11 @@ */ import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http'; -import { Injectable} from '@angular/core'; +import { Injectable } from '@angular/core'; +import { LoadingService, MathHelper } from '@app/framework/internal'; import { Observable } from 'rxjs'; import { finalize } from 'rxjs/operators'; -import { LoadingService, MathHelper } from '@app/framework/internal'; - @Injectable() export class LoadingInterceptor implements HttpInterceptor { constructor( diff --git a/frontend/app/framework/angular/image-source.directive.ts b/frontend/app/framework/angular/image-source.directive.ts index a2b94ae4f..5bc7bacb3 100644 --- a/frontend/app/framework/angular/image-source.directive.ts +++ b/frontend/app/framework/angular/image-source.directive.ts @@ -6,7 +6,6 @@ */ import { AfterViewInit, Directive, ElementRef, Input, NgZone, OnChanges, OnDestroy, OnInit, Renderer2 } from '@angular/core'; - import { MathHelper, ResourceOwner } from '@app/framework/internal'; import { StringHelper } from '../utils/string-helper'; diff --git a/frontend/app/framework/angular/list-view.component.ts b/frontend/app/framework/angular/list-view.component.ts index f203f46ed..f1513c9d9 100644 --- a/frontend/app/framework/angular/list-view.component.ts +++ b/frontend/app/framework/angular/list-view.component.ts @@ -6,7 +6,6 @@ */ import { AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, HostBinding, Input, Renderer2, ViewChild } from '@angular/core'; - import { fadeAnimation } from '@app/framework/internal'; @Component({ diff --git a/frontend/app/framework/angular/modals/dialog-renderer.component.ts b/frontend/app/framework/angular/modals/dialog-renderer.component.ts index f19b4d0cb..048ac3491 100644 --- a/frontend/app/framework/angular/modals/dialog-renderer.component.ts +++ b/frontend/app/framework/angular/modals/dialog-renderer.component.ts @@ -6,18 +6,9 @@ */ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit } from '@angular/core'; +import { DialogModel, DialogRequest, DialogService, fadeAnimation, Notification, StatefulComponent, Tooltip } from '@app/framework/internal'; import { timer } from 'rxjs'; -import { - DialogModel, - DialogRequest, - DialogService, - fadeAnimation, - Notification, - StatefulComponent, - Tooltip -} from '@app/framework/internal'; - interface State { // The pending dialog request. dialogRequest?: DialogRequest | null; diff --git a/frontend/app/framework/angular/modals/modal-dialog.component.ts b/frontend/app/framework/angular/modals/modal-dialog.component.ts index e7ad33bc9..b655117bd 100644 --- a/frontend/app/framework/angular/modals/modal-dialog.component.ts +++ b/frontend/app/framework/angular/modals/modal-dialog.component.ts @@ -6,7 +6,6 @@ */ import { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, EventEmitter, Input, Output, Renderer2, ViewChild } from '@angular/core'; - import { fadeAnimation } from '@app/framework/internal'; @Component({ diff --git a/frontend/app/framework/angular/modals/modal-placement.directive.ts b/frontend/app/framework/angular/modals/modal-placement.directive.ts index 8f75efeeb..c670a7a64 100644 --- a/frontend/app/framework/angular/modals/modal-placement.directive.ts +++ b/frontend/app/framework/angular/modals/modal-placement.directive.ts @@ -6,9 +6,8 @@ */ import { AfterViewInit, Directive, ElementRef, Input, OnDestroy, Renderer2 } from '@angular/core'; -import { timer } from 'rxjs'; - import { positionModal, ResourceOwner } from '@app/framework/internal'; +import { timer } from 'rxjs'; @Directive({ selector: '[sqxAnchoredTo]' diff --git a/frontend/app/framework/angular/modals/modal.directive.ts b/frontend/app/framework/angular/modals/modal.directive.ts index 4a1bc6bc5..f6ddd9778 100644 --- a/frontend/app/framework/angular/modals/modal.directive.ts +++ b/frontend/app/framework/angular/modals/modal.directive.ts @@ -6,14 +6,7 @@ */ import { ChangeDetectorRef, Directive, EmbeddedViewRef, Input, OnDestroy, Renderer2, TemplateRef, ViewContainerRef } from '@angular/core'; - -import { - DialogModel, - ModalModel, - ResourceOwner, - Types -} from '@app/framework/internal'; - +import { DialogModel, ModalModel, ResourceOwner, Types } from '@app/framework/internal'; import { RootViewComponent } from './root-view.component'; declare type Model = DialogModel | ModalModel | any; diff --git a/frontend/app/framework/angular/modals/onboarding-tooltip.component.ts b/frontend/app/framework/angular/modals/onboarding-tooltip.component.ts index c507d0397..0e9665207 100644 --- a/frontend/app/framework/angular/modals/onboarding-tooltip.component.ts +++ b/frontend/app/framework/angular/modals/onboarding-tooltip.component.ts @@ -6,16 +6,9 @@ */ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnDestroy, OnInit, Renderer2 } from '@angular/core'; +import { DialogModel, fadeAnimation, OnboardingService, StatefulComponent, Types } from '@app/framework/internal'; import { timer } from 'rxjs'; -import { - DialogModel, - fadeAnimation, - OnboardingService, - StatefulComponent, - Types -} from '@app/framework/internal'; - @Component({ selector: 'sqx-onboarding-tooltip', styleUrls: ['./onboarding-tooltip.component.scss'], diff --git a/frontend/app/framework/angular/modals/tooltip.directive.ts b/frontend/app/framework/angular/modals/tooltip.directive.ts index 917f23dc1..4caf9319c 100644 --- a/frontend/app/framework/angular/modals/tooltip.directive.ts +++ b/frontend/app/framework/angular/modals/tooltip.directive.ts @@ -5,10 +5,9 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -// tslint:disable:directive-selector +// tslint:disable: directive-selector import { Directive, ElementRef, HostListener, Input, Renderer2 } from '@angular/core'; - import { DialogService, Tooltip } from '@app/framework/internal'; @Directive({ diff --git a/frontend/app/framework/angular/pager.component.ts b/frontend/app/framework/angular/pager.component.ts index eedae2bbe..c8e6b3fc4 100644 --- a/frontend/app/framework/angular/pager.component.ts +++ b/frontend/app/framework/angular/pager.component.ts @@ -6,7 +6,6 @@ */ import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; - import { Pager } from '@app/framework/internal'; @Component({ diff --git a/frontend/app/framework/angular/panel-container.directive.ts b/frontend/app/framework/angular/panel-container.directive.ts index 10e5a38b7..c7cc849f4 100644 --- a/frontend/app/framework/angular/panel-container.directive.ts +++ b/frontend/app/framework/angular/panel-container.directive.ts @@ -8,7 +8,6 @@ // tslint:disable: readonly-array import { AfterViewInit, Directive, ElementRef, HostListener, Renderer2 } from '@angular/core'; - import { PanelComponent } from './panel.component'; @Directive({ diff --git a/frontend/app/framework/angular/panel.component.ts b/frontend/app/framework/angular/panel.component.ts index 94a9b3e32..7c4cb045b 100644 --- a/frontend/app/framework/angular/panel.component.ts +++ b/frontend/app/framework/angular/panel.component.ts @@ -6,9 +6,7 @@ */ import { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, Renderer2, SimpleChanges, ViewChild } from '@angular/core'; - import { slideRightAnimation } from '@app/framework/internal'; - import { PanelContainerDirective } from './panel-container.directive'; @Component({ diff --git a/frontend/app/framework/angular/pipes/date-time.pipes.spec.ts b/frontend/app/framework/angular/pipes/date-time.pipes.spec.ts index 867279768..2eaa8389a 100644 --- a/frontend/app/framework/angular/pipes/date-time.pipes.spec.ts +++ b/frontend/app/framework/angular/pipes/date-time.pipes.spec.ts @@ -6,19 +6,7 @@ */ import { DateTime, Duration } from '@app/framework/internal'; - -import { - DatePipe, - DayOfWeekPipe, - DayPipe, - DurationPipe, - FromNowPipe, - FullDateTimePipe, - ISODatePipe, - MonthPipe, - ShortDatePipe, - ShortTimePipe -} from './date-time.pipes'; +import { DatePipe, DayOfWeekPipe, DayPipe, DurationPipe, FromNowPipe, FullDateTimePipe, ISODatePipe, MonthPipe, ShortDatePipe, ShortTimePipe } from './date-time.pipes'; const dateTime = DateTime.parseISO('2013-10-03T12:13:14.125', false); diff --git a/frontend/app/framework/angular/pipes/date-time.pipes.ts b/frontend/app/framework/angular/pipes/date-time.pipes.ts index 573ab5f2d..eda084a5b 100644 --- a/frontend/app/framework/angular/pipes/date-time.pipes.ts +++ b/frontend/app/framework/angular/pipes/date-time.pipes.ts @@ -6,7 +6,6 @@ */ import { Pipe, PipeTransform } from '@angular/core'; - import { DateTime, Duration } from '@app/framework/internal'; @Pipe({ diff --git a/frontend/app/framework/angular/pipes/money.pipe.spec.ts b/frontend/app/framework/angular/pipes/money.pipe.spec.ts index 5b760fd49..e2beb48a4 100644 --- a/frontend/app/framework/angular/pipes/money.pipe.spec.ts +++ b/frontend/app/framework/angular/pipes/money.pipe.spec.ts @@ -6,7 +6,6 @@ */ import { CurrencyConfig, DecimalSeparatorConfig } from '@app/framework/internal'; - import { MoneyPipe } from './money.pipe'; describe('MoneyPipe', () => { diff --git a/frontend/app/framework/angular/pipes/money.pipe.ts b/frontend/app/framework/angular/pipes/money.pipe.ts index 0c4cc4f71..eb390d70b 100644 --- a/frontend/app/framework/angular/pipes/money.pipe.ts +++ b/frontend/app/framework/angular/pipes/money.pipe.ts @@ -6,7 +6,6 @@ */ import { Pipe, PipeTransform } from '@angular/core'; - import { CurrencyConfig, DecimalSeparatorConfig } from '@app/framework/internal'; @Pipe({ diff --git a/frontend/app/framework/angular/pipes/name.pipe.ts b/frontend/app/framework/angular/pipes/name.pipe.ts index c82448a55..b44399f1c 100644 --- a/frontend/app/framework/angular/pipes/name.pipe.ts +++ b/frontend/app/framework/angular/pipes/name.pipe.ts @@ -6,7 +6,6 @@ */ import { Pipe, PipeTransform } from '@angular/core'; - import { StringHelper } from '@app/framework/internal'; @Pipe({ diff --git a/frontend/app/framework/angular/resized.directive.ts b/frontend/app/framework/angular/resized.directive.ts index 5caf297bd..a2aa90dfd 100644 --- a/frontend/app/framework/angular/resized.directive.ts +++ b/frontend/app/framework/angular/resized.directive.ts @@ -6,12 +6,7 @@ */ import { Directive, ElementRef, EventEmitter, Input, NgZone, OnChanges, OnDestroy, Output } from '@angular/core'; - -import { - ResizeListener, - ResizeService, - ResourceOwner -} from '@app/framework/internal'; +import { ResizeListener, ResizeService, ResourceOwner } from '@app/framework/internal'; @Directive({ selector: '[sqxResized], [sqxResizeCondition]' diff --git a/frontend/app/framework/angular/routers/can-deactivate.guard.spec.ts b/frontend/app/framework/angular/routers/can-deactivate.guard.spec.ts index 4daac3531..4b5c6b08b 100644 --- a/frontend/app/framework/angular/routers/can-deactivate.guard.spec.ts +++ b/frontend/app/framework/angular/routers/can-deactivate.guard.spec.ts @@ -6,7 +6,6 @@ */ import { of } from 'rxjs'; - import { CanDeactivateGuard } from './can-deactivate.guard'; describe('CanDeactivateGuard', () => { diff --git a/frontend/app/framework/angular/routers/parent-link.directive.ts b/frontend/app/framework/angular/routers/parent-link.directive.ts index fd29a6404..769f2140b 100644 --- a/frontend/app/framework/angular/routers/parent-link.directive.ts +++ b/frontend/app/framework/angular/routers/parent-link.directive.ts @@ -7,7 +7,6 @@ import { Directive, ElementRef, HostListener, Input, OnInit, Renderer2 } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; - import { ResourceOwner } from '@app/framework/internal'; @Directive({ diff --git a/frontend/app/framework/angular/shortcut.component.spec.ts b/frontend/app/framework/angular/shortcut.component.spec.ts index a5a28fe32..363f31007 100644 --- a/frontend/app/framework/angular/shortcut.component.spec.ts +++ b/frontend/app/framework/angular/shortcut.component.spec.ts @@ -6,7 +6,6 @@ */ import { NgZone } from '@angular/core'; - import { ShortcutService } from '@app/framework/internal'; import { ShortcutComponent } from './shortcut.component'; diff --git a/frontend/app/framework/angular/shortcut.component.ts b/frontend/app/framework/angular/shortcut.component.ts index 6496146ba..7ccf9986b 100644 --- a/frontend/app/framework/angular/shortcut.component.ts +++ b/frontend/app/framework/angular/shortcut.component.ts @@ -6,7 +6,6 @@ */ import { ChangeDetectorRef, Component, EventEmitter, Input, NgZone, OnDestroy, OnInit, Output } from '@angular/core'; - import { ShortcutService, StatefulComponent } from '@app/framework/internal'; @Component({ diff --git a/frontend/app/framework/angular/stateful.component.ts b/frontend/app/framework/angular/stateful.component.ts index 027bced43..390888ada 100644 --- a/frontend/app/framework/angular/stateful.component.ts +++ b/frontend/app/framework/angular/stateful.component.ts @@ -11,10 +11,8 @@ import { ChangeDetectorRef, OnDestroy } from '@angular/core'; import { ControlValueAccessor } from '@angular/forms'; import { Observable, Subscription } from 'rxjs'; import { onErrorResumeNext, skip } from 'rxjs/operators'; - -import { Types } from './../utils/types'; - import { State } from './../state'; +import { Types } from './../utils/types'; declare type UnsubscribeFunction = () => void; diff --git a/frontend/app/framework/angular/sync-width.directive.ts b/frontend/app/framework/angular/sync-width.directive.ts index 013165a4c..ed1a5d6f5 100644 --- a/frontend/app/framework/angular/sync-width.directive.ts +++ b/frontend/app/framework/angular/sync-width.directive.ts @@ -6,12 +6,7 @@ */ import { AfterViewInit, Directive, ElementRef, Input, Renderer2 } from '@angular/core'; - -import { - ResizeListener, - ResizeService, - ResourceOwner -} from '@app/framework/internal'; +import { ResizeListener, ResizeService, ResourceOwner } from '@app/framework/internal'; @Directive({ selector: '[sqxSyncWidth]' diff --git a/frontend/app/framework/angular/title.component.ts b/frontend/app/framework/angular/title.component.ts index 3152eaa31..b0dbf5bfd 100644 --- a/frontend/app/framework/angular/title.component.ts +++ b/frontend/app/framework/angular/title.component.ts @@ -6,7 +6,6 @@ */ import { ChangeDetectionStrategy, Component, Input, OnDestroy } from '@angular/core'; - import { TitleService } from '@app/framework/internal'; @Component({ diff --git a/frontend/app/framework/declarations.ts b/frontend/app/framework/declarations.ts index 7c64e1a7b..206268ce5 100644 --- a/frontend/app/framework/declarations.ts +++ b/frontend/app/framework/declarations.ts @@ -5,6 +5,12 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +export * from './angular/avatar.component'; +export * from './angular/code.component'; +export * from './angular/external-link.directive'; +export * from './angular/forms/confirm-click.directive'; +export * from './angular/forms/control-errors.component'; +export * from './angular/forms/copy.directive'; export * from './angular/forms/editable-title.component'; export * from './angular/forms/editors/autocomplete.component'; export * from './angular/forms/editors/checkbox-group.component'; @@ -17,10 +23,6 @@ export * from './angular/forms/editors/json-editor.component'; export * from './angular/forms/editors/stars.component'; export * from './angular/forms/editors/tag-editor.component'; export * from './angular/forms/editors/toggle.component'; - -export * from './angular/forms/confirm-click.directive'; -export * from './angular/forms/control-errors.component'; -export * from './angular/forms/copy.directive'; export * from './angular/forms/file-drop.directive'; export * from './angular/forms/focus-on-init.directive'; export * from './angular/forms/form-alert.component'; @@ -32,11 +34,13 @@ export * from './angular/forms/progress-bar.component'; export * from './angular/forms/string-form-control'; export * from './angular/forms/transform-input.directive'; export * from './angular/forms/validators'; - +export * from './angular/highlight.pipe'; +export * from './angular/hover-background.directive'; export * from './angular/http/caching.interceptor'; -export * from './angular/http/loading.interceptor'; export * from './angular/http/http-extensions'; - +export * from './angular/http/loading.interceptor'; +export * from './angular/image-source.directive'; +export * from './angular/list-view.component'; export * from './angular/modals/dialog-renderer.component'; export * from './angular/modals/modal-dialog.component'; export * from './angular/modals/modal-placement.directive'; @@ -44,7 +48,9 @@ export * from './angular/modals/modal.directive'; export * from './angular/modals/onboarding-tooltip.component'; export * from './angular/modals/root-view.component'; export * from './angular/modals/tooltip.directive'; - +export * from './angular/pager.component'; +export * from './angular/panel-container.directive'; +export * from './angular/panel.component'; export * from './angular/pipes/colors.pipes'; export * from './angular/pipes/date-time.pipes'; export * from './angular/pipes/keys.pipe'; @@ -52,22 +58,10 @@ export * from './angular/pipes/markdown.pipe'; export * from './angular/pipes/money.pipe'; export * from './angular/pipes/name.pipe'; export * from './angular/pipes/numbers.pipes'; - -export * from './angular/routers/can-deactivate.guard'; -export * from './angular/routers/parent-link.directive'; - -export * from './angular/avatar.component'; -export * from './angular/code.component'; -export * from './angular/external-link.directive'; -export * from './angular/highlight.pipe'; -export * from './angular/hover-background.directive'; -export * from './angular/image-source.directive'; -export * from './angular/list-view.component'; -export * from './angular/pager.component'; -export * from './angular/panel-container.directive'; -export * from './angular/panel.component'; export * from './angular/popup-link.directive'; export * from './angular/resized.directive'; +export * from './angular/routers/can-deactivate.guard'; +export * from './angular/routers/parent-link.directive'; export * from './angular/safe-html.pipe'; export * from './angular/scroll-active.directive'; export * from './angular/shortcut.component'; @@ -77,7 +71,5 @@ export * from './angular/sync-scrolling.directive'; export * from './angular/sync-width.directive'; export * from './angular/template-wrapper.directive'; export * from './angular/title.component'; - export * from './internal'; - export * from './state'; \ No newline at end of file diff --git a/frontend/app/framework/index.ts b/frontend/app/framework/index.ts index 57b6f79de..f07977061 100644 --- a/frontend/app/framework/index.ts +++ b/frontend/app/framework/index.ts @@ -8,4 +8,4 @@ export * from './declarations'; export * from './module'; -import './utils/array-extensions'; \ No newline at end of file +import './utils/array-extensions'; diff --git a/frontend/app/framework/internal.ts b/frontend/app/framework/internal.ts index 75cfcb18d..8632c37fe 100644 --- a/frontend/app/framework/internal.ts +++ b/frontend/app/framework/internal.ts @@ -5,10 +5,11 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +export * from './angular/animations'; export * from './angular/drag-helper'; export * from './angular/routers/router-utils'; -export * from './angular/animations'; - +export * from './angular/stateful.component'; +export * from './configurations'; export * from './services/analytics.service'; export * from './services/clipboard.service'; export * from './services/dialog.service'; @@ -21,7 +22,6 @@ export * from './services/resource-loader.service'; export * from './services/shortcut.service'; export * from './services/temp.service'; export * from './services/title.service'; - export * from './utils/array-helper'; export * from './utils/date-helper'; export * from './utils/date-time'; @@ -38,8 +38,4 @@ export * from './utils/picasso'; export * from './utils/rxjs-extensions'; export * from './utils/string-helper'; export * from './utils/types'; -export * from './utils/version'; - -export * from './angular/stateful.component'; - -export * from './configurations'; \ No newline at end of file +export * from './utils/version'; \ No newline at end of file diff --git a/frontend/app/framework/module.ts b/frontend/app/framework/module.ts index 76953d953..39f08fd50 100644 --- a/frontend/app/framework/module.ts +++ b/frontend/app/framework/module.ts @@ -5,100 +5,14 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +// tslint:disable: max-line-length + import { CommonModule } from '@angular/common'; import { HTTP_INTERCEPTORS } from '@angular/common/http'; import { ModuleWithProviders, NgModule } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { ColorPickerModule } from 'ngx-color-picker'; - -import { - AnalyticsService, - AutocompleteComponent, - AvatarComponent, - CachingInterceptor, - CanDeactivateGuard, - CheckboxGroupComponent, - ClipboardService, - CodeComponent, - CodeEditorComponent, - ColorPickerComponent, - ConfirmClickDirective, - ControlErrorsComponent, - CopyDirective, - DarkenPipe, - DatePipe, - DateTimeEditorComponent, - DayOfWeekPipe, - DayPipe, - DialogRendererComponent, - DialogService, - DisplayNamePipe, - DropdownComponent, - DurationPipe, - EditableTitleComponent, - ExternalLinkDirective, - FileDropDirective, - FileSizePipe, - FocusOnInitDirective, - FormAlertComponent, - FormErrorComponent, - FormHintComponent, - FromNowPipe, - FullDateTimePipe, - HighlightPipe, - HoverBackgroundDirective, - IFrameEditorComponent, - ImageSourceDirective, - IndeterminateValueDirective, - ISODatePipe, - JsonEditorComponent, - KeysPipe, - KNumberPipe, - LightenPipe, - ListViewComponent, - LoadingInterceptor, - LoadingService, - LocalStoreService, - MarkdownPipe, - MessageBus, - ModalDialogComponent, - ModalDirective, - ModalPlacementDirective, - MoneyPipe, - MonthPipe, - OnboardingService, - OnboardingTooltipComponent, - PagerComponent, - PanelComponent, - PanelContainerDirective, - ParentLinkDirective, - PopupLinkDirective, - ProgressBarComponent, - ResizedDirective, - ResizeService, - ResourceLoaderService, - RootViewComponent, - SafeHtmlPipe, - SafeUrlPipe, - ScrollActiveDirective, - ShortcutComponent, - ShortcutService, - ShortDatePipe, - ShortTimePipe, - StarsComponent, - StatusIconComponent, - StopClickDirective, - SyncScollingDirective, - SyncWidthDirective, - TagEditorComponent, - TemplateWrapperDirective, - TempService, - TitleComponent, - TitleService, - ToggleComponent, - TooltipDirective, - TransformInputDirective -} from './declarations'; +import { ColorPickerModule } from 'ngx-color-picker'; +import { AnalyticsService, AutocompleteComponent, AvatarComponent, CachingInterceptor, CanDeactivateGuard, CheckboxGroupComponent, ClipboardService, CodeComponent, CodeEditorComponent, ColorPickerComponent, ConfirmClickDirective, ControlErrorsComponent, CopyDirective, DarkenPipe, DatePipe, DateTimeEditorComponent, DayOfWeekPipe, DayPipe, DialogRendererComponent, DialogService, DisplayNamePipe, DropdownComponent, DurationPipe, EditableTitleComponent, ExternalLinkDirective, FileDropDirective, FileSizePipe, FocusOnInitDirective, FormAlertComponent, FormErrorComponent, FormHintComponent, FromNowPipe, FullDateTimePipe, HighlightPipe, HoverBackgroundDirective, IFrameEditorComponent, ImageSourceDirective, IndeterminateValueDirective, ISODatePipe, JsonEditorComponent, KeysPipe, KNumberPipe, LightenPipe, ListViewComponent, LoadingInterceptor, LoadingService, LocalStoreService, MarkdownPipe, MessageBus, ModalDialogComponent, ModalDirective, ModalPlacementDirective, MoneyPipe, MonthPipe, OnboardingService, OnboardingTooltipComponent, PagerComponent, PanelComponent, PanelContainerDirective, ParentLinkDirective, PopupLinkDirective, ProgressBarComponent, ResizedDirective, ResizeService, ResourceLoaderService, RootViewComponent, SafeHtmlPipe, SafeUrlPipe, ScrollActiveDirective, ShortcutComponent, ShortcutService, ShortDatePipe, ShortTimePipe, StarsComponent, StatusIconComponent, StopClickDirective, SyncScollingDirective, SyncWidthDirective, TagEditorComponent, TemplateWrapperDirective, TempService, TitleComponent, TitleService, ToggleComponent, TooltipDirective, TransformInputDirective } from './declarations'; @NgModule({ imports: [ diff --git a/frontend/app/framework/services/analytics.service.ts b/frontend/app/framework/services/analytics.service.ts index 0fdae40ca..7757208e4 100644 --- a/frontend/app/framework/services/analytics.service.ts +++ b/frontend/app/framework/services/analytics.service.ts @@ -5,12 +5,11 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -// tslint:disable:only-arrow-functions +// tslint:disable: only-arrow-functions import { Injectable } from '@angular/core'; import { NavigationEnd, Router } from '@angular/router'; import { filter } from 'rxjs/operators'; - import { UIOptions } from './../configurations'; import { Types } from './../utils/types'; import { ResourceLoaderService } from './resource-loader.service'; diff --git a/frontend/app/framework/services/dialog.service.spec.ts b/frontend/app/framework/services/dialog.service.spec.ts index 5337b2684..a477ca173 100644 --- a/frontend/app/framework/services/dialog.service.spec.ts +++ b/frontend/app/framework/services/dialog.service.spec.ts @@ -5,13 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { - DialogRequest, - DialogService, - DialogServiceFactory, - Notification, - Tooltip -} from './dialog.service'; +import { DialogRequest, DialogService, DialogServiceFactory, Notification, Tooltip } from './dialog.service'; describe('DialogService', () => { it('should instantiate from factory', () => { diff --git a/frontend/app/framework/services/dialog.service.ts b/frontend/app/framework/services/dialog.service.ts index 1def51649..ab29e9044 100644 --- a/frontend/app/framework/services/dialog.service.ts +++ b/frontend/app/framework/services/dialog.service.ts @@ -7,7 +7,6 @@ import { Injectable } from '@angular/core'; import { Observable, Subject, throwError } from 'rxjs'; - import { ErrorDto } from './../utils/error'; import { Types } from './../utils/types'; diff --git a/frontend/app/framework/services/loading.service.spec.ts b/frontend/app/framework/services/loading.service.spec.ts index 2e7b8128d..6ddd3afb7 100644 --- a/frontend/app/framework/services/loading.service.spec.ts +++ b/frontend/app/framework/services/loading.service.spec.ts @@ -7,7 +7,6 @@ import { Event, NavigationError, NavigationStart } from '@angular/router'; import { Subject } from 'rxjs'; - import { LoadingService, LoadingServiceFactory } from './loading.service'; describe('LoadingService', () => { diff --git a/frontend/app/framework/services/loading.service.ts b/frontend/app/framework/services/loading.service.ts index 5cdc53ba7..6b96ee548 100644 --- a/frontend/app/framework/services/loading.service.ts +++ b/frontend/app/framework/services/loading.service.ts @@ -9,7 +9,6 @@ import { Injectable, OnDestroy } from '@angular/core'; import { NavigationCancel, NavigationEnd, NavigationError, NavigationStart, Router } from '@angular/router'; import { BehaviorSubject, Observable, Subscription } from 'rxjs'; import { map } from 'rxjs/operators'; - import { Types } from './../utils/types'; export const LoadingServiceFactory = (router: Router) => { diff --git a/frontend/app/framework/services/local-store.service.ts b/frontend/app/framework/services/local-store.service.ts index d3a60490a..619c783e5 100644 --- a/frontend/app/framework/services/local-store.service.ts +++ b/frontend/app/framework/services/local-store.service.ts @@ -6,7 +6,6 @@ */ import { Injectable } from '@angular/core'; - import { Types } from './../utils/types'; export const LocalStoreServiceFactory = () => { diff --git a/frontend/app/framework/services/onboarding.service.spec.ts b/frontend/app/framework/services/onboarding.service.spec.ts index 715a189d7..505d9c5c0 100644 --- a/frontend/app/framework/services/onboarding.service.spec.ts +++ b/frontend/app/framework/services/onboarding.service.spec.ts @@ -5,9 +5,8 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { OnboardingService, OnboardingServiceFactory } from './onboarding.service'; - import { UIOptions } from './../configurations'; +import { OnboardingService, OnboardingServiceFactory } from './onboarding.service'; class LocalStoreMock { private store = {}; diff --git a/frontend/app/framework/services/onboarding.service.ts b/frontend/app/framework/services/onboarding.service.ts index 01d00ae08..ff68f4350 100644 --- a/frontend/app/framework/services/onboarding.service.ts +++ b/frontend/app/framework/services/onboarding.service.ts @@ -6,10 +6,8 @@ */ import { Injectable } from '@angular/core'; - -import { LocalStoreService } from './local-store.service'; - import { UIOptions } from './../configurations'; +import { LocalStoreService } from './local-store.service'; export const OnboardingServiceFactory = (uiOptions: UIOptions, localStore: LocalStoreService) => { return new OnboardingService(uiOptions, localStore); diff --git a/frontend/app/framework/services/resize.service.ts b/frontend/app/framework/services/resize.service.ts index 84fd7164b..bb75cc816 100644 --- a/frontend/app/framework/services/resize.service.ts +++ b/frontend/app/framework/services/resize.service.ts @@ -6,7 +6,6 @@ */ import { Injectable, OnDestroy } from '@angular/core'; - import ResizeObserver from 'resize-observer-polyfill'; export interface ResizeListener { diff --git a/frontend/app/framework/services/shortcut.service.ts b/frontend/app/framework/services/shortcut.service.ts index 96f2f9084..92dd7fab9 100644 --- a/frontend/app/framework/services/shortcut.service.ts +++ b/frontend/app/framework/services/shortcut.service.ts @@ -6,7 +6,6 @@ */ import { Injectable } from '@angular/core'; - import * as Mousetrap from 'mousetrap'; export const ShortcutServiceFactory = () => { diff --git a/frontend/app/framework/services/title.service.spec.ts b/frontend/app/framework/services/title.service.spec.ts index ed7b49918..06383d691 100644 --- a/frontend/app/framework/services/title.service.spec.ts +++ b/frontend/app/framework/services/title.service.spec.ts @@ -5,11 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { - TitlesConfig, - TitleService, - TitleServiceFactory -} from './title.service'; +import { TitlesConfig, TitleService, TitleServiceFactory } from './title.service'; describe('TitleService', () => { beforeEach(() => { diff --git a/frontend/app/framework/state.ts b/frontend/app/framework/state.ts index 39b66d774..18a9b51bd 100644 --- a/frontend/app/framework/state.ts +++ b/frontend/app/framework/state.ts @@ -8,9 +8,7 @@ import { AbstractControl } from '@angular/forms'; import { BehaviorSubject, combineLatest, Observable } from 'rxjs'; import { distinctUntilChanged, map, shareReplay } from 'rxjs/operators'; - import { getRawValue } from './angular/forms/forms-helper'; - import { ErrorDto } from './utils/error'; import { ResourceLinks } from './utils/hateos'; import { Types } from './utils/types'; diff --git a/frontend/app/framework/utils/date-time.ts b/frontend/app/framework/utils/date-time.ts index 5d5b1d9d2..98152a189 100644 --- a/frontend/app/framework/utils/date-time.ts +++ b/frontend/app/framework/utils/date-time.ts @@ -6,7 +6,6 @@ */ import { addDays, addHours, addMilliseconds, addMinutes, addMonths, addSeconds, addYears, format, formatDistanceToNow, parse, parseISO, startOfDay, startOfMonth, startOfTomorrow, startOfWeek, startOfYesterday } from 'date-fns'; - import { DateHelper } from './date-helper'; const DATE_FORMAT = 'yyyy-MM-dd'; diff --git a/frontend/app/framework/utils/pager.spec.ts b/frontend/app/framework/utils/pager.spec.ts index 2d73c868a..382761b7b 100644 --- a/frontend/app/framework/utils/pager.spec.ts +++ b/frontend/app/framework/utils/pager.spec.ts @@ -6,10 +6,8 @@ */ import { Mock, Times } from 'typemoq'; - -import { Pager } from './pager'; - import { LocalStoreService } from './../services/local-store.service'; +import { Pager } from './pager'; describe('Pager', () => { it('should init with default values', () => { diff --git a/frontend/app/framework/utils/rxjs-extensions.ts b/frontend/app/framework/utils/rxjs-extensions.ts index c32515b02..2d5274746 100644 --- a/frontend/app/framework/utils/rxjs-extensions.ts +++ b/frontend/app/framework/utils/rxjs-extensions.ts @@ -9,14 +9,8 @@ import { empty, Observable } from 'rxjs'; import { catchError, distinctUntilChanged, filter, map, onErrorResumeNext, publishReplay, refCount, switchMap } from 'rxjs/operators'; - import { DialogService } from './../services/dialog.service'; - -import { - Version, - versioned, - Versioned -} from './version'; +import { Version, versioned, Versioned } from './version'; export function mapVersioned(project: (value: T, version: Version) => R) { return function mapOperation(source: Observable>) { diff --git a/frontend/app/shared/components/app-form.component.ts b/frontend/app/shared/components/app-form.component.ts index 561db49cc..e5cd23f28 100644 --- a/frontend/app/shared/components/app-form.component.ts +++ b/frontend/app/shared/components/app-form.component.ts @@ -7,12 +7,7 @@ import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; import { FormBuilder } from '@angular/forms'; - -import { - ApiUrlConfig, - AppsState, - CreateAppForm -} from '@app/shared/internal'; +import { ApiUrlConfig, AppsState, CreateAppForm } from '@app/shared/internal'; @Component({ selector: 'sqx-app-form', diff --git a/frontend/app/shared/components/assets/asset-dialog.component.ts b/frontend/app/shared/components/assets/asset-dialog.component.ts index 8f50f945a..f97694cd1 100644 --- a/frontend/app/shared/components/assets/asset-dialog.component.ts +++ b/frontend/app/shared/components/assets/asset-dialog.component.ts @@ -7,19 +7,7 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, OnChanges, Output, QueryList, ViewChildren } from '@angular/core'; import { FormBuilder } from '@angular/forms'; - -import { - AnnotateAssetDto, - AnnotateAssetForm, - AssetDto, - AssetsState, - AssetUploaderState, - AuthService, - DialogService, - Types, - UploadCanceled -} from '@app/shared/internal'; - +import { AnnotateAssetDto, AnnotateAssetForm, AssetDto, AssetsState, AssetUploaderState, AuthService, DialogService, Types, UploadCanceled } from '@app/shared/internal'; import { ImageCropperComponent } from './image-cropper.component'; import { ImageFocusPointComponent } from './image-focus-point.component'; diff --git a/frontend/app/shared/components/assets/asset-folder-dialog.component.ts b/frontend/app/shared/components/assets/asset-folder-dialog.component.ts index b74b5c11d..53ce89627 100644 --- a/frontend/app/shared/components/assets/asset-folder-dialog.component.ts +++ b/frontend/app/shared/components/assets/asset-folder-dialog.component.ts @@ -7,12 +7,7 @@ import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { FormBuilder } from '@angular/forms'; - -import { - AssetFolderDto, - AssetsState, - RenameAssetFolderForm -} from '@app/shared/internal'; +import { AssetFolderDto, AssetsState, RenameAssetFolderForm } from '@app/shared/internal'; @Component({ selector: 'sqx-asset-folder-dialog', diff --git a/frontend/app/shared/components/assets/asset-folder.component.ts b/frontend/app/shared/components/assets/asset-folder.component.ts index f6c53afeb..fd4dfbb49 100644 --- a/frontend/app/shared/components/assets/asset-folder.component.ts +++ b/frontend/app/shared/components/assets/asset-folder.component.ts @@ -6,15 +6,7 @@ */ import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; - -import { - AssetFolderDto, - AssetPathItem, - DialogModel, - fadeAnimation, - ModalModel, - Types -} from '@app/shared/internal'; +import { AssetFolderDto, AssetPathItem, DialogModel, fadeAnimation, ModalModel, Types } from '@app/shared/internal'; @Component({ selector: 'sqx-asset-folder', diff --git a/frontend/app/shared/components/assets/asset-history.component.ts b/frontend/app/shared/components/assets/asset-history.component.ts index 4971b0f00..554b874f6 100644 --- a/frontend/app/shared/components/assets/asset-history.component.ts +++ b/frontend/app/shared/components/assets/asset-history.component.ts @@ -6,16 +6,10 @@ */ import { Component, Input, OnChanges } from '@angular/core'; +import { AppsState, AssetDto, HistoryEventDto, HistoryService } from '@app/shared/internal'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { - AppsState, - AssetDto, - HistoryEventDto, - HistoryService -} from '@app/shared/internal'; - interface AssetEvent { event: HistoryEventDto; fileVersion: number; canDownload: boolean; } @Component({ diff --git a/frontend/app/shared/components/assets/asset-path.component.ts b/frontend/app/shared/components/assets/asset-path.component.ts index fbba57145..0858b5b60 100644 --- a/frontend/app/shared/components/assets/asset-path.component.ts +++ b/frontend/app/shared/components/assets/asset-path.component.ts @@ -6,7 +6,6 @@ */ import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; - import { AssetPathItem } from '@app/shared/internal'; @Component({ diff --git a/frontend/app/shared/components/assets/asset-uploader.component.ts b/frontend/app/shared/components/assets/asset-uploader.component.ts index a391f59ec..0ed0d8119 100644 --- a/frontend/app/shared/components/assets/asset-uploader.component.ts +++ b/frontend/app/shared/components/assets/asset-uploader.component.ts @@ -6,16 +6,7 @@ */ import { ChangeDetectionStrategy, Component } from '@angular/core'; - -import { - AssetsState, - AssetUploaderState, - fadeAnimation, - ModalModel, - Upload -} from '@app/shared/internal'; - -import { AppsState } from '@app/shared/internal'; +import { AppsState, AssetsState, AssetUploaderState, fadeAnimation, ModalModel, Upload } from '@app/shared/internal'; @Component({ selector: 'sqx-asset-uploader', diff --git a/frontend/app/shared/components/assets/asset.component.ts b/frontend/app/shared/components/assets/asset.component.ts index 6dc480d23..c79f9bb2a 100644 --- a/frontend/app/shared/components/assets/asset.component.ts +++ b/frontend/app/shared/components/assets/asset.component.ts @@ -6,16 +6,7 @@ */ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, HostBinding, Input, OnInit, Output } from '@angular/core'; - -import { - AssetDto, - AssetsState, - AssetUploaderState, - DialogModel, - DialogService, - Types, - UploadCanceled -} from '@app/shared/internal'; +import { AssetDto, AssetsState, AssetUploaderState, DialogModel, DialogService, Types, UploadCanceled } from '@app/shared/internal'; @Component({ selector: 'sqx-asset', diff --git a/frontend/app/shared/components/assets/assets-list.component.ts b/frontend/app/shared/components/assets/assets-list.component.ts index ff6432500..e3ed24c71 100644 --- a/frontend/app/shared/components/assets/assets-list.component.ts +++ b/frontend/app/shared/components/assets/assets-list.component.ts @@ -7,14 +7,7 @@ import { CdkDrag, CdkDragDrop, CdkDropList } from '@angular/cdk/drag-drop'; import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, Output } from '@angular/core'; - -import { - AssetDto, - AssetFolderDto, - AssetsState, - getFiles, - Types -} from '@app/shared/internal'; +import { AssetDto, AssetFolderDto, AssetsState, getFiles, Types } from '@app/shared/internal'; @Component({ selector: 'sqx-assets-list', diff --git a/frontend/app/shared/components/assets/assets-selector.component.ts b/frontend/app/shared/components/assets/assets-selector.component.ts index 258846251..066487fec 100644 --- a/frontend/app/shared/components/assets/assets-selector.component.ts +++ b/frontend/app/shared/components/assets/assets-selector.component.ts @@ -6,14 +6,7 @@ */ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, OnInit, Output } from '@angular/core'; - -import { - AssetDto, - AssetsState, - LocalStoreService, - Query, - StatefulComponent -} from '@app/shared/internal'; +import { AssetDto, AssetsState, LocalStoreService, Query, StatefulComponent } from '@app/shared/internal'; interface State { // The selected assets. diff --git a/frontend/app/shared/components/assets/image-cropper.component.ts b/frontend/app/shared/components/assets/image-cropper.component.ts index 5dfe777ff..3d13f3201 100644 --- a/frontend/app/shared/components/assets/image-cropper.component.ts +++ b/frontend/app/shared/components/assets/image-cropper.component.ts @@ -6,9 +6,8 @@ */ import { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, Input, OnChanges, OnDestroy, ViewChild } from '@angular/core'; -import Cropper from 'cropperjs'; - import { Types } from '@app/framework'; +import Cropper from 'cropperjs'; @Component({ selector: 'sqx-image-editor', diff --git a/frontend/app/shared/components/assets/image-focus-point.component.ts b/frontend/app/shared/components/assets/image-focus-point.component.ts index da1be3232..9da5da145 100644 --- a/frontend/app/shared/components/assets/image-focus-point.component.ts +++ b/frontend/app/shared/components/assets/image-focus-point.component.ts @@ -8,11 +8,9 @@ // tslint:disable: readonly-array import { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, Input, OnChanges, OnDestroy, ViewChild } from '@angular/core'; -import { FocusedImage, FocusPicker } from 'image-focus'; - import { Types } from '@app/framework'; - import { AnnotateAssetDto, AssetDto } from '@app/shared/services/assets.service'; +import { FocusedImage, FocusPicker } from 'image-focus'; @Component({ selector: 'sqx-image-focus-point', diff --git a/frontend/app/shared/components/assets/pipes.ts b/frontend/app/shared/components/assets/pipes.ts index 506f1e672..5c6459a86 100644 --- a/frontend/app/shared/components/assets/pipes.ts +++ b/frontend/app/shared/components/assets/pipes.ts @@ -6,15 +6,7 @@ */ import { Pipe, PipeTransform } from '@angular/core'; - -import { - ApiUrlConfig, - AssetDto, - AuthService, - MathHelper, - StringHelper, - Types -} from '@app/shared/internal'; +import { ApiUrlConfig, AssetDto, AuthService, MathHelper, StringHelper, Types } from '@app/shared/internal'; @Pipe({ name: 'sqxAssetUrl', diff --git a/frontend/app/shared/components/comments/comment.component.ts b/frontend/app/shared/components/comments/comment.component.ts index 9256579e4..f84ad2eca 100644 --- a/frontend/app/shared/components/comments/comment.component.ts +++ b/frontend/app/shared/components/comments/comment.component.ts @@ -6,16 +6,9 @@ */ import { ChangeDetectionStrategy, Component, Input, OnChanges } from '@angular/core'; +import { CommentDto, CommentsState, ContributorDto, DialogService, Keys } from '@app/shared/internal'; import { MentionConfig } from 'angular-mentions'; -import { - CommentDto, - CommentsState, - ContributorDto, - DialogService, - Keys -} from '@app/shared/internal'; - @Component({ selector: 'sqx-comment', styleUrls: ['./comment.component.scss'], diff --git a/frontend/app/shared/components/comments/comments.component.ts b/frontend/app/shared/components/comments/comments.component.ts index 1186183e4..c8bfa7f1f 100644 --- a/frontend/app/shared/components/comments/comments.component.ts +++ b/frontend/app/shared/components/comments/comments.component.ts @@ -8,22 +8,10 @@ import { ChangeDetectorRef, Component, ElementRef, Input, OnInit, QueryList, ViewChild, ViewChildren } from '@angular/core'; import { FormBuilder } from '@angular/forms'; import { Router } from '@angular/router'; +import { AppsState, AuthService, CommentDto, CommentsService, CommentsState, ContributorsState, DialogService, ResourceOwner, UpsertCommentForm } from '@app/shared/internal'; import { MentionConfig } from 'angular-mentions'; import { timer } from 'rxjs'; import { onErrorResumeNext, switchMap } from 'rxjs/operators'; - -import { - AppsState, - AuthService, - CommentDto, - CommentsService, - CommentsState, - ContributorsState, - DialogService, - ResourceOwner, - UpsertCommentForm -} from '@app/shared/internal'; - import { CommentComponent } from './comment.component'; @Component({ diff --git a/frontend/app/shared/components/forms/geolocation-editor.component.ts b/frontend/app/shared/components/forms/geolocation-editor.component.ts index a226f190e..b69322344 100644 --- a/frontend/app/shared/components/forms/geolocation-editor.component.ts +++ b/frontend/app/shared/components/forms/geolocation-editor.component.ts @@ -7,15 +7,7 @@ import { AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, forwardRef, ViewChild } from '@angular/core'; import { FormBuilder, NG_VALUE_ACCESSOR } from '@angular/forms'; - -import { - LocalStoreService, - ResourceLoaderService, - StatefulControlComponent, - Types, - UIOptions, - ValidatorsEx -} from '@app/shared/internal'; +import { LocalStoreService, ResourceLoaderService, StatefulControlComponent, Types, UIOptions, ValidatorsEx } from '@app/shared/internal'; declare var L: any; declare var google: any; diff --git a/frontend/app/shared/components/forms/language-selector.component.ts b/frontend/app/shared/components/forms/language-selector.component.ts index c649ef4fd..ec61f8273 100644 --- a/frontend/app/shared/components/forms/language-selector.component.ts +++ b/frontend/app/shared/components/forms/language-selector.component.ts @@ -6,12 +6,7 @@ */ import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, OnInit, Output } from '@angular/core'; - -import { - fadeAnimation, - LanguageDto, - ModalModel -} from '@app/shared/internal'; +import { fadeAnimation, LanguageDto, ModalModel } from '@app/shared/internal'; export interface Language { iso2Code: string; englishName: string; isMasterLanguage: true; } diff --git a/frontend/app/shared/components/forms/markdown-editor.component.ts b/frontend/app/shared/components/forms/markdown-editor.component.ts index 074f0628d..b8a3c0972 100644 --- a/frontend/app/shared/components/forms/markdown-editor.component.ts +++ b/frontend/app/shared/components/forms/markdown-editor.component.ts @@ -7,19 +7,9 @@ import { AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, forwardRef, Renderer2, ViewChild } from '@angular/core'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; +import { ApiUrlConfig, AssetDto, AssetUploaderState, DialogModel, ResourceLoaderService, StatefulControlComponent, Types, UploadCanceled } from '@app/shared/internal'; import marked from 'marked'; -import { - ApiUrlConfig, - AssetDto, - AssetUploaderState, - DialogModel, - ResourceLoaderService, - StatefulControlComponent, - Types, - UploadCanceled -} from '@app/shared/internal'; - declare var SimpleMDE: any; export const SQX_MARKDOWN_EDITOR_CONTROL_VALUE_ACCESSOR: any = { diff --git a/frontend/app/shared/components/forms/references-dropdown.component.ts b/frontend/app/shared/components/forms/references-dropdown.component.ts index 23522fa9e..34268523f 100644 --- a/frontend/app/shared/components/forms/references-dropdown.component.ts +++ b/frontend/app/shared/components/forms/references-dropdown.component.ts @@ -7,18 +7,7 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, forwardRef, Input, OnChanges, SimpleChanges } from '@angular/core'; import { FormControl, NG_VALUE_ACCESSOR } from '@angular/forms'; - -import { - AppsState, - ContentDto, - ContentsService, - getContentValue, - LanguageDto, - StatefulControlComponent, - Types, - UIOptions, - value$ -} from '@app/shared/internal'; +import { AppsState, ContentDto, ContentsService, getContentValue, LanguageDto, StatefulControlComponent, Types, UIOptions, value$ } from '@app/shared/internal'; export const SQX_REFERENCES_DROPDOWN_CONTROL_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => ReferencesDropdownComponent), multi: true diff --git a/frontend/app/shared/components/forms/references-tags.component.ts b/frontend/app/shared/components/forms/references-tags.component.ts index d79b007b8..a6fccc18f 100644 --- a/frontend/app/shared/components/forms/references-tags.component.ts +++ b/frontend/app/shared/components/forms/references-tags.component.ts @@ -7,18 +7,7 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, forwardRef, Input, OnChanges, SimpleChanges } from '@angular/core'; import { FormControl, NG_VALUE_ACCESSOR } from '@angular/forms'; - -import { - AppsState, - ContentDto, - ContentsService, - Converter, - getContentValue, - LanguageDto, - StatefulControlComponent, - TagValue, - UIOptions -} from '@app/shared/internal'; +import { AppsState, ContentDto, ContentsService, Converter, getContentValue, LanguageDto, StatefulControlComponent, TagValue, UIOptions } from '@app/shared/internal'; export const SQX_REFERENCES_TAGS_CONTROL_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => ReferencesTagsComponent), multi: true diff --git a/frontend/app/shared/components/forms/rich-editor.component.ts b/frontend/app/shared/components/forms/rich-editor.component.ts index 7413dadc4..639ce88b9 100644 --- a/frontend/app/shared/components/forms/rich-editor.component.ts +++ b/frontend/app/shared/components/forms/rich-editor.component.ts @@ -5,21 +5,11 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -// tslint:disable:prefer-for-of +// tslint:disable: prefer-for-of import { AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, EventEmitter, forwardRef, OnDestroy, Output, ViewChild } from '@angular/core'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; - -import { - ApiUrlConfig, - AssetDto, - AssetUploaderState, - DialogModel, - ResourceLoaderService, - StatefulControlComponent, - Types, - UploadCanceled -} from '@app/shared/internal'; +import { ApiUrlConfig, AssetDto, AssetUploaderState, DialogModel, ResourceLoaderService, StatefulControlComponent, Types, UploadCanceled } from '@app/shared/internal'; declare var tinymce: any; diff --git a/frontend/app/shared/components/help/help.component.ts b/frontend/app/shared/components/help/help.component.ts index 28201a985..8731d13ba 100644 --- a/frontend/app/shared/components/help/help.component.ts +++ b/frontend/app/shared/components/help/help.component.ts @@ -7,7 +7,6 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; - import { HelpService } from '@app/shared/internal'; @Component({ diff --git a/frontend/app/shared/components/history/history-list.component.ts b/frontend/app/shared/components/history/history-list.component.ts index cebf2ee97..7040267ae 100644 --- a/frontend/app/shared/components/history/history-list.component.ts +++ b/frontend/app/shared/components/history/history-list.component.ts @@ -6,7 +6,6 @@ */ import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; - import { HistoryEventDto } from '@app/shared/internal'; @Component({ diff --git a/frontend/app/shared/components/history/history.component.ts b/frontend/app/shared/components/history/history.component.ts index 7dfb2c120..97bcf74c1 100644 --- a/frontend/app/shared/components/history/history.component.ts +++ b/frontend/app/shared/components/history/history.component.ts @@ -7,19 +7,10 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; +import { allParams, AppsState, HistoryChannelUpdated, HistoryEventDto, HistoryService, MessageBus, switchSafe } from '@app/shared/internal'; import { merge, Observable, timer } from 'rxjs'; import { delay } from 'rxjs/operators'; -import { - allParams, - AppsState, - HistoryChannelUpdated, - HistoryEventDto, - HistoryService, - MessageBus, - switchSafe -} from '@app/shared/internal'; - @Component({ selector: 'sqx-history', styleUrls: ['./history.component.scss'], diff --git a/frontend/app/shared/components/history/pipes.ts b/frontend/app/shared/components/history/pipes.ts index 57e896769..95f1818d4 100644 --- a/frontend/app/shared/components/history/pipes.ts +++ b/frontend/app/shared/components/history/pipes.ts @@ -5,17 +5,12 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -// tslint:disable:no-pipe-impure +// tslint:disable: no-pipe-impure import { ChangeDetectorRef, OnDestroy, Pipe, PipeTransform } from '@angular/core'; +import { formatHistoryMessage, HistoryEventDto, UsersProviderService } from '@app/shared/internal'; import { Subscription } from 'rxjs'; -import { - formatHistoryMessage, - HistoryEventDto, - UsersProviderService -} from '@app/shared/internal'; - @Pipe({ name: 'sqxHistoryMessage', pure: false diff --git a/frontend/app/shared/components/pipes.ts b/frontend/app/shared/components/pipes.ts index 37c0fec96..defc7ed50 100644 --- a/frontend/app/shared/components/pipes.ts +++ b/frontend/app/shared/components/pipes.ts @@ -5,18 +5,13 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -// tslint:disable:no-pipe-impure +// tslint:disable: no-pipe-impure import { ChangeDetectorRef, OnDestroy, Pipe, PipeTransform } from '@angular/core'; +import { ApiUrlConfig, UserDto, UsersProviderService } from '@app/shared/internal'; import { Observable, of, Subscription } from 'rxjs'; import { map } from 'rxjs/operators'; -import { - ApiUrlConfig, - UserDto, - UsersProviderService -} from '@app/shared/internal'; - class UserAsyncPipe implements OnDestroy { private lastUserId: string; private lastValue: string | undefined = undefined; diff --git a/frontend/app/shared/components/schema-category.component.ts b/frontend/app/shared/components/schema-category.component.ts index b8b2bee29..0db928193 100644 --- a/frontend/app/shared/components/schema-category.component.ts +++ b/frontend/app/shared/components/schema-category.component.ts @@ -7,15 +7,7 @@ import { CdkDragDrop } from '@angular/cdk/drag-drop'; import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core'; - -import { - fadeAnimation, - LocalStoreService, - SchemaCategory, - SchemaDto, - SchemasState, - StatefulComponent -} from '@app/shared/internal'; +import { fadeAnimation, LocalStoreService, SchemaCategory, SchemaDto, SchemasState, StatefulComponent } from '@app/shared/internal'; interface State { // The filtered schemas. diff --git a/frontend/app/shared/components/search/queries/filter-comparison.component.ts b/frontend/app/shared/components/search/queries/filter-comparison.component.ts index 13227c73e..3c574b69d 100644 --- a/frontend/app/shared/components/search/queries/filter-comparison.component.ts +++ b/frontend/app/shared/components/search/queries/filter-comparison.component.ts @@ -6,14 +6,7 @@ */ import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core'; - -import { - FilterComparison, - LanguageDto, - QueryFieldModel, - QueryModel, - StatusInfo -} from '@app/shared/internal'; +import { FilterComparison, LanguageDto, QueryFieldModel, QueryModel, StatusInfo } from '@app/shared/internal'; @Component({ selector: 'sqx-filter-comparison', diff --git a/frontend/app/shared/components/search/queries/filter-logical.component.ts b/frontend/app/shared/components/search/queries/filter-logical.component.ts index ccc019d65..4b92722d1 100644 --- a/frontend/app/shared/components/search/queries/filter-logical.component.ts +++ b/frontend/app/shared/components/search/queries/filter-logical.component.ts @@ -8,13 +8,7 @@ // tslint:disable: readonly-array import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; - -import { - FilterLogical, - FilterNode, - LanguageDto, - QueryModel -} from '@app/shared/internal'; +import { FilterLogical, FilterNode, LanguageDto, QueryModel } from '@app/shared/internal'; @Component({ selector: 'sqx-filter-logical', diff --git a/frontend/app/shared/components/search/queries/filter-node.component.ts b/frontend/app/shared/components/search/queries/filter-node.component.ts index 6d71635a3..9ebd686b7 100644 --- a/frontend/app/shared/components/search/queries/filter-node.component.ts +++ b/frontend/app/shared/components/search/queries/filter-node.component.ts @@ -6,14 +6,7 @@ */ import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; - -import { - FilterComparison, - FilterLogical, - FilterNode, - LanguageDto, - QueryModel -} from '@app/shared/internal'; +import { FilterComparison, FilterLogical, FilterNode, LanguageDto, QueryModel } from '@app/shared/internal'; @Component({ selector: 'sqx-filter-node', diff --git a/frontend/app/shared/components/search/queries/query-path.component.ts b/frontend/app/shared/components/search/queries/query-path.component.ts index 90faf1138..e50015613 100644 --- a/frontend/app/shared/components/search/queries/query-path.component.ts +++ b/frontend/app/shared/components/search/queries/query-path.component.ts @@ -6,7 +6,6 @@ */ import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; - import { QueryModel } from '@app/shared/internal'; @Component({ diff --git a/frontend/app/shared/components/search/queries/query.component.ts b/frontend/app/shared/components/search/queries/query.component.ts index 6cf8532e7..603c76339 100644 --- a/frontend/app/shared/components/search/queries/query.component.ts +++ b/frontend/app/shared/components/search/queries/query.component.ts @@ -6,12 +6,7 @@ */ import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; - -import { - LanguageDto, - Query, - QueryModel -} from '@app/shared/internal'; +import { LanguageDto, Query, QueryModel } from '@app/shared/internal'; @Component({ selector: 'sqx-query', diff --git a/frontend/app/shared/components/search/queries/sorting.component.ts b/frontend/app/shared/components/search/queries/sorting.component.ts index 21ff5b97d..828a204b5 100644 --- a/frontend/app/shared/components/search/queries/sorting.component.ts +++ b/frontend/app/shared/components/search/queries/sorting.component.ts @@ -6,7 +6,6 @@ */ import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; - import { QueryModel, QuerySorting } from '@app/shared/internal'; @Component({ diff --git a/frontend/app/shared/components/search/query-list.component.ts b/frontend/app/shared/components/search/query-list.component.ts index 1244d585e..ecfb88ea5 100644 --- a/frontend/app/shared/components/search/query-list.component.ts +++ b/frontend/app/shared/components/search/query-list.component.ts @@ -6,12 +6,7 @@ */ import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; - -import { - equalsQuery, - Query, - SavedQuery -} from '@app/shared/internal'; +import { equalsQuery, Query, SavedQuery } from '@app/shared/internal'; @Component({ selector: 'sqx-query-list', diff --git a/frontend/app/shared/components/search/search-form.component.ts b/frontend/app/shared/components/search/search-form.component.ts index b8d472749..a90f11985 100644 --- a/frontend/app/shared/components/search/search-form.component.ts +++ b/frontend/app/shared/components/search/search-form.component.ts @@ -7,18 +7,9 @@ import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core'; import { FormBuilder } from '@angular/forms'; +import { DialogModel, hasFilter, LanguageDto, Queries, Query, QueryModel, SaveQueryForm } from '@app/shared/internal'; import { Observable } from 'rxjs'; -import { - DialogModel, - hasFilter, - LanguageDto, - Queries, - Query, - QueryModel, - SaveQueryForm -} from '@app/shared/internal'; - @Component({ selector: 'sqx-search-form', styleUrls: ['./search-form.component.scss'], diff --git a/frontend/app/shared/components/search/shared-queries.component.ts b/frontend/app/shared/components/search/shared-queries.component.ts index 83d1e4c0f..c1cdebaf0 100644 --- a/frontend/app/shared/components/search/shared-queries.component.ts +++ b/frontend/app/shared/components/search/shared-queries.component.ts @@ -6,7 +6,6 @@ */ import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; - import { Queries, Query } from '@app/shared/internal'; @Component({ diff --git a/frontend/app/shared/components/table-header.component.ts b/frontend/app/shared/components/table-header.component.ts index c70a0cc35..a26202b53 100644 --- a/frontend/app/shared/components/table-header.component.ts +++ b/frontend/app/shared/components/table-header.component.ts @@ -6,13 +6,7 @@ */ import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core'; - -import { - LanguageDto, - Query, - SortMode, - Types -} from '@app/shared/internal'; +import { LanguageDto, Query, SortMode, Types } from '@app/shared/internal'; @Component({ selector: 'sqx-table-header', diff --git a/frontend/app/shared/declarations.ts b/frontend/app/shared/declarations.ts index ae9166bf7..f0b61ff1e 100644 --- a/frontend/app/shared/declarations.ts +++ b/frontend/app/shared/declarations.ts @@ -6,10 +6,6 @@ */ export * from './components/app-form.component'; -export * from './components/pipes'; -export * from './components/schema-category.component'; -export * from './components/table-header.component'; - export * from './components/assets/asset-dialog.component'; export * from './components/assets/asset-folder-dialog.component'; export * from './components/assets/asset-folder.component'; @@ -22,24 +18,21 @@ export * from './components/assets/assets-selector.component'; export * from './components/assets/image-cropper.component'; export * from './components/assets/image-focus-point.component'; export * from './components/assets/pipes'; - export * from './components/comments/comment.component'; export * from './components/comments/comments.component'; - export * from './components/forms/geolocation-editor.component'; export * from './components/forms/language-selector.component'; export * from './components/forms/markdown-editor.component'; export * from './components/forms/references-dropdown.component'; export * from './components/forms/references-tags.component'; export * from './components/forms/rich-editor.component'; - export * from './components/help/help-markdown.pipe'; export * from './components/help/help.component'; - export * from './components/history/history-list.component'; export * from './components/history/history.component'; export * from './components/history/pipes'; - +export * from './components/pipes'; +export * from './components/schema-category.component'; export * from './components/search/queries/filter-comparison.component'; export * from './components/search/queries/filter-logical.component'; export * from './components/search/queries/filter-node.component'; @@ -49,7 +42,7 @@ export * from './components/search/queries/sorting.component'; export * from './components/search/query-list.component'; export * from './components/search/search-form.component'; export * from './components/search/shared-queries.component'; - +export * from './components/table-header.component'; export * from './guards/app-must-exist.guard'; export * from './guards/content-must-exist.guard'; export * from './guards/load-apps.guard'; @@ -61,5 +54,4 @@ export * from './guards/schema-must-exist.guard'; export * from './guards/schema-must-not-be-singleton.guard'; export * from './guards/unset-app.guard'; export * from './guards/unset-content.guard'; - export * from './internal'; \ No newline at end of file diff --git a/frontend/app/shared/guards/app-must-exist.guard.spec.ts b/frontend/app/shared/guards/app-must-exist.guard.spec.ts index b9fc9d884..48a41b6d7 100644 --- a/frontend/app/shared/guards/app-must-exist.guard.spec.ts +++ b/frontend/app/shared/guards/app-must-exist.guard.spec.ts @@ -6,11 +6,9 @@ */ import { Router } from '@angular/router'; +import { AppsState } from '@app/shared'; import { of } from 'rxjs'; import { IMock, Mock, Times } from 'typemoq'; - -import { AppsState } from '@app/shared'; - import { AppMustExistGuard } from './app-must-exist.guard'; describe('AppMustExistGuard', () => { diff --git a/frontend/app/shared/guards/app-must-exist.guard.ts b/frontend/app/shared/guards/app-must-exist.guard.ts index fa3c7c01e..ff568f3a4 100644 --- a/frontend/app/shared/guards/app-must-exist.guard.ts +++ b/frontend/app/shared/guards/app-must-exist.guard.ts @@ -9,7 +9,6 @@ import { Injectable } from '@angular/core'; import { ActivatedRouteSnapshot, CanActivate, Router } from '@angular/router'; import { Observable } from 'rxjs'; import { map, tap } from 'rxjs/operators'; - import { AppsState } from './../state/apps.state'; @Injectable() diff --git a/frontend/app/shared/guards/content-must-exist.guard.spec.ts b/frontend/app/shared/guards/content-must-exist.guard.spec.ts index b54ee76fd..9dd51e1d3 100644 --- a/frontend/app/shared/guards/content-must-exist.guard.spec.ts +++ b/frontend/app/shared/guards/content-must-exist.guard.spec.ts @@ -6,10 +6,9 @@ */ import { Router } from '@angular/router'; +import { ContentDto, ContentsState } from '@app/shared/internal'; import { of } from 'rxjs'; import { IMock, It, Mock, Times } from 'typemoq'; - -import { ContentDto, ContentsState } from '@app/shared/internal'; import { ContentMustExistGuard } from './content-must-exist.guard'; describe('ContentMustExistGuard', () => { diff --git a/frontend/app/shared/guards/content-must-exist.guard.ts b/frontend/app/shared/guards/content-must-exist.guard.ts index 0b8daac42..2aa056bf3 100644 --- a/frontend/app/shared/guards/content-must-exist.guard.ts +++ b/frontend/app/shared/guards/content-must-exist.guard.ts @@ -7,11 +7,9 @@ import { Injectable } from '@angular/core'; import { ActivatedRouteSnapshot, CanActivate, Router } from '@angular/router'; +import { allParams } from '@app/framework'; import { Observable } from 'rxjs'; import { map, tap } from 'rxjs/operators'; - -import { allParams } from '@app/framework'; - import { ContentsState } from './../state/contents.state'; @Injectable() diff --git a/frontend/app/shared/guards/load-apps.guard.spec.ts b/frontend/app/shared/guards/load-apps.guard.spec.ts index b8acca1de..9646209e3 100644 --- a/frontend/app/shared/guards/load-apps.guard.spec.ts +++ b/frontend/app/shared/guards/load-apps.guard.spec.ts @@ -5,11 +5,9 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +import { AppsState } from '@app/shared'; import { of } from 'rxjs'; import { IMock, Mock, Times } from 'typemoq'; - -import { AppsState } from '@app/shared'; - import { LoadAppsGuard } from './load-apps.guard'; describe('LoadAppsGuard', () => { diff --git a/frontend/app/shared/guards/load-apps.guard.ts b/frontend/app/shared/guards/load-apps.guard.ts index 75ae3dfbe..ead7f12bd 100644 --- a/frontend/app/shared/guards/load-apps.guard.ts +++ b/frontend/app/shared/guards/load-apps.guard.ts @@ -9,7 +9,6 @@ import { Injectable } from '@angular/core'; import { CanActivate } from '@angular/router'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; - import { AppsState } from './../state/apps.state'; @Injectable() diff --git a/frontend/app/shared/guards/load-languages.guard.spec.ts b/frontend/app/shared/guards/load-languages.guard.spec.ts index 7b160142d..98abc6e86 100644 --- a/frontend/app/shared/guards/load-languages.guard.spec.ts +++ b/frontend/app/shared/guards/load-languages.guard.spec.ts @@ -5,11 +5,9 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +import { LanguagesState } from '@app/shared'; import { of } from 'rxjs'; import { IMock, Mock, Times } from 'typemoq'; - -import { LanguagesState } from '@app/shared'; - import { LoadLanguagesGuard } from './load-languages.guard'; describe('LoadLanguagesGuard', () => { diff --git a/frontend/app/shared/guards/load-languages.guard.ts b/frontend/app/shared/guards/load-languages.guard.ts index 4565b82c0..45ce8f593 100644 --- a/frontend/app/shared/guards/load-languages.guard.ts +++ b/frontend/app/shared/guards/load-languages.guard.ts @@ -9,7 +9,6 @@ import { Injectable } from '@angular/core'; import { CanActivate } from '@angular/router'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; - import { LanguagesState } from './../state/languages.state'; @Injectable() diff --git a/frontend/app/shared/guards/must-be-authenticated.guard.spec.ts b/frontend/app/shared/guards/must-be-authenticated.guard.spec.ts index e439d95d2..47626719e 100644 --- a/frontend/app/shared/guards/must-be-authenticated.guard.spec.ts +++ b/frontend/app/shared/guards/must-be-authenticated.guard.spec.ts @@ -6,11 +6,9 @@ */ import { Router } from '@angular/router'; +import { AuthService, UIOptions } from '@app/shared'; import { of } from 'rxjs'; import { IMock, It, Mock, Times } from 'typemoq'; - -import { AuthService, UIOptions } from '@app/shared'; - import { MustBeAuthenticatedGuard } from './must-be-authenticated.guard'; describe('MustBeAuthenticatedGuard', () => { diff --git a/frontend/app/shared/guards/must-be-authenticated.guard.ts b/frontend/app/shared/guards/must-be-authenticated.guard.ts index f851720f2..068c7a482 100644 --- a/frontend/app/shared/guards/must-be-authenticated.guard.ts +++ b/frontend/app/shared/guards/must-be-authenticated.guard.ts @@ -7,11 +7,9 @@ import { Injectable } from '@angular/core'; import { CanActivate, Router } from '@angular/router'; +import { UIOptions } from '@app/framework'; import { Observable } from 'rxjs'; import { map, take, tap } from 'rxjs/operators'; - -import { UIOptions } from '@app/framework'; - import { AuthService } from './../services/auth.service'; @Injectable() diff --git a/frontend/app/shared/guards/must-be-not-authenticated.guard.spec.ts b/frontend/app/shared/guards/must-be-not-authenticated.guard.spec.ts index 5448e4071..c3a1c01fb 100644 --- a/frontend/app/shared/guards/must-be-not-authenticated.guard.spec.ts +++ b/frontend/app/shared/guards/must-be-not-authenticated.guard.spec.ts @@ -6,11 +6,9 @@ */ import { Router } from '@angular/router'; +import { AuthService, UIOptions } from '@app/shared'; import { of } from 'rxjs'; import { IMock, It, Mock, Times } from 'typemoq'; - -import { AuthService, UIOptions } from '@app/shared'; - import { MustBeNotAuthenticatedGuard } from './must-be-not-authenticated.guard'; describe('MustBeNotAuthenticatedGuard', () => { diff --git a/frontend/app/shared/guards/must-be-not-authenticated.guard.ts b/frontend/app/shared/guards/must-be-not-authenticated.guard.ts index 0e88a9e26..c3089a528 100644 --- a/frontend/app/shared/guards/must-be-not-authenticated.guard.ts +++ b/frontend/app/shared/guards/must-be-not-authenticated.guard.ts @@ -7,11 +7,9 @@ import { Injectable } from '@angular/core'; import { CanActivate, Router } from '@angular/router'; +import { UIOptions } from '@app/framework'; import { Observable } from 'rxjs'; import { map, take, tap } from 'rxjs/operators'; - -import { UIOptions } from '@app/framework'; - import { AuthService } from './../services/auth.service'; @Injectable() diff --git a/frontend/app/shared/guards/schema-must-exist-published.guard.spec.ts b/frontend/app/shared/guards/schema-must-exist-published.guard.spec.ts index 89028ec95..7c12fbce4 100644 --- a/frontend/app/shared/guards/schema-must-exist-published.guard.spec.ts +++ b/frontend/app/shared/guards/schema-must-exist-published.guard.spec.ts @@ -6,10 +6,9 @@ */ import { Router } from '@angular/router'; +import { SchemaDetailsDto, SchemasState } from '@app/shared/internal'; import { of } from 'rxjs'; import { IMock, It, Mock, Times } from 'typemoq'; - -import { SchemaDetailsDto, SchemasState } from '@app/shared/internal'; import { SchemaMustExistPublishedGuard } from './schema-must-exist-published.guard'; describe('SchemaMustExistPublishedGuard', () => { diff --git a/frontend/app/shared/guards/schema-must-exist-published.guard.ts b/frontend/app/shared/guards/schema-must-exist-published.guard.ts index 02e54b522..279140bf0 100644 --- a/frontend/app/shared/guards/schema-must-exist-published.guard.ts +++ b/frontend/app/shared/guards/schema-must-exist-published.guard.ts @@ -7,11 +7,9 @@ import { Injectable } from '@angular/core'; import { ActivatedRouteSnapshot, CanActivate, Router } from '@angular/router'; +import { allParams } from '@app/framework'; import { Observable } from 'rxjs'; import { map, tap } from 'rxjs/operators'; - -import { allParams } from '@app/framework'; - import { SchemasState } from './../state/schemas.state'; @Injectable() diff --git a/frontend/app/shared/guards/schema-must-exist.guard.spec.ts b/frontend/app/shared/guards/schema-must-exist.guard.spec.ts index f5c4e3475..e720f5ff1 100644 --- a/frontend/app/shared/guards/schema-must-exist.guard.spec.ts +++ b/frontend/app/shared/guards/schema-must-exist.guard.spec.ts @@ -6,10 +6,9 @@ */ import { Router } from '@angular/router'; +import { SchemaDetailsDto, SchemasState } from '@app/shared/internal'; import { of } from 'rxjs'; import { IMock, Mock, Times } from 'typemoq'; - -import { SchemaDetailsDto, SchemasState } from '@app/shared/internal'; import { SchemaMustExistGuard } from './schema-must-exist.guard'; describe('SchemaMustExistGuard', () => { diff --git a/frontend/app/shared/guards/schema-must-exist.guard.ts b/frontend/app/shared/guards/schema-must-exist.guard.ts index 1cde279fe..b727380f6 100644 --- a/frontend/app/shared/guards/schema-must-exist.guard.ts +++ b/frontend/app/shared/guards/schema-must-exist.guard.ts @@ -7,11 +7,9 @@ import { Injectable } from '@angular/core'; import { ActivatedRouteSnapshot, CanActivate, Router } from '@angular/router'; +import { allParams } from '@app/framework'; import { Observable } from 'rxjs'; import { map, tap } from 'rxjs/operators'; - -import { allParams } from '@app/framework'; - import { SchemasState } from './../state/schemas.state'; @Injectable() diff --git a/frontend/app/shared/guards/schema-must-not-be-singleton.guard.spec.ts b/frontend/app/shared/guards/schema-must-not-be-singleton.guard.spec.ts index 2d02ec25a..4a25beaa9 100644 --- a/frontend/app/shared/guards/schema-must-not-be-singleton.guard.spec.ts +++ b/frontend/app/shared/guards/schema-must-not-be-singleton.guard.spec.ts @@ -6,10 +6,9 @@ */ import { Router, RouterStateSnapshot, UrlSegment } from '@angular/router'; +import { SchemaDetailsDto, SchemasState } from '@app/shared/internal'; import { of } from 'rxjs'; import { IMock, It, Mock, Times } from 'typemoq'; - -import { SchemaDetailsDto, SchemasState } from '@app/shared/internal'; import { SchemaMustNotBeSingletonGuard } from './schema-must-not-be-singleton.guard'; describe('SchemaMustNotBeSingletonGuard', () => { diff --git a/frontend/app/shared/guards/schema-must-not-be-singleton.guard.ts b/frontend/app/shared/guards/schema-must-not-be-singleton.guard.ts index 51a955b4d..df026fdcc 100644 --- a/frontend/app/shared/guards/schema-must-not-be-singleton.guard.ts +++ b/frontend/app/shared/guards/schema-must-not-be-singleton.guard.ts @@ -9,7 +9,6 @@ import { Injectable } from '@angular/core'; import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot } from '@angular/router'; import { Observable } from 'rxjs'; import { map, take, tap } from 'rxjs/operators'; - import { SchemasState } from './../state/schemas.state'; @Injectable() diff --git a/frontend/app/shared/guards/unset-app.guard.spec.ts b/frontend/app/shared/guards/unset-app.guard.spec.ts index f04d5acb0..c6ce32d29 100644 --- a/frontend/app/shared/guards/unset-app.guard.spec.ts +++ b/frontend/app/shared/guards/unset-app.guard.spec.ts @@ -5,11 +5,9 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +import { AppsState } from '@app/shared/internal'; import { of } from 'rxjs'; import { IMock, Mock, Times } from 'typemoq'; - -import { AppsState } from '@app/shared/internal'; - import { UnsetAppGuard } from './unset-app.guard'; describe('UnsetAppGuard', () => { diff --git a/frontend/app/shared/guards/unset-app.guard.ts b/frontend/app/shared/guards/unset-app.guard.ts index 7087d1831..c1dfb30c5 100644 --- a/frontend/app/shared/guards/unset-app.guard.ts +++ b/frontend/app/shared/guards/unset-app.guard.ts @@ -9,7 +9,6 @@ import { Injectable } from '@angular/core'; import { CanActivate } from '@angular/router'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; - import { AppsState } from './../state/apps.state'; @Injectable() diff --git a/frontend/app/shared/guards/unset-content.guard.spec.ts b/frontend/app/shared/guards/unset-content.guard.spec.ts index 9aba68f66..854ba6a0c 100644 --- a/frontend/app/shared/guards/unset-content.guard.spec.ts +++ b/frontend/app/shared/guards/unset-content.guard.spec.ts @@ -5,10 +5,9 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +import { ContentsState } from '@app/shared/internal'; import { of } from 'rxjs'; import { IMock, Mock, Times } from 'typemoq'; - -import { ContentsState } from '@app/shared/internal'; import { UnsetContentGuard } from './unset-content.guard'; describe('UnsetContentGuard', () => { diff --git a/frontend/app/shared/guards/unset-content.guard.ts b/frontend/app/shared/guards/unset-content.guard.ts index eec755434..3737e4cd7 100644 --- a/frontend/app/shared/guards/unset-content.guard.ts +++ b/frontend/app/shared/guards/unset-content.guard.ts @@ -9,7 +9,6 @@ import { Injectable } from '@angular/core'; import { CanActivate } from '@angular/router'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; - import { ContentsState } from './../state/contents.state'; @Injectable() diff --git a/frontend/app/shared/index.ts b/frontend/app/shared/index.ts index d34c6d2ae..da0f82225 100644 --- a/frontend/app/shared/index.ts +++ b/frontend/app/shared/index.ts @@ -6,4 +6,4 @@ */ export * from './declarations'; -export * from './module'; \ No newline at end of file +export * from './module'; diff --git a/frontend/app/shared/interceptors/auth.interceptor.spec.ts b/frontend/app/shared/interceptors/auth.interceptor.spec.ts index 14a9cdf0c..d3aeaab30 100644 --- a/frontend/app/shared/interceptors/auth.interceptor.spec.ts +++ b/frontend/app/shared/interceptors/auth.interceptor.spec.ts @@ -9,11 +9,10 @@ import { HttpClient, HttpHeaders, HTTP_INTERCEPTORS } from '@angular/common/http import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; import { Router } from '@angular/router'; +import { ApiUrlConfig, AuthService } from '@app/shared/internal'; import { of } from 'rxjs'; import { onErrorResumeNext } from 'rxjs/operators'; import { IMock, Mock, Times } from 'typemoq'; - -import { ApiUrlConfig, AuthService } from '@app/shared/internal'; import { AuthInterceptor } from './auth.interceptor'; describe('AuthInterceptor', () => { diff --git a/frontend/app/shared/interceptors/auth.interceptor.ts b/frontend/app/shared/interceptors/auth.interceptor.ts index 2434084a2..ddbffb650 100644 --- a/frontend/app/shared/interceptors/auth.interceptor.ts +++ b/frontend/app/shared/interceptors/auth.interceptor.ts @@ -6,13 +6,11 @@ */ import { HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http'; -import { Injectable} from '@angular/core'; +import { Injectable } from '@angular/core'; import { Router } from '@angular/router'; +import { ApiUrlConfig, ErrorDto } from '@app/framework'; import { empty, Observable, throwError } from 'rxjs'; import { catchError, switchMap, take } from 'rxjs/operators'; - -import { ApiUrlConfig, ErrorDto } from '@app/framework'; - import { AuthService, Profile } from './../services/auth.service'; @Injectable() diff --git a/frontend/app/shared/internal.ts b/frontend/app/shared/internal.ts index 829058d4a..77f17436e 100644 --- a/frontend/app/shared/internal.ts +++ b/frontend/app/shared/internal.ts @@ -5,18 +5,18 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +export * from '@app/framework'; export * from './interceptors/auth.interceptor'; - -export * from './services/autosave.service'; export * from './services/app-languages.service'; export * from './services/apps.service'; export * from './services/assets.service'; export * from './services/auth.service'; -export * from './services/clients.service'; -export * from './services/contributors.service'; +export * from './services/autosave.service'; export * from './services/backups.service'; +export * from './services/clients.service'; export * from './services/comments.service'; export * from './services/contents.service'; +export * from './services/contributors.service'; export * from './services/graphql.service'; export * from './services/help.service'; export * from './services/history.service'; @@ -26,9 +26,9 @@ export * from './services/patterns.service'; export * from './services/plans.service'; export * from './services/roles.service'; export * from './services/rules.service'; -export * from './services/search.service'; export * from './services/schemas.service'; export * from './services/schemas.types'; +export * from './services/search.service'; export * from './services/stock-photo.service'; export * from './services/translations.service'; export * from './services/ui.service'; @@ -36,7 +36,6 @@ export * from './services/usages.service'; export * from './services/users-provider.service'; export * from './services/users.service'; export * from './services/workflows.service'; - export * from './state/apps.forms'; export * from './state/apps.state'; export * from './state/asset-uploader.state'; @@ -70,7 +69,4 @@ export * from './state/table-fields'; export * from './state/ui.state'; export * from './state/workflows.forms'; export * from './state/workflows.state'; - -export * from './utils/messages'; - -export * from '@app/framework'; \ No newline at end of file +export * from './utils/messages'; \ No newline at end of file diff --git a/frontend/app/shared/module.ts b/frontend/app/shared/module.ts index 3ce0b5ade..472b65294 100644 --- a/frontend/app/shared/module.ts +++ b/frontend/app/shared/module.ts @@ -5,118 +5,15 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +// tslint:disable: max-line-length + import { DragDropModule } from '@angular/cdk/drag-drop'; import { HTTP_INTERCEPTORS } from '@angular/common/http'; import { ModuleWithProviders, NgModule } from '@angular/core'; import { RouterModule } from '@angular/router'; -import { MentionModule } from 'angular-mentions'; - import { SqxFrameworkModule } from '@app/framework'; - -import { - AppFormComponent, - AppLanguagesService, - AppMustExistGuard, - AppsService, - AppsState, - AssetComponent, - AssetDialogComponent, - AssetFolderComponent, - AssetFolderDialogComponent, - AssetHistoryComponent, - AssetPathComponent, - AssetPreviewUrlPipe, - AssetsDialogState, - AssetsListComponent, - AssetsSelectorComponent, - AssetsService, - AssetsState, - AssetUploaderComponent, - AssetUploaderState, - AssetUrlPipe, - AuthInterceptor, - AuthService, - AutoSaveService, - BackupsService, - BackupsState, - ClientsService, - ClientsState, - CommentComponent, - CommentsComponent, - CommentsService, - ContentMustExistGuard, - ContentsService, - ContentsState, - ContributorsService, - ContributorsState, - FileIconPipe, - FilterComparisonComponent, - FilterLogicalComponent, - FilterNodeComponent, - GeolocationEditorComponent, - GraphQlService, - HelpComponent, - HelpMarkdownPipe, - HelpService, - HistoryComponent, - HistoryListComponent, - HistoryMessagePipe, - HistoryService, - ImageCropperComponent, - ImageFocusPointComponent, - LanguageSelectorComponent, - LanguagesService, - LanguagesState, - LoadAppsGuard, - LoadLanguagesGuard, - MarkdownEditorComponent, - MustBeAuthenticatedGuard, - MustBeNotAuthenticatedGuard, - NewsService, - PatternsService, - PatternsState, - PlansService, - PlansState, - QueryComponent, - QueryListComponent, - QueryPathComponent, - ReferencesDropdownComponent, - ReferencesTagsComponent, - RichEditorComponent, - RolesService, - RolesState, - RuleEventsState, - RulesService, - RulesState, - SavedQueriesComponent, - SchemaCategoryComponent, - SchemaMustExistGuard, - SchemaMustExistPublishedGuard, - SchemaMustNotBeSingletonGuard, - SchemasService, - SchemasState, - SchemaTagSource, - SearchFormComponent, - SortingComponent, - StockPhotoService, - TableHeaderComponent, - TranslationsService, - UIService, - UIState, - UnsetAppGuard, - UnsetContentGuard, - UsagesService, - UserDtoPicture, - UserIdPicturePipe, - UserNamePipe, - UserNameRefPipe, - UserPicturePipe, - UserPictureRefPipe, - UsersProviderService, - UsersService, - WorkflowsService, - WorkflowsState -} from './declarations'; +import { MentionModule } from 'angular-mentions'; +import { AppFormComponent, AppLanguagesService, AppMustExistGuard, AppsService, AppsState, AssetComponent, AssetDialogComponent, AssetFolderComponent, AssetFolderDialogComponent, AssetHistoryComponent, AssetPathComponent, AssetPreviewUrlPipe, AssetsDialogState, AssetsListComponent, AssetsSelectorComponent, AssetsService, AssetsState, AssetUploaderComponent, AssetUploaderState, AssetUrlPipe, AuthInterceptor, AuthService, AutoSaveService, BackupsService, BackupsState, ClientsService, ClientsState, CommentComponent, CommentsComponent, CommentsService, ContentMustExistGuard, ContentsService, ContentsState, ContributorsService, ContributorsState, FileIconPipe, FilterComparisonComponent, FilterLogicalComponent, FilterNodeComponent, GeolocationEditorComponent, GraphQlService, HelpComponent, HelpMarkdownPipe, HelpService, HistoryComponent, HistoryListComponent, HistoryMessagePipe, HistoryService, ImageCropperComponent, ImageFocusPointComponent, LanguageSelectorComponent, LanguagesService, LanguagesState, LoadAppsGuard, LoadLanguagesGuard, MarkdownEditorComponent, MustBeAuthenticatedGuard, MustBeNotAuthenticatedGuard, NewsService, PatternsService, PatternsState, PlansService, PlansState, QueryComponent, QueryListComponent, QueryPathComponent, ReferencesDropdownComponent, ReferencesTagsComponent, RichEditorComponent, RolesService, RolesState, RuleEventsState, RulesService, RulesState, SavedQueriesComponent, SchemaCategoryComponent, SchemaMustExistGuard, SchemaMustExistPublishedGuard, SchemaMustNotBeSingletonGuard, SchemasService, SchemasState, SchemaTagSource, SearchFormComponent, SortingComponent, StockPhotoService, TableHeaderComponent, TranslationsService, UIService, UIState, UnsetAppGuard, UnsetContentGuard, UsagesService, UserDtoPicture, UserIdPicturePipe, UserNamePipe, UserNameRefPipe, UserPicturePipe, UserPictureRefPipe, UsersProviderService, UsersService, WorkflowsService, WorkflowsState } from './declarations'; import { SearchService } from './services/search.service'; @NgModule({ diff --git a/frontend/app/shared/services/app-languages.service.spec.ts b/frontend/app/shared/services/app-languages.service.spec.ts index 1724048ce..899476ca1 100644 --- a/frontend/app/shared/services/app-languages.service.spec.ts +++ b/frontend/app/shared/services/app-languages.service.spec.ts @@ -7,18 +7,7 @@ import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; - -import { - AnalyticsService, - ApiUrlConfig, - AppLanguageDto, - AppLanguagesDto, - AppLanguagesPayload, - AppLanguagesService, - Resource, - ResourceLinks, - Version -} from '@app/shared/internal'; +import { AnalyticsService, ApiUrlConfig, AppLanguageDto, AppLanguagesDto, AppLanguagesPayload, AppLanguagesService, Resource, ResourceLinks, Version } from '@app/shared/internal'; describe('AppLanguagesService', () => { const version = new Version('1'); diff --git a/frontend/app/shared/services/app-languages.service.ts b/frontend/app/shared/services/app-languages.service.ts index 93cf54b3d..9cd068fd9 100644 --- a/frontend/app/shared/services/app-languages.service.ts +++ b/frontend/app/shared/services/app-languages.service.ts @@ -7,22 +7,10 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; +import { AnalyticsService, ApiUrlConfig, hasAnyLink, HTTP, mapVersioned, pretifyError, Resource, ResourceLinks, Version, Versioned } from '@app/framework'; import { Observable } from 'rxjs'; import { tap } from 'rxjs/operators'; -import { - AnalyticsService, - ApiUrlConfig, - hasAnyLink, - HTTP, - mapVersioned, - pretifyError, - Resource, - ResourceLinks, - Version, - Versioned -} from '@app/framework'; - export type AppLanguagesDto = Versioned; export type AppLanguagesPayload = { readonly items: ReadonlyArray; diff --git a/frontend/app/shared/services/apps.service.spec.ts b/frontend/app/shared/services/apps.service.spec.ts index a1952c193..babe09cc9 100644 --- a/frontend/app/shared/services/apps.service.spec.ts +++ b/frontend/app/shared/services/apps.service.spec.ts @@ -7,18 +7,7 @@ import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; - -import { - AnalyticsService, - ApiUrlConfig, - AppDto, - AppsService, - DateTime, - ErrorDto, - Resource, - ResourceLinks, - Version -} from '@app/shared/internal'; +import { AnalyticsService, ApiUrlConfig, AppDto, AppsService, DateTime, ErrorDto, Resource, ResourceLinks, Version } from '@app/shared/internal'; describe('AppsService', () => { const version = new Version('1'); diff --git a/frontend/app/shared/services/apps.service.ts b/frontend/app/shared/services/apps.service.ts index b1315be45..a6a75c046 100644 --- a/frontend/app/shared/services/apps.service.ts +++ b/frontend/app/shared/services/apps.service.ts @@ -7,25 +7,10 @@ import { HttpClient, HttpErrorResponse, HttpEventType, HttpResponse } from '@angular/common/http'; import { Injectable } from '@angular/core'; +import { AnalyticsService, ApiUrlConfig, DateTime, ErrorDto, getLinkUrl, hasAnyLink, HTTP, pretifyError, Resource, ResourceLinks, StringHelper, Types, Version } from '@app/framework'; import { Observable, throwError } from 'rxjs'; import { catchError, filter, map, tap } from 'rxjs/operators'; -import { - AnalyticsService, - ApiUrlConfig, - DateTime, - ErrorDto, - getLinkUrl, - hasAnyLink, - HTTP, - pretifyError, - Resource, - ResourceLinks, - StringHelper, - Types, - Version -} from '@app/framework'; - export class AppDto { public readonly _links: ResourceLinks; diff --git a/frontend/app/shared/services/assets.service.spec.ts b/frontend/app/shared/services/assets.service.spec.ts index 57d2cf704..974e67cd5 100644 --- a/frontend/app/shared/services/assets.service.spec.ts +++ b/frontend/app/shared/services/assets.service.spec.ts @@ -7,24 +7,7 @@ import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; - -import { - AnalyticsService, - ApiUrlConfig, - AssetDto, - AssetFolderDto, - AssetFoldersDto, - AssetsDto, - AssetsService, - DateTime, - encodeQuery, - ErrorDto, - MathHelper, - Resource, - ResourceLinks, - sanitize, - Version -} from '@app/shared/internal'; +import { AnalyticsService, ApiUrlConfig, AssetDto, AssetFolderDto, AssetFoldersDto, AssetsDto, AssetsService, DateTime, encodeQuery, ErrorDto, MathHelper, Resource, ResourceLinks, sanitize, Version } from '@app/shared/internal'; describe('AssetsService', () => { const version = new Version('1'); diff --git a/frontend/app/shared/services/assets.service.ts b/frontend/app/shared/services/assets.service.ts index d7e6b1061..f94bcc97d 100644 --- a/frontend/app/shared/services/assets.service.ts +++ b/frontend/app/shared/services/assets.service.ts @@ -7,32 +7,14 @@ import { HttpClient, HttpErrorResponse, HttpEventType, HttpResponse } from '@angular/common/http'; import { Injectable } from '@angular/core'; +import { AnalyticsService, ApiUrlConfig, DateTime, ErrorDto, hasAnyLink, HTTP, Metadata, pretifyError, Resource, ResourceLinks, ResultSet, StringHelper, Types, Version, Versioned } from '@app/framework'; import { Observable, throwError } from 'rxjs'; import { catchError, filter, map, tap } from 'rxjs/operators'; - -import { - AnalyticsService, - ApiUrlConfig, - DateTime, - ErrorDto, - hasAnyLink, - HTTP, - Metadata, - pretifyError, - Resource, - ResourceLinks, - ResultSet, - StringHelper, - Types, - Version, - Versioned -} from '@app/framework'; - -const SVG_PREVIEW_LIMIT = 10 * 1024; - import { encodeQuery, Query } from './../state/query'; import { AuthService } from './auth.service'; +const SVG_PREVIEW_LIMIT = 10 * 1024; + export class AssetsDto extends ResultSet { public get canCreate() { return hasAnyLink(this._links, 'create'); diff --git a/frontend/app/shared/services/auth.service.ts b/frontend/app/shared/services/auth.service.ts index 1705344d7..77a9bfe07 100644 --- a/frontend/app/shared/services/auth.service.ts +++ b/frontend/app/shared/services/auth.service.ts @@ -6,18 +6,11 @@ */ import { Injectable } from '@angular/core'; +import { ApiUrlConfig, Types } from '@app/framework'; +import { Log, User, UserManager, WebStorageStateStore } from 'oidc-client'; import { Observable, Observer, of, ReplaySubject, throwError, TimeoutError } from 'rxjs'; import { concat, delay, mergeMap, retryWhen, take, timeout } from 'rxjs/operators'; -import { - Log, - User, - UserManager, - WebStorageStateStore -} from 'oidc-client'; - -import { ApiUrlConfig, Types } from '@app/framework'; - export class Profile { public get id(): string { return this.user.profile['sub']; diff --git a/frontend/app/shared/services/autosave.service.spec.ts b/frontend/app/shared/services/autosave.service.spec.ts index fedbb8b70..4d47cbacc 100644 --- a/frontend/app/shared/services/autosave.service.spec.ts +++ b/frontend/app/shared/services/autosave.service.spec.ts @@ -5,14 +5,9 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +import { AutoSaveService, LocalStoreService, Version } from '@app/shared/internal'; import { IMock, It, Mock, Times } from 'typemoq'; -import { - AutoSaveService, - LocalStoreService, - Version -} from '@app/shared/internal'; - describe('AutoSaveService', () => { let localStore: IMock; diff --git a/frontend/app/shared/services/autosave.service.ts b/frontend/app/shared/services/autosave.service.ts index 98d745e57..1945ae5bb 100644 --- a/frontend/app/shared/services/autosave.service.ts +++ b/frontend/app/shared/services/autosave.service.ts @@ -6,7 +6,6 @@ */ import { Injectable } from '@angular/core'; - import { LocalStoreService, Version } from '@app/framework'; export declare type AutoSaveKey = { schemaId: string, schemaVersion: Version, contentId?: string }; diff --git a/frontend/app/shared/services/backups.service.spec.ts b/frontend/app/shared/services/backups.service.spec.ts index 0264a0907..e5024cf8c 100644 --- a/frontend/app/shared/services/backups.service.spec.ts +++ b/frontend/app/shared/services/backups.service.spec.ts @@ -7,18 +7,7 @@ import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; - -import { - AnalyticsService, - ApiUrlConfig, - BackupDto, - BackupsDto, - BackupsService, - DateTime, - Resource, - ResourceLinks, - RestoreDto -} from '@app/shared/internal'; +import { AnalyticsService, ApiUrlConfig, BackupDto, BackupsDto, BackupsService, DateTime, Resource, ResourceLinks, RestoreDto } from '@app/shared/internal'; describe('BackupsService', () => { beforeEach(() => { diff --git a/frontend/app/shared/services/backups.service.ts b/frontend/app/shared/services/backups.service.ts index 710d67fbc..f9ee84b24 100644 --- a/frontend/app/shared/services/backups.service.ts +++ b/frontend/app/shared/services/backups.service.ts @@ -7,21 +7,10 @@ import { HttpClient, HttpErrorResponse } from '@angular/common/http'; import { Injectable } from '@angular/core'; +import { AnalyticsService, ApiUrlConfig, DateTime, hasAnyLink, pretifyError, Resource, ResourceLinks, ResultSet, Types } from '@app/framework'; import { Observable, of, throwError } from 'rxjs'; import { catchError, map, tap } from 'rxjs/operators'; -import { - AnalyticsService, - ApiUrlConfig, - DateTime, - hasAnyLink, - pretifyError, - Resource, - ResourceLinks, - ResultSet, - Types -} from '@app/framework'; - export class BackupsDto extends ResultSet { public get canCreate() { return hasAnyLink(this._links, 'create'); diff --git a/frontend/app/shared/services/clients.service.spec.ts b/frontend/app/shared/services/clients.service.spec.ts index 10dab0286..6c43c546a 100644 --- a/frontend/app/shared/services/clients.service.spec.ts +++ b/frontend/app/shared/services/clients.service.spec.ts @@ -7,19 +7,7 @@ import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; - -import { - AccessTokenDto, - AnalyticsService, - ApiUrlConfig, - ClientDto, - ClientsDto, - ClientsPayload, - ClientsService, - Resource, - ResourceLinks, - Version -} from '@app/shared/internal'; +import { AccessTokenDto, AnalyticsService, ApiUrlConfig, ClientDto, ClientsDto, ClientsPayload, ClientsService, Resource, ResourceLinks, Version } from '@app/shared/internal'; describe('ClientsService', () => { const version = new Version('1'); diff --git a/frontend/app/shared/services/clients.service.ts b/frontend/app/shared/services/clients.service.ts index 67ca55be9..e90051fdc 100644 --- a/frontend/app/shared/services/clients.service.ts +++ b/frontend/app/shared/services/clients.service.ts @@ -7,22 +7,10 @@ import { HttpClient, HttpHeaders } from '@angular/common/http'; import { Injectable } from '@angular/core'; +import { AnalyticsService, ApiUrlConfig, hasAnyLink, HTTP, mapVersioned, pretifyError, Resource, ResourceLinks, Version, Versioned } from '@app/framework'; import { Observable } from 'rxjs'; import { map, tap } from 'rxjs/operators'; -import { - AnalyticsService, - ApiUrlConfig, - hasAnyLink, - HTTP, - mapVersioned, - pretifyError, - Resource, - ResourceLinks, - Version, - Versioned -} from '@app/framework'; - export type ClientsDto = Versioned; export type ClientsPayload = { readonly items: ReadonlyArray; diff --git a/frontend/app/shared/services/comments.service.spec.ts b/frontend/app/shared/services/comments.service.spec.ts index 87b99f842..11cccaf98 100644 --- a/frontend/app/shared/services/comments.service.spec.ts +++ b/frontend/app/shared/services/comments.service.spec.ts @@ -7,15 +7,7 @@ import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; - -import { - ApiUrlConfig, - CommentDto, - CommentsDto, - CommentsService, - DateTime, - Version -} from '@app/shared/internal'; +import { ApiUrlConfig, CommentDto, CommentsDto, CommentsService, DateTime, Version } from '@app/shared/internal'; describe('CommentsService', () => { const user = 'me'; diff --git a/frontend/app/shared/services/comments.service.ts b/frontend/app/shared/services/comments.service.ts index c96f29336..9ab66a778 100644 --- a/frontend/app/shared/services/comments.service.ts +++ b/frontend/app/shared/services/comments.service.ts @@ -7,17 +7,10 @@ import { HttpClient, HttpHeaders } from '@angular/common/http'; import { Injectable } from '@angular/core'; +import { ApiUrlConfig, DateTime, Model, pretifyError, Version } from '@app/framework'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { - ApiUrlConfig, - DateTime, - Model, - pretifyError, - Version -} from '@app/framework'; - export class CommentsDto extends Model { constructor( public readonly createdComments: ReadonlyArray, diff --git a/frontend/app/shared/services/contents.service.spec.ts b/frontend/app/shared/services/contents.service.spec.ts index f80403384..9beafccec 100644 --- a/frontend/app/shared/services/contents.service.spec.ts +++ b/frontend/app/shared/services/contents.service.spec.ts @@ -7,21 +7,7 @@ import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; - -import { - AnalyticsService, - ApiUrlConfig, - ContentDto, - ContentsDto, - ContentsService, - DateTime, - Resource, - ResourceLinks, - ScheduleDto, - Version, - Versioned -} from '@app/shared/internal'; - +import { AnalyticsService, ApiUrlConfig, ContentDto, ContentsDto, ContentsService, DateTime, Resource, ResourceLinks, ScheduleDto, Version, Versioned } from '@app/shared/internal'; import { encodeQuery, sanitize } from './../state/query'; describe('ContentsService', () => { diff --git a/frontend/app/shared/services/contents.service.ts b/frontend/app/shared/services/contents.service.ts index 081e3b2c5..056826c87 100644 --- a/frontend/app/shared/services/contents.service.ts +++ b/frontend/app/shared/services/contents.service.ts @@ -7,26 +7,10 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; +import { AnalyticsService, ApiUrlConfig, DateTime, hasAnyLink, HTTP, mapVersioned, pretifyError, Resource, ResourceLinks, ResultSet, Version, Versioned } from '@app/framework'; import { Observable } from 'rxjs'; import { map, tap } from 'rxjs/operators'; - -import { - AnalyticsService, - ApiUrlConfig, - DateTime, - hasAnyLink, - HTTP, - mapVersioned, - pretifyError, - Resource, - ResourceLinks, - ResultSet, - Version, - Versioned -} from '@app/framework'; - import { encodeQuery, Query } from './../state/query'; - import { parseField, RootFieldDto } from './schemas.service'; export class ScheduleDto { diff --git a/frontend/app/shared/services/contributors.service.spec.ts b/frontend/app/shared/services/contributors.service.spec.ts index a6549d1af..e61506aa1 100644 --- a/frontend/app/shared/services/contributors.service.spec.ts +++ b/frontend/app/shared/services/contributors.service.spec.ts @@ -7,18 +7,7 @@ import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; - -import { - AnalyticsService, - ApiUrlConfig, - ContributorDto, - ContributorsDto, - ContributorsPayload, - ContributorsService, - Resource, - ResourceLinks, - Version -} from '@app/shared/internal'; +import { AnalyticsService, ApiUrlConfig, ContributorDto, ContributorsDto, ContributorsPayload, ContributorsService, Resource, ResourceLinks, Version } from '@app/shared/internal'; describe('ContributorsService', () => { const version = new Version('1'); diff --git a/frontend/app/shared/services/contributors.service.ts b/frontend/app/shared/services/contributors.service.ts index 8fa0fde5b..21ad31d12 100644 --- a/frontend/app/shared/services/contributors.service.ts +++ b/frontend/app/shared/services/contributors.service.ts @@ -7,22 +7,10 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; +import { AnalyticsService, ApiUrlConfig, hasAnyLink, HTTP, mapVersioned, pretifyError, Resource, ResourceLinks, Version, Versioned } from '@app/framework'; import { Observable } from 'rxjs'; import { tap } from 'rxjs/operators'; -import { - AnalyticsService, - ApiUrlConfig, - hasAnyLink, - HTTP, - mapVersioned, - pretifyError, - Resource, - ResourceLinks, - Version, - Versioned -} from '@app/framework'; - export type ContributorsDto = Versioned; export type ContributorsPayload = { readonly items: ReadonlyArray; diff --git a/frontend/app/shared/services/graphql.service.spec.ts b/frontend/app/shared/services/graphql.service.spec.ts index d90390351..78b27c785 100644 --- a/frontend/app/shared/services/graphql.service.spec.ts +++ b/frontend/app/shared/services/graphql.service.spec.ts @@ -7,7 +7,6 @@ import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; - import { ApiUrlConfig, GraphQlService } from '@app/shared/internal'; describe('GraphQlService', () => { diff --git a/frontend/app/shared/services/graphql.service.ts b/frontend/app/shared/services/graphql.service.ts index d028c8e73..32ce17859 100644 --- a/frontend/app/shared/services/graphql.service.ts +++ b/frontend/app/shared/services/graphql.service.ts @@ -7,9 +7,8 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { Observable } from 'rxjs'; - import { ApiUrlConfig } from '@app/framework'; +import { Observable } from 'rxjs'; @Injectable() export class GraphQlService { diff --git a/frontend/app/shared/services/help.service.spec.ts b/frontend/app/shared/services/help.service.spec.ts index 746b5515c..cc347d16f 100644 --- a/frontend/app/shared/services/help.service.spec.ts +++ b/frontend/app/shared/services/help.service.spec.ts @@ -7,7 +7,6 @@ import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; - import { HelpService } from '@app/shared/internal'; describe('HelpService', () => { diff --git a/frontend/app/shared/services/history.service.spec.ts b/frontend/app/shared/services/history.service.spec.ts index f77a45c96..8d4b42ef9 100644 --- a/frontend/app/shared/services/history.service.spec.ts +++ b/frontend/app/shared/services/history.service.spec.ts @@ -7,14 +7,7 @@ import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; - -import { - ApiUrlConfig, - DateTime, - HistoryEventDto, - HistoryService, - Version -} from '@app/shared/internal'; +import { ApiUrlConfig, DateTime, HistoryEventDto, HistoryService, Version } from '@app/shared/internal'; describe('HistoryService', () => { beforeEach(() => { diff --git a/frontend/app/shared/services/history.service.ts b/frontend/app/shared/services/history.service.ts index a77f03baa..91e7c2ad8 100644 --- a/frontend/app/shared/services/history.service.ts +++ b/frontend/app/shared/services/history.service.ts @@ -7,18 +7,11 @@ import { HttpClient, HttpHeaders } from '@angular/common/http'; import { Injectable } from '@angular/core'; +import { ApiUrlConfig, DateTime, pretifyError, Version } from '@app/framework'; import { Observable, of } from 'rxjs'; import { map } from 'rxjs/operators'; - import { UsersProviderService } from './users-provider.service'; -import { - ApiUrlConfig, - DateTime, - pretifyError, - Version -} from '@app/framework'; - export class HistoryEventDto { constructor( public readonly eventId: string, diff --git a/frontend/app/shared/services/languages.service.spec.ts b/frontend/app/shared/services/languages.service.spec.ts index d87e891ff..40b03f96a 100644 --- a/frontend/app/shared/services/languages.service.spec.ts +++ b/frontend/app/shared/services/languages.service.spec.ts @@ -7,12 +7,7 @@ import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; - -import { - ApiUrlConfig, - LanguageDto, - LanguagesService -} from '@app/shared/internal'; +import { ApiUrlConfig, LanguageDto, LanguagesService } from '@app/shared/internal'; describe('LanguageService', () => { beforeEach(() => { diff --git a/frontend/app/shared/services/languages.service.ts b/frontend/app/shared/services/languages.service.ts index 57d05c623..c44fb8958 100644 --- a/frontend/app/shared/services/languages.service.ts +++ b/frontend/app/shared/services/languages.service.ts @@ -7,11 +7,10 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; +import { ApiUrlConfig, pretifyError } from '@app/framework'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { ApiUrlConfig, pretifyError } from '@app/framework'; - export class LanguageDto { constructor( public readonly iso2Code: string, diff --git a/frontend/app/shared/services/news.service.spec.ts b/frontend/app/shared/services/news.service.spec.ts index fc81c675b..1d40f5cd6 100644 --- a/frontend/app/shared/services/news.service.spec.ts +++ b/frontend/app/shared/services/news.service.spec.ts @@ -7,13 +7,7 @@ import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; - -import { - ApiUrlConfig, - FeatureDto, - FeaturesDto, - NewsService -} from '@app/shared/internal'; +import { ApiUrlConfig, FeatureDto, FeaturesDto, NewsService } from '@app/shared/internal'; describe('NewsService', () => { beforeEach(() => { diff --git a/frontend/app/shared/services/news.service.ts b/frontend/app/shared/services/news.service.ts index 473847ada..24be30a26 100644 --- a/frontend/app/shared/services/news.service.ts +++ b/frontend/app/shared/services/news.service.ts @@ -7,11 +7,10 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; +import { ApiUrlConfig, pretifyError } from '@app/framework'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { ApiUrlConfig, pretifyError } from '@app/framework'; - export class FeatureDto { constructor( public readonly name: string, diff --git a/frontend/app/shared/services/patterns.service.spec.ts b/frontend/app/shared/services/patterns.service.spec.ts index 31793dc24..23b18b4f5 100644 --- a/frontend/app/shared/services/patterns.service.spec.ts +++ b/frontend/app/shared/services/patterns.service.spec.ts @@ -7,18 +7,7 @@ import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; - -import { - AnalyticsService, - ApiUrlConfig, - PatternDto, - PatternsDto, - PatternsPayload, - PatternsService, - Resource, - ResourceLinks, - Version -} from '@app/shared/internal'; +import { AnalyticsService, ApiUrlConfig, PatternDto, PatternsDto, PatternsPayload, PatternsService, Resource, ResourceLinks, Version } from '@app/shared/internal'; describe('PatternsService', () => { const version = new Version('1'); diff --git a/frontend/app/shared/services/patterns.service.ts b/frontend/app/shared/services/patterns.service.ts index 66875c1fe..f52517806 100644 --- a/frontend/app/shared/services/patterns.service.ts +++ b/frontend/app/shared/services/patterns.service.ts @@ -7,22 +7,10 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; +import { AnalyticsService, ApiUrlConfig, hasAnyLink, HTTP, mapVersioned, pretifyError, Resource, ResourceLinks, Version, Versioned } from '@app/framework'; import { Observable } from 'rxjs'; import { tap } from 'rxjs/operators'; -import { - AnalyticsService, - ApiUrlConfig, - hasAnyLink, - HTTP, - mapVersioned, - pretifyError, - Resource, - ResourceLinks, - Version, - Versioned -} from '@app/framework'; - export type PatternsDto = Versioned; export type PatternsPayload = { readonly items: ReadonlyArray, diff --git a/frontend/app/shared/services/plans.service.spec.ts b/frontend/app/shared/services/plans.service.spec.ts index 9e1ef2264..f614fa24b 100644 --- a/frontend/app/shared/services/plans.service.spec.ts +++ b/frontend/app/shared/services/plans.service.spec.ts @@ -7,16 +7,7 @@ import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; - -import { - AnalyticsService, - ApiUrlConfig, - PlanChangedDto, - PlanDto, - PlansDto, - PlansService, - Version -} from '@app/shared/internal'; +import { AnalyticsService, ApiUrlConfig, PlanChangedDto, PlanDto, PlansDto, PlansService, Version } from '@app/shared/internal'; describe('PlansService', () => { const version = new Version('1'); diff --git a/frontend/app/shared/services/plans.service.ts b/frontend/app/shared/services/plans.service.ts index 6b9e157c2..2dd74b574 100644 --- a/frontend/app/shared/services/plans.service.ts +++ b/frontend/app/shared/services/plans.service.ts @@ -7,19 +7,10 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; +import { AnalyticsService, ApiUrlConfig, HTTP, mapVersioned, pretifyError, Version, Versioned } from '@app/framework'; import { Observable } from 'rxjs'; import { tap } from 'rxjs/operators'; -import { - AnalyticsService, - ApiUrlConfig, - HTTP, - mapVersioned, - pretifyError, - Version, - Versioned -} from '@app/framework'; - export type PlansDto = Versioned<{ readonly currentPlanId: string, readonly planOwner: string, diff --git a/frontend/app/shared/services/roles.service.spec.ts b/frontend/app/shared/services/roles.service.spec.ts index 629af55c5..15f995c41 100644 --- a/frontend/app/shared/services/roles.service.spec.ts +++ b/frontend/app/shared/services/roles.service.spec.ts @@ -7,18 +7,7 @@ import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; - -import { - AnalyticsService, - ApiUrlConfig, - Resource, - ResourceLinks, - RoleDto, - RolesDto, - RolesPayload, - RolesService, - Version -} from '@app/shared/internal'; +import { AnalyticsService, ApiUrlConfig, Resource, ResourceLinks, RoleDto, RolesDto, RolesPayload, RolesService, Version } from '@app/shared/internal'; describe('RolesService', () => { const version = new Version('1'); diff --git a/frontend/app/shared/services/roles.service.ts b/frontend/app/shared/services/roles.service.ts index 4813ba82a..d63fd4d14 100644 --- a/frontend/app/shared/services/roles.service.ts +++ b/frontend/app/shared/services/roles.service.ts @@ -7,22 +7,10 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; +import { AnalyticsService, ApiUrlConfig, hasAnyLink, HTTP, mapVersioned, pretifyError, Resource, ResourceLinks, Version, Versioned } from '@app/framework'; import { Observable } from 'rxjs'; import { tap } from 'rxjs/operators'; -import { - AnalyticsService, - ApiUrlConfig, - hasAnyLink, - HTTP, - mapVersioned, - pretifyError, - Resource, - ResourceLinks, - Version, - Versioned -} from '@app/framework'; - export type RolesDto = Versioned; export type RolesPayload = { readonly items: ReadonlyArray; diff --git a/frontend/app/shared/services/rules.service.spec.ts b/frontend/app/shared/services/rules.service.spec.ts index 10d7b55bf..ff60594e5 100644 --- a/frontend/app/shared/services/rules.service.spec.ts +++ b/frontend/app/shared/services/rules.service.spec.ts @@ -7,22 +7,7 @@ import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; - -import { - AnalyticsService, - ApiUrlConfig, - DateTime, - Resource, - ResourceLinks, - RuleDto, - RuleElementDto, - RuleElementPropertyDto, - RuleEventDto, - RuleEventsDto, - RulesDto, - RulesService, - Version -} from '@app/shared/internal'; +import { AnalyticsService, ApiUrlConfig, DateTime, Resource, ResourceLinks, RuleDto, RuleElementDto, RuleElementPropertyDto, RuleEventDto, RuleEventsDto, RulesDto, RulesService, Version } from '@app/shared/internal'; describe('RulesService', () => { const version = new Version('1'); @@ -124,14 +109,15 @@ describe('RulesService', () => { items: [ ruleResponse(12), ruleResponse(13) - ] + ], + runningRuleId: '12' }); expect(rules!).toEqual( new RulesDto([ createRule(12), createRule(13) - ])); + ], {}, '12')); })); it('should make post request to create rule', @@ -288,6 +274,38 @@ describe('RulesService', () => { req.flush({}); })); + it('should make put request to run rule', + inject([RulesService, HttpTestingController], (rulesService: RulesService, httpMock: HttpTestingController) => { + + const resource: Resource = { + _links: { + run: { method: 'PUT', href: '/api/apps/my-app/rules/123/run' } + } + }; + + rulesService.runRule('my-app', resource).subscribe(); + + const req = httpMock.expectOne('http://service/p/api/apps/my-app/rules/123/run'); + + expect(req.request.method).toEqual('PUT'); + expect(req.request.headers.get('If-Match')).toBeNull(); + + req.flush({}); + })); + + it('should make delete request to cancel run rule', + inject([RulesService, HttpTestingController], (rulesService: RulesService, httpMock: HttpTestingController) => { + + rulesService.runCancel('my-app').subscribe(); + + const req = httpMock.expectOne('http://service/p/api/apps/my-app/rules/run'); + + expect(req.request.method).toEqual('DELETE'); + expect(req.request.headers.get('If-Match')).toBeNull(); + + req.flush({}); + })); + it('should make get request to get app rule events', inject([RulesService, HttpTestingController], (rulesService: RulesService, httpMock: HttpTestingController) => { diff --git a/frontend/app/shared/services/rules.service.ts b/frontend/app/shared/services/rules.service.ts index 2a447326b..38f287015 100644 --- a/frontend/app/shared/services/rules.service.ts +++ b/frontend/app/shared/services/rules.service.ts @@ -7,23 +7,10 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; +import { AnalyticsService, ApiUrlConfig, DateTime, hasAnyLink, HTTP, Model, pretifyError, Resource, ResourceLinks, ResultSet, Version } from '@app/framework'; import { Observable } from 'rxjs'; import { map, tap } from 'rxjs/operators'; -import { - AnalyticsService, - ApiUrlConfig, - DateTime, - hasAnyLink, - HTTP, - Model, - pretifyError, - Resource, - ResourceLinks, - ResultSet, - Version -} from '@app/framework'; - export type RuleElementMetadataDto = { description: string; display: string; @@ -124,7 +111,13 @@ export class RulesDto extends ResultSet { return hasAnyLink(this._links, 'events'); } - constructor(items: ReadonlyArray, links?: {}) { + public get canCancelRun() { + return hasAnyLink(this._links, 'run/cancel'); + } + + constructor(items: ReadonlyArray, links?: {}, + public readonly runningRuleId?: string + ) { super(items.length, items, links); } } @@ -135,6 +128,7 @@ export class RuleDto { public readonly canDelete: boolean; public readonly canDisable: boolean; public readonly canEnable: boolean; + public readonly canRun: boolean; public readonly canTrigger: boolean; public readonly canUpdate: boolean; @@ -161,6 +155,7 @@ export class RuleDto { this.canDelete = hasAnyLink(links, 'delete'); this.canDisable = hasAnyLink(links, 'disable'); this.canEnable = hasAnyLink(links, 'enable'); + this.canRun = hasAnyLink(links, 'run'); this.canTrigger = hasAnyLink(links, 'logs'); this.canUpdate = hasAnyLink(links, 'update'); } @@ -254,11 +249,11 @@ export class RulesService { public getRules(appName: string): Observable { const url = this.apiUrl.buildUrl(`api/apps/${appName}/rules`); - return this.http.get<{ items: [] } & Resource>(url).pipe( - map(({ items, _links }) => { + return this.http.get<{ items: [] } & Resource & { runningRuleId?: string }>(url).pipe( + map(({ items, _links, runningRuleId }) => { const rules = items.map(item => parseRule(item)); - return new RulesDto(rules, _links); + return new RulesDto(rules, _links, runningRuleId); }), pretifyError('Failed to load Rules. Please reload.')); } @@ -333,6 +328,28 @@ export class RulesService { pretifyError('Failed to delete rule. Please reload.')); } + public runRule(appName: string, resource: Resource): Observable { + const link = resource._links['run']; + + const url = this.apiUrl.buildUrl(link.href); + + return this.http.request(link.method, url, {}).pipe( + tap(() => { + this.analytics.trackEvent('Rule', 'Run', appName); + }), + pretifyError('Failed to run rule. Please reload.')); + } + + public runCancel(appName: string): Observable { + const url = this.apiUrl.buildUrl(`api/apps/${appName}/rules/run`); + + return this.http.delete(url).pipe( + tap(() => { + this.analytics.trackEvent('Rule', 'RunCancel', appName); + }), + pretifyError('Failed to cancel rule. Please reload.')); + } + public triggerRule(appName: string, resource: Resource): Observable { const link = resource._links['trigger']; diff --git a/frontend/app/shared/services/schemas.service.spec.ts b/frontend/app/shared/services/schemas.service.spec.ts index 9d4554ee3..7a1d4d77a 100644 --- a/frontend/app/shared/services/schemas.service.spec.ts +++ b/frontend/app/shared/services/schemas.service.spec.ts @@ -7,23 +7,7 @@ import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; - -import { - AnalyticsService, - ApiUrlConfig, - createProperties, - DateTime, - NestedFieldDto, - Resource, - ResourceLinks, - RootFieldDto, - SchemaDetailsDto, - SchemaDto, - SchemaPropertiesDto, - SchemasDto, - SchemasService, - Version -} from '@app/shared/internal'; +import { AnalyticsService, ApiUrlConfig, createProperties, DateTime, NestedFieldDto, Resource, ResourceLinks, RootFieldDto, SchemaDetailsDto, SchemaDto, SchemaPropertiesDto, SchemasDto, SchemasService, Version } from '@app/shared/internal'; describe('SchemasService', () => { const version = new Version('1'); diff --git a/frontend/app/shared/services/schemas.service.ts b/frontend/app/shared/services/schemas.service.ts index 0c8815b15..9ad0c9a60 100644 --- a/frontend/app/shared/services/schemas.service.ts +++ b/frontend/app/shared/services/schemas.service.ts @@ -9,24 +9,9 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; +import { AnalyticsService, ApiUrlConfig, DateTime, hasAnyLink, HTTP, pretifyError, Resource, ResourceLinks, StringHelper, Types, Version, Versioned } from '@app/framework'; import { Observable } from 'rxjs'; import { map, tap } from 'rxjs/operators'; - -import { - AnalyticsService, - ApiUrlConfig, - DateTime, - hasAnyLink, - HTTP, - pretifyError, - Resource, - ResourceLinks, - StringHelper, - Types, - Version, - Versioned -} from '@app/framework'; - import { createProperties, FieldPropertiesDto } from './schemas.types'; export type SchemasDto = { diff --git a/frontend/app/shared/services/search.service.spec.ts b/frontend/app/shared/services/search.service.spec.ts index 6919b65cd..4e80186ec 100644 --- a/frontend/app/shared/services/search.service.spec.ts +++ b/frontend/app/shared/services/search.service.spec.ts @@ -7,13 +7,7 @@ import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; - -import { - ApiUrlConfig, - ResourceLinks, - SearchResultDto, - SearchService -} from '@app/shared/internal'; +import { ApiUrlConfig, ResourceLinks, SearchResultDto, SearchService } from '@app/shared/internal'; describe('SearchService', () => { beforeEach(() => { diff --git a/frontend/app/shared/services/search.service.ts b/frontend/app/shared/services/search.service.ts index fffa424de..d0ec47cb2 100644 --- a/frontend/app/shared/services/search.service.ts +++ b/frontend/app/shared/services/search.service.ts @@ -7,15 +7,10 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; +import { ApiUrlConfig, pretifyError, ResourceLinks } from '@app/framework'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { - ApiUrlConfig, - pretifyError, - ResourceLinks -} from '@app/framework'; - export class SearchResultDto { public readonly _links: ResourceLinks; diff --git a/frontend/app/shared/services/stock-photo.service.spec.ts b/frontend/app/shared/services/stock-photo.service.spec.ts index c3facfe10..3a333a31d 100644 --- a/frontend/app/shared/services/stock-photo.service.spec.ts +++ b/frontend/app/shared/services/stock-photo.service.spec.ts @@ -7,7 +7,6 @@ import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; - import { StockPhotoDto, StockPhotoService } from '@app/shared/internal'; describe('StockPhotoService', () => { diff --git a/frontend/app/shared/services/translations.service.spec.ts b/frontend/app/shared/services/translations.service.spec.ts index 3ac0c22d1..b218b2a85 100644 --- a/frontend/app/shared/services/translations.service.spec.ts +++ b/frontend/app/shared/services/translations.service.spec.ts @@ -7,12 +7,7 @@ import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; - -import { - ApiUrlConfig, - TranslationDto, - TranslationsService -} from '@app/shared/internal'; +import { ApiUrlConfig, TranslationDto, TranslationsService } from '@app/shared/internal'; describe('TranslationsService', () => { beforeEach(() => { diff --git a/frontend/app/shared/services/translations.service.ts b/frontend/app/shared/services/translations.service.ts index 30d8ee52b..88e3eaf24 100644 --- a/frontend/app/shared/services/translations.service.ts +++ b/frontend/app/shared/services/translations.service.ts @@ -7,11 +7,10 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; +import { ApiUrlConfig, pretifyError } from '@app/framework'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { ApiUrlConfig, pretifyError } from '@app/framework'; - export class TranslationDto { constructor( public readonly result: string, diff --git a/frontend/app/shared/services/ui.service.spec.ts b/frontend/app/shared/services/ui.service.spec.ts index a6029c94a..b7949a00d 100644 --- a/frontend/app/shared/services/ui.service.spec.ts +++ b/frontend/app/shared/services/ui.service.spec.ts @@ -7,12 +7,7 @@ import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; - -import { - ApiUrlConfig, - UIService, - UISettingsDto -} from '@app/shared/internal'; +import { ApiUrlConfig, UIService, UISettingsDto } from '@app/shared/internal'; describe('UIService', () => { beforeEach(() => { diff --git a/frontend/app/shared/services/ui.service.ts b/frontend/app/shared/services/ui.service.ts index f620af4a2..ad6870393 100644 --- a/frontend/app/shared/services/ui.service.ts +++ b/frontend/app/shared/services/ui.service.ts @@ -7,11 +7,10 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; +import { ApiUrlConfig } from '@app/framework'; import { Observable, of } from 'rxjs'; import { catchError } from 'rxjs/operators'; -import { ApiUrlConfig } from '@app/framework'; - export interface UISettingsDto { readonly canCreateApps: boolean; } diff --git a/frontend/app/shared/services/usages.service.spec.ts b/frontend/app/shared/services/usages.service.spec.ts index 9301bc4ff..36660bb2f 100644 --- a/frontend/app/shared/services/usages.service.spec.ts +++ b/frontend/app/shared/services/usages.service.spec.ts @@ -7,16 +7,7 @@ import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; - -import { - ApiUrlConfig, - CallsUsageDto, - CallsUsagePerDateDto, - CurrentStorageDto, - DateTime, - StorageUsagePerDateDto, - UsagesService -} from '@app/shared/internal'; +import { ApiUrlConfig, CallsUsageDto, CallsUsagePerDateDto, CurrentStorageDto, DateTime, StorageUsagePerDateDto, UsagesService } from '@app/shared/internal'; describe('UsagesService', () => { beforeEach(() => { diff --git a/frontend/app/shared/services/usages.service.ts b/frontend/app/shared/services/usages.service.ts index 563bf70aa..91af778a0 100644 --- a/frontend/app/shared/services/usages.service.ts +++ b/frontend/app/shared/services/usages.service.ts @@ -7,15 +7,10 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; +import { ApiUrlConfig, DateTime, pretifyError } from '@app/framework'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { - ApiUrlConfig, - DateTime, - pretifyError -} from '@app/framework'; - export class CallsUsageDto { constructor( public readonly allowedCalls: number, diff --git a/frontend/app/shared/services/users-provider.service.spec.ts b/frontend/app/shared/services/users-provider.service.spec.ts index d31a57901..a1e83eb07 100644 --- a/frontend/app/shared/services/users-provider.service.spec.ts +++ b/frontend/app/shared/services/users-provider.service.spec.ts @@ -5,17 +5,10 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +import { AuthService, Profile, UserDto, UsersProviderService, UsersService } from '@app/shared/internal'; import { of, throwError } from 'rxjs'; import { IMock, Mock, Times } from 'typemoq'; -import { - AuthService, - Profile, - UserDto, - UsersProviderService, - UsersService -} from '@app/shared/internal'; - describe('UsersProviderService', () => { let authService: IMock; let usersService: IMock; diff --git a/frontend/app/shared/services/users-provider.service.ts b/frontend/app/shared/services/users-provider.service.ts index e5534fc5a..5901bc07d 100644 --- a/frontend/app/shared/services/users-provider.service.ts +++ b/frontend/app/shared/services/users-provider.service.ts @@ -8,10 +8,8 @@ import { Injectable } from '@angular/core'; import { ConnectableObservable, Observable, of } from 'rxjs'; import { catchError, map, publishLast, share } from 'rxjs/operators'; - -import { UserDto, UsersService } from './users.service'; - import { AuthService } from './auth.service'; +import { UserDto, UsersService } from './users.service'; @Injectable() export class UsersProviderService { diff --git a/frontend/app/shared/services/users.service.spec.ts b/frontend/app/shared/services/users.service.spec.ts index f2697cb13..e35cc7642 100644 --- a/frontend/app/shared/services/users.service.spec.ts +++ b/frontend/app/shared/services/users.service.spec.ts @@ -7,13 +7,7 @@ import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; - -import { - ApiUrlConfig, - ResourcesDto, - UserDto, - UsersService -} from '@app/shared/internal'; +import { ApiUrlConfig, ResourcesDto, UserDto, UsersService } from '@app/shared/internal'; describe('UsersService', () => { beforeEach(() => { diff --git a/frontend/app/shared/services/users.service.ts b/frontend/app/shared/services/users.service.ts index 48763d73e..17f00dfec 100644 --- a/frontend/app/shared/services/users.service.ts +++ b/frontend/app/shared/services/users.service.ts @@ -7,15 +7,10 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; +import { ApiUrlConfig, pretifyError, ResourceLinks } from '@app/framework'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { - ApiUrlConfig, - pretifyError, - ResourceLinks -} from '@app/framework'; - export class UserDto { constructor( public readonly id: string, diff --git a/frontend/app/shared/services/workflows.service.spec.ts b/frontend/app/shared/services/workflows.service.spec.ts index 5b5a72148..b9c3ac07c 100644 --- a/frontend/app/shared/services/workflows.service.spec.ts +++ b/frontend/app/shared/services/workflows.service.spec.ts @@ -7,17 +7,7 @@ import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; - -import { - AnalyticsService, - ApiUrlConfig, - Resource, - Version, - WorkflowDto, - WorkflowsDto, - WorkflowsPayload, - WorkflowsService -} from '@app/shared/internal'; +import { AnalyticsService, ApiUrlConfig, Resource, Version, WorkflowDto, WorkflowsDto, WorkflowsPayload, WorkflowsService } from '@app/shared/internal'; describe('WorkflowsService', () => { const version = new Version('1'); diff --git a/frontend/app/shared/services/workflows.service.ts b/frontend/app/shared/services/workflows.service.ts index 7f064ae72..8ebdeb04c 100644 --- a/frontend/app/shared/services/workflows.service.ts +++ b/frontend/app/shared/services/workflows.service.ts @@ -9,25 +9,10 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; +import { AnalyticsService, ApiUrlConfig, compareStrings, hasAnyLink, HTTP, mapVersioned, Model, pretifyError, Resource, ResourceLinks, StringHelper, Version, Versioned } from '@app/framework'; import { Observable } from 'rxjs'; import { tap } from 'rxjs/operators'; -import { - AnalyticsService, - ApiUrlConfig, - compareStrings, - hasAnyLink, - HTTP, - mapVersioned, - Model, - pretifyError, - Resource, - ResourceLinks, - StringHelper, - Version, - Versioned -} from '@app/framework'; - export type WorkflowsDto = Versioned; export type WorkflowsPayload = { readonly items: WorkflowDto[]; diff --git a/frontend/app/shared/state/_test-helpers.ts b/frontend/app/shared/state/_test-helpers.ts index 130b18a72..4d9cf0dc0 100644 --- a/frontend/app/shared/state/_test-helpers.ts +++ b/frontend/app/shared/state/_test-helpers.ts @@ -7,13 +7,7 @@ import { of } from 'rxjs'; import { Mock } from 'typemoq'; - -import { - AppsState, - AuthService, - DateTime, - Version -} from './../'; +import { AppsState, AuthService, DateTime, Version } from './../'; const app = 'my-app'; const creation = DateTime.today().addDays(-2); diff --git a/frontend/app/shared/state/apps.forms.ts b/frontend/app/shared/state/apps.forms.ts index 282831b4d..5ee9aead4 100644 --- a/frontend/app/shared/state/apps.forms.ts +++ b/frontend/app/shared/state/apps.forms.ts @@ -6,14 +6,8 @@ */ import { FormBuilder, FormGroup, Validators } from '@angular/forms'; - import { Form, ValidatorsEx } from '@app/framework'; - -import { - AppDto, - CreateAppDto, - UpdateAppDto -} from './../services/apps.service'; +import { AppDto, CreateAppDto, UpdateAppDto } from './../services/apps.service'; export class CreateAppForm extends Form { constructor(formBuilder: FormBuilder) { diff --git a/frontend/app/shared/state/apps.state.spec.ts b/frontend/app/shared/state/apps.state.spec.ts index 5c115e1a2..297207eef 100644 --- a/frontend/app/shared/state/apps.state.spec.ts +++ b/frontend/app/shared/state/apps.state.spec.ts @@ -5,16 +5,9 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +import { AppDto, AppsService, AppsState, DialogService } from '@app/shared/internal'; import { of, throwError } from 'rxjs'; import { IMock, Mock } from 'typemoq'; - -import { - AppDto, - AppsService, - AppsState, - DialogService -} from '@app/shared/internal'; - import { createApp } from './../services/apps.service.spec'; describe('AppsState', () => { diff --git a/frontend/app/shared/state/apps.state.ts b/frontend/app/shared/state/apps.state.ts index 2ca9ed7b2..d6f3ce5fa 100644 --- a/frontend/app/shared/state/apps.state.ts +++ b/frontend/app/shared/state/apps.state.ts @@ -6,23 +6,10 @@ */ import { Injectable } from '@angular/core'; +import { defined, DialogService, shareSubscribed, State, Types } from '@app/framework'; import { Observable, of } from 'rxjs'; import { catchError, tap } from 'rxjs/operators'; - -import { - defined, - DialogService, - shareSubscribed, - State, - Types -} from '@app/framework'; - -import { - AppDto, - AppsService, - CreateAppDto, - UpdateAppDto -} from './../services/apps.service'; +import { AppDto, AppsService, CreateAppDto, UpdateAppDto } from './../services/apps.service'; interface Snapshot { // All apps, loaded once. diff --git a/frontend/app/shared/state/asset-uploader.state.spec.ts b/frontend/app/shared/state/asset-uploader.state.spec.ts index a2ea2fc69..ae42f604e 100644 --- a/frontend/app/shared/state/asset-uploader.state.spec.ts +++ b/frontend/app/shared/state/asset-uploader.state.spec.ts @@ -5,22 +5,11 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +import { AssetDto, AssetsService, AssetsState, AssetUploaderState, DialogService, ofForever, Types } from '@app/shared/internal'; import { never, of, throwError } from 'rxjs'; import { onErrorResumeNext } from 'rxjs/operators'; import { IMock, Mock } from 'typemoq'; - -import { - AssetDto, - AssetsService, - AssetsState, - AssetUploaderState, - DialogService, - ofForever, - Types -} from '@app/shared/internal'; - import { createAsset } from './../services/assets.service.spec'; - import { TestValues } from './_test-helpers'; describe('AssetUploaderState', () => { diff --git a/frontend/app/shared/state/asset-uploader.state.ts b/frontend/app/shared/state/asset-uploader.state.ts index 3ebf48177..ad4d17cc6 100644 --- a/frontend/app/shared/state/asset-uploader.state.ts +++ b/frontend/app/shared/state/asset-uploader.state.ts @@ -6,16 +6,9 @@ */ import { Injectable } from '@angular/core'; +import { DialogService, MathHelper, State, Types } from '@app/framework'; import { Observable, Subject } from 'rxjs'; import { map, publishReplay, refCount, takeUntil } from 'rxjs/operators'; - -import { - DialogService, - MathHelper, - State, - Types -} from '@app/framework'; - import { AssetDto, AssetsService } from './../services/assets.service'; import { AppsState } from './apps.state'; import { AssetsState } from './assets.state'; diff --git a/frontend/app/shared/state/assets.forms.spec.ts b/frontend/app/shared/state/assets.forms.spec.ts index e21c9af9a..8fbac582a 100644 --- a/frontend/app/shared/state/assets.forms.spec.ts +++ b/frontend/app/shared/state/assets.forms.spec.ts @@ -6,7 +6,6 @@ */ import { FormBuilder } from '@angular/forms'; - import { AnnotateAssetForm } from './assets.forms'; describe('AnnotateAssetForm', () => { diff --git a/frontend/app/shared/state/assets.forms.ts b/frontend/app/shared/state/assets.forms.ts index a99fb70cb..b8943f0c8 100644 --- a/frontend/app/shared/state/assets.forms.ts +++ b/frontend/app/shared/state/assets.forms.ts @@ -6,21 +6,9 @@ */ import { FormArray, FormBuilder, FormGroup, Validators } from '@angular/forms'; - +import { Form, Mutable, Types } from '@app/framework'; import slugify from 'slugify'; - -import { - Form, - Mutable, - Types -} from '@app/framework'; - -import { - AnnotateAssetDto, - AssetDto, - AssetFolderDto, - RenameAssetFolderDto -} from './../services/assets.service'; +import { AnnotateAssetDto, AssetDto, AssetFolderDto, RenameAssetFolderDto } from './../services/assets.service'; export class AnnotateAssetForm extends Form { public get metadata() { diff --git a/frontend/app/shared/state/assets.state.spec.ts b/frontend/app/shared/state/assets.state.spec.ts index 1aac349b1..b69e0d0fc 100644 --- a/frontend/app/shared/state/assets.state.spec.ts +++ b/frontend/app/shared/state/assets.state.spec.ts @@ -5,25 +5,11 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +import { AssetFoldersDto, AssetPathItem, AssetsDto, AssetsService, AssetsState, DialogService, LocalStoreService, MathHelper, Pager, versioned } from '@app/shared/internal'; import { of, throwError } from 'rxjs'; import { onErrorResumeNext } from 'rxjs/operators'; import { IMock, It, Mock, Times } from 'typemoq'; - -import { - AssetFoldersDto, - AssetPathItem, - AssetsDto, - AssetsService, - AssetsState, - DialogService, - LocalStoreService, - MathHelper, - Pager, - versioned -} from '@app/shared/internal'; - import { createAsset, createAssetFolder } from './../services/assets.service.spec'; - import { TestValues } from './_test-helpers'; describe('AssetsState', () => { diff --git a/frontend/app/shared/state/assets.state.ts b/frontend/app/shared/state/assets.state.ts index bb874fb38..d3ff13fd3 100644 --- a/frontend/app/shared/state/assets.state.ts +++ b/frontend/app/shared/state/assets.state.ts @@ -6,27 +6,10 @@ */ import { Injectable } from '@angular/core'; +import { compareStrings, DialogService, LocalStoreService, MathHelper, Pager, shareSubscribed, State } from '@app/framework'; import { empty, forkJoin, Observable, of, throwError } from 'rxjs'; import { catchError, finalize, tap } from 'rxjs/operators'; - -import { - compareStrings, - DialogService, - LocalStoreService, - MathHelper, - Pager, - shareSubscribed, - State -} from '@app/framework'; - -import { - AnnotateAssetDto, - AssetDto, - AssetFolderDto, - AssetsService, - RenameAssetFolderDto -} from './../services/assets.service'; - +import { AnnotateAssetDto, AssetDto, AssetFolderDto, AssetsService, RenameAssetFolderDto } from './../services/assets.service'; import { AppsState } from './apps.state'; import { Query } from './query'; diff --git a/frontend/app/shared/state/backups.forms.ts b/frontend/app/shared/state/backups.forms.ts index 986486177..92d15fe43 100644 --- a/frontend/app/shared/state/backups.forms.ts +++ b/frontend/app/shared/state/backups.forms.ts @@ -6,13 +6,7 @@ */ import { FormBuilder, FormGroup, Validators } from '@angular/forms'; - -import { - Form, - hasNoValue$, - ValidatorsEx -} from '@app/framework'; - +import { Form, hasNoValue$, ValidatorsEx } from '@app/framework'; import { StartRestoreDto } from './../services/backups.service'; export class RestoreForm extends Form { diff --git a/frontend/app/shared/state/backups.state.spec.ts b/frontend/app/shared/state/backups.state.spec.ts index 7b0478594..6c23ff620 100644 --- a/frontend/app/shared/state/backups.state.spec.ts +++ b/frontend/app/shared/state/backups.state.spec.ts @@ -5,20 +5,12 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +import { BackupsDto, BackupsService, BackupsState, DialogService } from '@app/shared/internal'; import { of, throwError } from 'rxjs'; import { onErrorResumeNext } from 'rxjs/operators'; import { IMock, It, Mock, Times } from 'typemoq'; - -import { - BackupsDto, - BackupsService, - BackupsState, - DialogService -} from '@app/shared/internal'; - -import { TestValues } from './_test-helpers'; - import { createBackup } from './../services/backups.service.spec'; +import { TestValues } from './_test-helpers'; describe('BackupsState', () => { const { diff --git a/frontend/app/shared/state/backups.state.ts b/frontend/app/shared/state/backups.state.ts index e47806d85..f94e808a0 100644 --- a/frontend/app/shared/state/backups.state.ts +++ b/frontend/app/shared/state/backups.state.ts @@ -6,18 +6,11 @@ */ import { Injectable } from '@angular/core'; +import { DialogService, shareSubscribed, State } from '@app/framework'; import { Observable } from 'rxjs'; import { finalize, tap } from 'rxjs/operators'; - -import { - DialogService, - shareSubscribed, - State -} from '@app/framework'; - -import { AppsState } from './apps.state'; - import { BackupDto, BackupsService } from './../services/backups.service'; +import { AppsState } from './apps.state'; interface Snapshot { // The current backups. diff --git a/frontend/app/shared/state/clients.forms.ts b/frontend/app/shared/state/clients.forms.ts index 190a01cf2..98a6bc78e 100644 --- a/frontend/app/shared/state/clients.forms.ts +++ b/frontend/app/shared/state/clients.forms.ts @@ -6,18 +6,8 @@ */ import { FormBuilder, FormGroup, Validators } from '@angular/forms'; - -import { - Form, - hasNoValue$, - ValidatorsEx -} from '@app/framework'; - -import { - ClientDto, - CreateClientDto, - UpdateClientDto -} from './../services/clients.service'; +import { Form, hasNoValue$, ValidatorsEx } from '@app/framework'; +import { ClientDto, CreateClientDto, UpdateClientDto } from './../services/clients.service'; export class RenameClientForm extends Form { constructor(formBuilder: FormBuilder) { diff --git a/frontend/app/shared/state/clients.state.spec.ts b/frontend/app/shared/state/clients.state.spec.ts index c235242f5..018961566 100644 --- a/frontend/app/shared/state/clients.state.spec.ts +++ b/frontend/app/shared/state/clients.state.spec.ts @@ -5,20 +5,11 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +import { ClientsPayload, ClientsService, ClientsState, DialogService, versioned } from '@app/shared/internal'; import { of, throwError } from 'rxjs'; import { onErrorResumeNext } from 'rxjs/operators'; import { IMock, It, Mock, Times } from 'typemoq'; - -import { - ClientsPayload, - ClientsService, - ClientsState, - DialogService, - versioned -} from '@app/shared/internal'; - import { createClients } from './../services/clients.service.spec'; - import { TestValues } from './_test-helpers'; describe('ClientsState', () => { diff --git a/frontend/app/shared/state/clients.state.ts b/frontend/app/shared/state/clients.state.ts index fbe975894..c20fd6670 100644 --- a/frontend/app/shared/state/clients.state.ts +++ b/frontend/app/shared/state/clients.state.ts @@ -6,26 +6,12 @@ */ import { Injectable } from '@angular/core'; +import { DialogService, shareSubscribed, State, Version } from '@app/framework'; import { Observable } from 'rxjs'; import { finalize, tap } from 'rxjs/operators'; - -import { - DialogService, - shareSubscribed, - State, - Version -} from '@app/framework'; - +import { ClientDto, ClientsPayload, ClientsService, CreateClientDto, UpdateClientDto } from './../services/clients.service'; import { AppsState } from './apps.state'; -import { - ClientDto, - ClientsPayload, - ClientsService, - CreateClientDto, - UpdateClientDto -} from './../services/clients.service'; - interface Snapshot { // The current clients. clients: ClientsList; diff --git a/frontend/app/shared/state/comments.form.ts b/frontend/app/shared/state/comments.form.ts index c7c60eec1..d46042fa3 100644 --- a/frontend/app/shared/state/comments.form.ts +++ b/frontend/app/shared/state/comments.form.ts @@ -6,9 +6,7 @@ */ import { FormBuilder, FormGroup } from '@angular/forms'; - import { Form } from '@app/framework'; - import { UpsertCommentDto } from './../services/comments.service'; export class UpsertCommentForm extends Form { diff --git a/frontend/app/shared/state/comments.state.spec.ts b/frontend/app/shared/state/comments.state.spec.ts index e10dfd45f..b88733f67 100644 --- a/frontend/app/shared/state/comments.state.spec.ts +++ b/frontend/app/shared/state/comments.state.spec.ts @@ -5,18 +5,9 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +import { CommentDto, CommentsDto, CommentsService, CommentsState, DialogService, Version } from '@app/shared/internal'; import { of } from 'rxjs'; import { IMock, Mock } from 'typemoq'; - -import { - CommentDto, - CommentsDto, - CommentsService, - CommentsState, - DialogService, - Version -} from '@app/shared/internal'; - import { TestValues } from './_test-helpers'; describe('CommentsState', () => { diff --git a/frontend/app/shared/state/comments.state.ts b/frontend/app/shared/state/comments.state.ts index 31aa17605..72a7a5cd2 100644 --- a/frontend/app/shared/state/comments.state.ts +++ b/frontend/app/shared/state/comments.state.ts @@ -5,17 +5,9 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +import { DateTime, DialogService, shareSubscribed, State, Version } from '@app/framework'; import { Observable } from 'rxjs'; import { map, tap } from 'rxjs/operators'; - -import { - DateTime, - DialogService, - shareSubscribed, - State, - Version -} from '@app/framework'; - import { CommentDto, CommentsService } from './../services/comments.service'; interface Snapshot { diff --git a/frontend/app/shared/state/contents.forms.spec.ts b/frontend/app/shared/state/contents.forms.spec.ts index 1b4b70a83..e3d7673fa 100644 --- a/frontend/app/shared/state/contents.forms.spec.ts +++ b/frontend/app/shared/state/contents.forms.spec.ts @@ -5,29 +5,10 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { AbstractControl, FormArray } from '@angular/forms'; - -import { - AppLanguageDto, - createProperties, - DateTime, - EditContentForm, - FieldDefaultValue, - FieldFormatter, - FieldPropertiesDto, - FieldsValidators, - getContentValue, - HtmlValue, - LanguageDto, - MetaFields, - NestedFieldDto, - PartitionConfig, - RootFieldDto, - SchemaDetailsDto, - SchemaPropertiesDto, - Version -} from '@app/shared/internal'; +// tslint:disable: max-line-length +import { AbstractControl, FormArray } from '@angular/forms'; +import { AppLanguageDto, createProperties, DateTime, EditContentForm, FieldDefaultValue, FieldFormatter, FieldPropertiesDto, FieldsValidators, getContentValue, HtmlValue, LanguageDto, MetaFields, NestedFieldDto, PartitionConfig, RootFieldDto, SchemaDetailsDto, SchemaPropertiesDto, Version } from '@app/shared/internal'; import { TestValues } from './_test-helpers'; const { diff --git a/frontend/app/shared/state/contents.forms.ts b/frontend/app/shared/state/contents.forms.ts index 57469dac1..340c6d418 100644 --- a/frontend/app/shared/state/contents.forms.ts +++ b/frontend/app/shared/state/contents.forms.ts @@ -5,40 +5,17 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -// tslint:disable:prefer-for-of +// tslint:disable: max-line-length +// tslint:disable: prefer-for-of import { FormArray, FormBuilder, FormGroup, ValidatorFn, Validators } from '@angular/forms'; +import { DateTime, Form, formControls, StringFormControl, Types, ValidatorsEx, value$ } from '@app/framework'; import { BehaviorSubject } from 'rxjs'; - -import { - DateTime, - Form, - formControls, - StringFormControl, - Types, - ValidatorsEx, - value$ -} from '@app/framework'; - import { AppLanguageDto } from './../services/app-languages.service'; import { ContentDto, ContentReferencesValue } from './../services/contents.service'; import { LanguageDto } from './../services/languages.service'; import { FieldDto, RootFieldDto, SchemaDetailsDto, TableField } from './../services/schemas.service'; -import { - ArrayFieldPropertiesDto, - AssetsFieldPropertiesDto, - BooleanFieldPropertiesDto, - DateTimeFieldPropertiesDto, - fieldInvariant, - FieldPropertiesVisitor, - GeolocationFieldPropertiesDto, - JsonFieldPropertiesDto, - NumberFieldPropertiesDto, - ReferencesFieldPropertiesDto, - StringFieldPropertiesDto, - TagsFieldPropertiesDto, - UIFieldPropertiesDto -} from './../services/schemas.types'; +import { ArrayFieldPropertiesDto, AssetsFieldPropertiesDto, BooleanFieldPropertiesDto, DateTimeFieldPropertiesDto, fieldInvariant, FieldPropertiesVisitor, GeolocationFieldPropertiesDto, JsonFieldPropertiesDto, NumberFieldPropertiesDto, ReferencesFieldPropertiesDto, StringFieldPropertiesDto, TagsFieldPropertiesDto, UIFieldPropertiesDto } from './../services/schemas.types'; export class HtmlValue { constructor( diff --git a/frontend/app/shared/state/contents.state.ts b/frontend/app/shared/state/contents.state.ts index 9422e1619..25210c56e 100644 --- a/frontend/app/shared/state/contents.state.ts +++ b/frontend/app/shared/state/contents.state.ts @@ -6,21 +6,9 @@ */ import { Injectable } from '@angular/core'; +import { DialogService, ErrorDto, LocalStoreService, Pager, shareSubscribed, State, Types, Version, Versioned } from '@app/framework'; import { empty, forkJoin, Observable, of } from 'rxjs'; import { catchError, finalize, switchMap, tap } from 'rxjs/operators'; - -import { - DialogService, - ErrorDto, - LocalStoreService, - Pager, - shareSubscribed, - State, - Types, - Version, - Versioned -} from '@app/framework'; - import { ContentDto, ContentsService, StatusInfo } from './../services/contents.service'; import { SchemaDto } from './../services/schemas.service'; import { AppsState } from './apps.state'; diff --git a/frontend/app/shared/state/contributors.forms.ts b/frontend/app/shared/state/contributors.forms.ts index 96f01e7bf..5d99e13ec 100644 --- a/frontend/app/shared/state/contributors.forms.ts +++ b/frontend/app/shared/state/contributors.forms.ts @@ -6,17 +6,9 @@ */ import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { Form, hasNoValue$, Types, value$ } from '@app/framework'; import { debounceTime, map, shareReplay } from 'rxjs/operators'; - -import { - Form, - hasNoValue$, - Types, - value$ -} from '@app/framework'; - import { AssignContributorDto } from './../services/contributors.service'; - import { UserDto } from './../services/users.service'; export class AssignContributorForm extends Form { diff --git a/frontend/app/shared/state/contributors.state.spec.ts b/frontend/app/shared/state/contributors.state.spec.ts index aec4e5708..f6c27695c 100644 --- a/frontend/app/shared/state/contributors.state.spec.ts +++ b/frontend/app/shared/state/contributors.state.spec.ts @@ -5,24 +5,12 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +import { ErrorDto } from '@app/framework'; +import { ContributorDto, ContributorsPayload, ContributorsService, ContributorsState, DialogService, LocalStoreService, Pager, versioned } from '@app/shared/internal'; import { empty, of, throwError } from 'rxjs'; import { catchError, onErrorResumeNext } from 'rxjs/operators'; import { IMock, It, Mock, Times } from 'typemoq'; - -import { - ContributorDto, - ContributorsPayload, - ContributorsService, - ContributorsState, - DialogService, - LocalStoreService, - Pager, - versioned -} from '@app/shared/internal'; - import { createContributors } from './../services/contributors.service.spec'; - -import { ErrorDto } from '@app/framework'; import { TestValues } from './_test-helpers'; describe('ContributorsState', () => { diff --git a/frontend/app/shared/state/contributors.state.ts b/frontend/app/shared/state/contributors.state.ts index 7cc225582..a4eb90d6c 100644 --- a/frontend/app/shared/state/contributors.state.ts +++ b/frontend/app/shared/state/contributors.state.ts @@ -6,28 +6,10 @@ */ import { Injectable } from '@angular/core'; +import { DialogService, ErrorDto, LocalStoreService, Pager, shareMapSubscribed, shareSubscribed, State, Types, Version } from '@app/framework'; import { Observable, throwError } from 'rxjs'; import { catchError, finalize, tap } from 'rxjs/operators'; - -import { - DialogService, - ErrorDto, - LocalStoreService, - Pager, - shareMapSubscribed, - shareSubscribed, - State, - Types, - Version -} from '@app/framework'; - -import { - AssignContributorDto, - ContributorDto, - ContributorsPayload, - ContributorsService -} from './../services/contributors.service'; - +import { AssignContributorDto, ContributorDto, ContributorsPayload, ContributorsService } from './../services/contributors.service'; import { AppsState } from './apps.state'; interface Snapshot { diff --git a/frontend/app/shared/state/languages.forms.ts b/frontend/app/shared/state/languages.forms.ts index aa1217008..0d1e1c05f 100644 --- a/frontend/app/shared/state/languages.forms.ts +++ b/frontend/app/shared/state/languages.forms.ts @@ -6,12 +6,9 @@ */ import { FormBuilder, FormGroup, Validators } from '@angular/forms'; - import { Form } from '@app/framework'; - -import { LanguageDto } from './../services/languages.service'; - import { AppLanguageDto, UpdateAppLanguageDto } from './../services/app-languages.service'; +import { LanguageDto } from './../services/languages.service'; export class EditLanguageForm extends Form { constructor(formBuilder: FormBuilder) { diff --git a/frontend/app/shared/state/languages.state.spec.ts b/frontend/app/shared/state/languages.state.spec.ts index ed0fe34f7..49c29b4c5 100644 --- a/frontend/app/shared/state/languages.state.spec.ts +++ b/frontend/app/shared/state/languages.state.spec.ts @@ -5,22 +5,11 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +import { AppLanguagesPayload, AppLanguagesService, DialogService, LanguageDto, LanguagesService, LanguagesState, versioned } from '@app/shared/internal'; import { of, throwError } from 'rxjs'; import { onErrorResumeNext } from 'rxjs/operators'; import { IMock, It, Mock, Times } from 'typemoq'; - -import { - AppLanguagesPayload, - AppLanguagesService, - DialogService, - LanguageDto, - LanguagesService, - LanguagesState, - versioned -} from '@app/shared/internal'; - import { createLanguages } from './../services/app-languages.service.spec'; - import { TestValues } from './_test-helpers'; describe('LanguagesState', () => { diff --git a/frontend/app/shared/state/languages.state.ts b/frontend/app/shared/state/languages.state.ts index 5908d8336..1af4daf9f 100644 --- a/frontend/app/shared/state/languages.state.ts +++ b/frontend/app/shared/state/languages.state.ts @@ -6,24 +6,10 @@ */ import { Injectable } from '@angular/core'; +import { DialogService, shareMapSubscribed, shareSubscribed, State, Version } from '@app/framework'; import { forkJoin, Observable } from 'rxjs'; import { finalize, map, shareReplay, tap } from 'rxjs/operators'; - -import { - DialogService, - shareMapSubscribed, - shareSubscribed, - State, - Version -} from '@app/framework'; - -import { - AppLanguageDto, - AppLanguagesPayload, - AppLanguagesService, - UpdateAppLanguageDto -} from './../services/app-languages.service'; - +import { AppLanguageDto, AppLanguagesPayload, AppLanguagesService, UpdateAppLanguageDto } from './../services/app-languages.service'; import { LanguageDto, LanguagesService } from './../services/languages.service'; import { AppsState } from './apps.state'; diff --git a/frontend/app/shared/state/patterns.forms.ts b/frontend/app/shared/state/patterns.forms.ts index 60b0ca5d9..d6beb634e 100644 --- a/frontend/app/shared/state/patterns.forms.ts +++ b/frontend/app/shared/state/patterns.forms.ts @@ -6,9 +6,7 @@ */ import { FormBuilder, FormGroup, Validators } from '@angular/forms'; - import { Form, ValidatorsEx } from '@app/framework'; - import { EditPatternDto, PatternDto } from './../services/patterns.service'; export class EditPatternForm extends Form { diff --git a/frontend/app/shared/state/patterns.state.spec.ts b/frontend/app/shared/state/patterns.state.spec.ts index 9ba1775f6..a63081f6f 100644 --- a/frontend/app/shared/state/patterns.state.spec.ts +++ b/frontend/app/shared/state/patterns.state.spec.ts @@ -5,20 +5,11 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +import { DialogService, PatternsPayload, PatternsService, PatternsState, versioned } from '@app/shared/internal'; import { of, throwError } from 'rxjs'; import { onErrorResumeNext } from 'rxjs/operators'; import { IMock, It, Mock, Times } from 'typemoq'; - -import { - DialogService, - PatternsPayload, - PatternsService, - PatternsState, - versioned -} from '@app/shared/internal'; - import { createPatterns } from './../services/patterns.service.spec'; - import { TestValues } from './_test-helpers'; describe('PatternsState', () => { diff --git a/frontend/app/shared/state/patterns.state.ts b/frontend/app/shared/state/patterns.state.ts index 94a980527..4294ee33e 100644 --- a/frontend/app/shared/state/patterns.state.ts +++ b/frontend/app/shared/state/patterns.state.ts @@ -6,26 +6,12 @@ */ import { Injectable } from '@angular/core'; +import { DialogService, shareMapSubscribed, shareSubscribed, State, Version } from '@app/framework'; import { Observable } from 'rxjs'; import { finalize, tap } from 'rxjs/operators'; - -import { - DialogService, - shareMapSubscribed, - shareSubscribed, - State, - Version -} from '@app/framework'; - +import { EditPatternDto, PatternDto, PatternsPayload, PatternsService } from './../services/patterns.service'; import { AppsState } from './apps.state'; -import { - EditPatternDto, - PatternDto, - PatternsPayload, - PatternsService -} from './../services/patterns.service'; - interface Snapshot { // The current patterns. patterns: PatternsList; diff --git a/frontend/app/shared/state/plans.state.spec.ts b/frontend/app/shared/state/plans.state.spec.ts index cb2f3f4f6..6eb39eee0 100644 --- a/frontend/app/shared/state/plans.state.spec.ts +++ b/frontend/app/shared/state/plans.state.spec.ts @@ -5,18 +5,10 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +import { DialogService, PlanDto, PlansService, PlansState, versioned } from '@app/shared/internal'; import { of, throwError } from 'rxjs'; import { onErrorResumeNext } from 'rxjs/operators'; import { IMock, It, Mock, Times } from 'typemoq'; - -import { - DialogService, - PlanDto, - PlansService, - PlansState, - versioned -} from '@app/shared/internal'; - import { TestValues } from './_test-helpers'; describe('PlansState', () => { diff --git a/frontend/app/shared/state/plans.state.ts b/frontend/app/shared/state/plans.state.ts index 8352027f2..f0abfeee5 100644 --- a/frontend/app/shared/state/plans.state.ts +++ b/frontend/app/shared/state/plans.state.ts @@ -6,16 +6,9 @@ */ import { Injectable } from '@angular/core'; +import { DialogService, shareSubscribed, State, Version } from '@app/framework'; import { Observable } from 'rxjs'; import { finalize, tap } from 'rxjs/operators'; - -import { - DialogService, - shareSubscribed, - State, - Version -} from '@app/framework'; - import { AuthService } from './../services/auth.service'; import { PlanDto, PlansService } from './../services/plans.service'; import { AppsState } from './apps.state'; diff --git a/frontend/app/shared/state/queries.spec.ts b/frontend/app/shared/state/queries.spec.ts index 87e4acbfd..d4d8ee71f 100644 --- a/frontend/app/shared/state/queries.spec.ts +++ b/frontend/app/shared/state/queries.spec.ts @@ -5,14 +5,9 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +import { Queries, SavedQuery, UIState } from '@app/shared/internal'; import { BehaviorSubject } from 'rxjs'; -import { IMock, Mock, Times } from 'typemoq'; - -import { - Queries, - SavedQuery, - UIState -} from '@app/shared/internal'; +import { IMock, Mock, Times } from 'typemoq'; describe('Queries', () => { const prefix = 'schemas.my-schema'; diff --git a/frontend/app/shared/state/queries.ts b/frontend/app/shared/state/queries.ts index 479171885..fa115fe1a 100644 --- a/frontend/app/shared/state/queries.ts +++ b/frontend/app/shared/state/queries.ts @@ -5,17 +5,10 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +import { compareStrings } from '@app/framework'; import { Observable } from 'rxjs'; import { map, shareReplay } from 'rxjs/operators'; - -import { compareStrings } from '@app/framework'; - -import { - decodeQuery, - equalsQuery, - Query -} from './query'; - +import { decodeQuery, equalsQuery, Query } from './query'; import { UIState } from './ui.state'; export interface SavedQuery { diff --git a/frontend/app/shared/state/query.ts b/frontend/app/shared/state/query.ts index 4e38b6a0a..b8c93f2aa 100644 --- a/frontend/app/shared/state/query.ts +++ b/frontend/app/shared/state/query.ts @@ -8,7 +8,6 @@ // tslint:disable: readonly-array import { Types } from '@app/framework'; - import { StatusInfo } from './../services/contents.service'; import { LanguageDto } from './../services/languages.service'; import { MetaFields, SchemaDetailsDto } from './../services/schemas.service'; diff --git a/frontend/app/shared/state/roles.forms.ts b/frontend/app/shared/state/roles.forms.ts index 247df239a..1af14a3f2 100644 --- a/frontend/app/shared/state/roles.forms.ts +++ b/frontend/app/shared/state/roles.forms.ts @@ -6,18 +6,8 @@ */ import { FormArray, FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; - -import { - Form, - hasNoValue$, - hasValue$ -} from '@app/framework'; - -import { - CreateRoleDto, - RoleDto, - UpdateRoleDto -} from './../services/roles.service'; +import { Form, hasNoValue$, hasValue$ } from '@app/framework'; +import { CreateRoleDto, RoleDto, UpdateRoleDto } from './../services/roles.service'; export class EditRoleForm extends Form { public get controls() { diff --git a/frontend/app/shared/state/roles.state.spec.ts b/frontend/app/shared/state/roles.state.spec.ts index 03d5f7b38..78f87cc88 100644 --- a/frontend/app/shared/state/roles.state.spec.ts +++ b/frontend/app/shared/state/roles.state.spec.ts @@ -5,20 +5,11 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +import { DialogService, RolesPayload, RolesService, RolesState, versioned } from '@app/shared/internal'; import { of, throwError } from 'rxjs'; import { onErrorResumeNext } from 'rxjs/operators'; import { IMock, It, Mock, Times } from 'typemoq'; - -import { - DialogService, - RolesPayload, - RolesService, - RolesState, - versioned -} from '@app/shared/internal'; - import { createRoles } from './../services/roles.service.spec'; - import { TestValues } from './_test-helpers'; describe('RolesState', () => { diff --git a/frontend/app/shared/state/roles.state.ts b/frontend/app/shared/state/roles.state.ts index c95b92f97..10a17b491 100644 --- a/frontend/app/shared/state/roles.state.ts +++ b/frontend/app/shared/state/roles.state.ts @@ -6,26 +6,12 @@ */ import { Injectable } from '@angular/core'; +import { DialogService, shareSubscribed, State, Version } from '@app/framework'; import { Observable } from 'rxjs'; import { finalize, tap } from 'rxjs/operators'; - -import { - DialogService, - shareSubscribed, - State, - Version -} from '@app/framework'; - +import { CreateRoleDto, RoleDto, RolesPayload, RolesService, UpdateRoleDto } from './../services/roles.service'; import { AppsState } from './apps.state'; -import { - CreateRoleDto, - RoleDto, - RolesPayload, - RolesService, - UpdateRoleDto -} from './../services/roles.service'; - interface Snapshot { // The current roles. roles: RolesList; diff --git a/frontend/app/shared/state/rule-events.state.spec.ts b/frontend/app/shared/state/rule-events.state.spec.ts index 98b548be1..a7b6ca496 100644 --- a/frontend/app/shared/state/rule-events.state.spec.ts +++ b/frontend/app/shared/state/rule-events.state.spec.ts @@ -5,21 +5,11 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +import { DialogService, LocalStoreService, Pager, RuleEventsDto, RuleEventsState, RulesService } from '@app/shared/internal'; import { of, throwError } from 'rxjs'; import { onErrorResumeNext } from 'rxjs/operators'; import { IMock, It, Mock, Times } from 'typemoq'; - -import { - DialogService, - LocalStoreService, - Pager, - RuleEventsDto, - RuleEventsState, - RulesService -} from '@app/shared/internal'; - import { createRuleEvent } from './../services/rules.service.spec'; - import { TestValues } from './_test-helpers'; describe('RuleEventsState', () => { diff --git a/frontend/app/shared/state/rule-events.state.ts b/frontend/app/shared/state/rule-events.state.ts index 7c2e5b4c1..030e0527f 100644 --- a/frontend/app/shared/state/rule-events.state.ts +++ b/frontend/app/shared/state/rule-events.state.ts @@ -6,20 +6,11 @@ */ import { Injectable } from '@angular/core'; +import { DialogService, LocalStoreService, Pager, shareSubscribed, State } from '@app/framework'; import { empty, Observable } from 'rxjs'; import { finalize, tap } from 'rxjs/operators'; - -import { - DialogService, - LocalStoreService, - Pager, - shareSubscribed, - State -} from '@app/framework'; - -import { AppsState } from './apps.state'; - import { RuleEventDto, RulesService } from './../services/rules.service'; +import { AppsState } from './apps.state'; interface Snapshot { // The current rule events. diff --git a/frontend/app/shared/state/rules.state.spec.ts b/frontend/app/shared/state/rules.state.spec.ts index 99109dfdd..52c9729a3 100644 --- a/frontend/app/shared/state/rules.state.spec.ts +++ b/frontend/app/shared/state/rules.state.spec.ts @@ -5,21 +5,13 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +import { DialogService, RulesDto, RulesService, versioned } from '@app/shared/internal'; import { of, throwError } from 'rxjs'; import { onErrorResumeNext } from 'rxjs/operators'; import { IMock, It, Mock, Times } from 'typemoq'; - -import { RulesState } from './rules.state'; - -import { - DialogService, - RulesDto, - RulesService, - versioned -} from '@app/shared/internal'; - +import { RuleDto } from './../services/rules.service'; import { createRule } from './../services/rules.service.spec'; - +import { RulesState } from './rules.state'; import { TestValues } from './_test-helpers'; describe('RulesState', () => { @@ -53,7 +45,7 @@ describe('RulesState', () => { describe('Loading', () => { it('should load rules', () => { rulesService.setup(x => x.getRules(app)) - .returns(() => of(new RulesDto([rule1, rule2]))).verifiable(); + .returns(() => of(new RulesDto([rule1, rule2], {}, rule1.id))).verifiable(); rulesState.load().subscribe(); @@ -61,6 +53,15 @@ describe('RulesState', () => { expect(rulesState.snapshot.isLoading).toBeFalsy(); expect(rulesState.snapshot.rules).toEqual([rule1, rule2]); + let runningRule: RuleDto | undefined; + + rulesState.runningRule.subscribe(result => { + runningRule = result; + }); + + expect(runningRule).toBe(rule1); + expect(rulesState.snapshot.runningRuleId).toBe(rule1.id); + dialogs.verify(x => x.notifyInfo(It.isAnyString()), Times.never()); }); @@ -174,6 +175,17 @@ describe('RulesState', () => { expect(rule1New).toEqual(rule1); }); + it('should not update rule when run', () => { + rulesService.setup(x => x.runRule(app, rule1)) + .returns(() => of()).verifiable(); + + rulesState.run(rule1).subscribe(); + + const rule1New = rulesState.snapshot.rules[0]; + + expect(rule1New).toEqual(rule1); + }); + it('should update rule when disabled', () => { const updated = createRule(1, '_new'); @@ -195,5 +207,12 @@ describe('RulesState', () => { expect(rulesState.snapshot.rules).toEqual([rule2]); }); + + it('should invoke rule service when run is cancelled', () => { + rulesService.setup(x => x.runCancel(app)) + .returns(() => of()).verifiable(); + + rulesState.runCancel().subscribe(); + }); }); }); \ No newline at end of file diff --git a/frontend/app/shared/state/rules.state.ts b/frontend/app/shared/state/rules.state.ts index b1e0e15f7..f98252b77 100644 --- a/frontend/app/shared/state/rules.state.ts +++ b/frontend/app/shared/state/rules.state.ts @@ -6,23 +6,12 @@ */ import { Injectable } from '@angular/core'; +import { DialogService, shareSubscribed, State } from '@app/framework'; import { Observable } from 'rxjs'; import { finalize, tap } from 'rxjs/operators'; - -import { - DialogService, - shareSubscribed, - State -} from '@app/framework'; - +import { RuleDto, RulesService, UpsertRuleDto } from './../services/rules.service'; import { AppsState } from './apps.state'; -import { - RuleDto, - RulesService, - UpsertRuleDto -} from './../services/rules.service'; - interface Snapshot { // The current rules. rules: RulesList; @@ -33,6 +22,12 @@ interface Snapshot { // Indicates if the rules are loading. isLoading?: boolean; + // The id of the rule that is currently running. + runningRuleId?: string; + + // Indicates if a rule run can be cancelled. + canCancelRun?: boolean; + // Indicates if the user can create rules. canCreate?: boolean; @@ -56,9 +51,18 @@ export class RulesState extends State { public canCreate = this.project(x => x.canCreate === true); + public canCancelRun = + this.project(x => x.canCancelRun === true); + public canReadEvents = this.project(x => x.canReadEvents === true); + public runningRuleId = + this.project(x => x.runningRuleId); + + public runningRule = + this.projectFrom2(this.rules, this.runningRuleId, (r, id) => r.find(x => x.id === id)); + constructor( private readonly appsState: AppsState, private readonly dialogs: DialogService, @@ -79,16 +83,18 @@ export class RulesState extends State { this.next({ isLoading: true }); return this.rulesService.getRules(this.appName).pipe( - tap(({ items: rules, canCreate, canReadEvents }) => { + tap(({ items: rules, runningRuleId, canCancelRun, canCreate, canReadEvents }) => { if (isReload) { this.dialogs.notifyInfo('Rules reloaded.'); } this.next({ + canCancelRun, canCreate, canReadEvents, isLoaded: true, isLoading: false, + runningRuleId, rules }); }), @@ -162,6 +168,14 @@ export class RulesState extends State { shareSubscribed(this.dialogs)); } + public run(rule: RuleDto): Observable { + return this.rulesService.runRule(this.appName, rule).pipe( + tap(() => { + this.dialogs.notifyInfo('Rule will start to run in a few seconds.'); + }), + shareSubscribed(this.dialogs)); + } + public trigger(rule: RuleDto): Observable { return this.rulesService.triggerRule(this.appName, rule).pipe( tap(() => { @@ -170,6 +184,14 @@ export class RulesState extends State { shareSubscribed(this.dialogs)); } + public runCancel(): Observable { + return this.rulesService.runCancel(this.appName).pipe( + tap(() => { + this.dialogs.notifyInfo('Rule will stop soon.'); + }), + shareSubscribed(this.dialogs)); + } + private replaceRule(rule: RuleDto) { this.next(s => { const rules = s.rules.replaceBy('id', rule); diff --git a/frontend/app/shared/state/schema-tag-source.ts b/frontend/app/shared/state/schema-tag-source.ts index 0b2157d38..543cbe144 100644 --- a/frontend/app/shared/state/schema-tag-source.ts +++ b/frontend/app/shared/state/schema-tag-source.ts @@ -6,10 +6,8 @@ */ import { Injectable } from '@angular/core'; -import { map, shareReplay } from 'rxjs/operators'; - import { Converter, TagValue } from '@app/framework'; - +import { map, shareReplay } from 'rxjs/operators'; import { SchemaDto } from './../services/schemas.service'; import { SchemasState } from './schemas.state'; diff --git a/frontend/app/shared/state/schemas.forms.ts b/frontend/app/shared/state/schemas.forms.ts index c2f75771a..70e92de11 100644 --- a/frontend/app/shared/state/schemas.forms.ts +++ b/frontend/app/shared/state/schemas.forms.ts @@ -6,23 +6,9 @@ */ import { FormArray, FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { Form, ValidatorsEx, value$ } from '@app/framework'; import { map } from 'rxjs/operators'; - -import { - Form, - ValidatorsEx, - value$ -} from '@app/framework'; - -import { - AddFieldDto, - CreateSchemaDto, - SchemaDetailsDto, - SchemaPropertiesDto, - SynchronizeSchemaDto, - UpdateSchemaDto -} from './../services/schemas.service'; - +import { AddFieldDto, CreateSchemaDto, SchemaDetailsDto, SchemaPropertiesDto, SynchronizeSchemaDto, UpdateSchemaDto } from './../services/schemas.service'; import { createProperties, FieldPropertiesDto } from './../services/schemas.types'; type CreateCategoryFormType = { name: string }; diff --git a/frontend/app/shared/state/schemas.state.spec.ts b/frontend/app/shared/state/schemas.state.spec.ts index 87af44e05..a9e4308fa 100644 --- a/frontend/app/shared/state/schemas.state.spec.ts +++ b/frontend/app/shared/state/schemas.state.spec.ts @@ -5,23 +5,12 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +import { DialogService, FieldDto, SchemaDetailsDto, SchemasService, UpdateSchemaCategoryDto, versioned } from '@app/shared/internal'; import { of, throwError } from 'rxjs'; import { onErrorResumeNext } from 'rxjs/operators'; import { IMock, It, Mock, Times } from 'typemoq'; - -import { SchemaCategory, SchemasState } from './schemas.state'; - -import { - DialogService, - FieldDto, - SchemaDetailsDto, - SchemasService, - UpdateSchemaCategoryDto, - versioned -} from '@app/shared/internal'; - import { createSchema, createSchemaDetails } from './../services/schemas.service.spec'; - +import { SchemaCategory, SchemasState } from './schemas.state'; import { TestValues } from './_test-helpers'; describe('SchemasState', () => { diff --git a/frontend/app/shared/state/schemas.state.ts b/frontend/app/shared/state/schemas.state.ts index 1c3f16fb3..651a6ee00 100644 --- a/frontend/app/shared/state/schemas.state.ts +++ b/frontend/app/shared/state/schemas.state.ts @@ -6,36 +6,12 @@ */ import { Injectable } from '@angular/core'; +import { compareStrings, defined, DialogService, shareMapSubscribed, shareSubscribed, State, Types, Version } from '@app/framework'; import { empty, Observable, of } from 'rxjs'; import { catchError, finalize, tap } from 'rxjs/operators'; - -import { - compareStrings, - defined, - DialogService, - shareMapSubscribed, - shareSubscribed, - State, - Types, - Version -} from '@app/framework'; - +import { AddFieldDto, CreateSchemaDto, FieldDto, NestedFieldDto, RootFieldDto, SchemaDetailsDto, SchemaDto, SchemasService, UpdateFieldDto, UpdateSchemaDto, UpdateUIFields } from './../services/schemas.service'; import { AppsState } from './apps.state'; -import { - AddFieldDto, - CreateSchemaDto, - FieldDto, - NestedFieldDto, - RootFieldDto, - SchemaDetailsDto, - SchemaDto, - SchemasService, - UpdateFieldDto, - UpdateSchemaDto, - UpdateUIFields -} from './../services/schemas.service'; - type AnyFieldDto = NestedFieldDto | RootFieldDto; interface Snapshot { diff --git a/frontend/app/shared/state/table-fields.spec.ts b/frontend/app/shared/state/table-fields.spec.ts index 3e9c9204c..f401e2153 100644 --- a/frontend/app/shared/state/table-fields.spec.ts +++ b/frontend/app/shared/state/table-fields.spec.ts @@ -5,21 +5,11 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +import { DateTime, Version } from '@app/framework'; +import { createProperties, MetaFields, RootFieldDto, SchemaDetailsDto, TableField, TableFields, UIState } from '@app/shared/internal'; import { of } from 'rxjs'; import { IMock, Mock, Times } from 'typemoq'; -import { DateTime, Version } from '@app/framework'; - -import { - createProperties, - MetaFields, - RootFieldDto, - SchemaDetailsDto, - TableField, - TableFields, - UIState -} from '@app/shared/internal'; - describe('TableFields', () => { let uiState: IMock; diff --git a/frontend/app/shared/state/table-fields.ts b/frontend/app/shared/state/table-fields.ts index af17bcea6..ea3d5654b 100644 --- a/frontend/app/shared/state/table-fields.ts +++ b/frontend/app/shared/state/table-fields.ts @@ -9,13 +9,7 @@ import { BehaviorSubject, Observable } from 'rxjs'; import { take } from 'rxjs/operators'; - -import { - MetaFields, - SchemaDetailsDto, - TableField -} from './../services/schemas.service'; - +import { MetaFields, SchemaDetailsDto, TableField } from './../services/schemas.service'; import { UIState } from './ui.state'; const META_FIELD_NAMES = Object.values(MetaFields); diff --git a/frontend/app/shared/state/ui.state.spec.ts b/frontend/app/shared/state/ui.state.spec.ts index a2bd1423d..179bcf6eb 100644 --- a/frontend/app/shared/state/ui.state.spec.ts +++ b/frontend/app/shared/state/ui.state.spec.ts @@ -5,17 +5,9 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +import { ResourceLinks, ResourcesDto, UIService, UIState, UsersService } from '@app/shared/internal'; import { of } from 'rxjs'; import { IMock, Mock } from 'typemoq'; - -import { - ResourceLinks, - ResourcesDto, - UIService, - UIState, - UsersService -} from '@app/shared/internal'; - import { TestValues } from './_test-helpers'; describe('UIState', () => { diff --git a/frontend/app/shared/state/ui.state.ts b/frontend/app/shared/state/ui.state.ts index 451822764..b1c73b697 100644 --- a/frontend/app/shared/state/ui.state.ts +++ b/frontend/app/shared/state/ui.state.ts @@ -6,19 +6,11 @@ */ import { Injectable } from '@angular/core'; +import { hasAnyLink, State, Types } from '@app/framework'; import { distinctUntilChanged, map } from 'rxjs/operators'; - -import { - hasAnyLink, - State, - Types -} from '@app/framework'; - -import { AppsState } from './apps.state'; - import { UIService, UISettingsDto } from './../services/ui.service'; - import { UsersService } from './../services/users.service'; +import { AppsState } from './apps.state'; interface Snapshot { // All common settings. diff --git a/frontend/app/shared/state/workflows.forms.ts b/frontend/app/shared/state/workflows.forms.ts index e212d035e..46669c171 100644 --- a/frontend/app/shared/state/workflows.forms.ts +++ b/frontend/app/shared/state/workflows.forms.ts @@ -6,9 +6,7 @@ */ import { FormBuilder, FormGroup, Validators } from '@angular/forms'; - import { Form, hasNoValue$ } from '@app/framework'; - import { CreateWorkflowDto } from './../services/workflows.service'; export class AddWorkflowForm extends Form { diff --git a/frontend/app/shared/state/workflows.state.spec.ts b/frontend/app/shared/state/workflows.state.spec.ts index 8bd7259a3..01aa8087d 100644 --- a/frontend/app/shared/state/workflows.state.spec.ts +++ b/frontend/app/shared/state/workflows.state.spec.ts @@ -5,20 +5,11 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +import { DialogService, versioned, WorkflowsPayload, WorkflowsService, WorkflowsState } from '@app/shared/internal'; import { of, throwError } from 'rxjs'; import { onErrorResumeNext } from 'rxjs/operators'; import { IMock, It, Mock, Times } from 'typemoq'; - -import { - DialogService, - versioned, - WorkflowsPayload, - WorkflowsService, - WorkflowsState -} from '@app/shared/internal'; - import { createWorkflows } from './../services/workflows.service.spec'; - import { TestValues } from './_test-helpers'; describe('WorkflowsState', () => { diff --git a/frontend/app/shared/state/workflows.state.ts b/frontend/app/shared/state/workflows.state.ts index 1e8e5b7b2..60307f66a 100644 --- a/frontend/app/shared/state/workflows.state.ts +++ b/frontend/app/shared/state/workflows.state.ts @@ -6,24 +6,12 @@ */ import { Injectable } from '@angular/core'; +import { DialogService, shareSubscribed, State, Version } from '@app/framework'; import { Observable } from 'rxjs'; import { finalize, tap } from 'rxjs/operators'; - -import { - DialogService, - shareSubscribed, - State, - Version -} from '@app/framework'; - +import { WorkflowDto, WorkflowsPayload, WorkflowsService } from './../services/workflows.service'; import { AppsState } from './apps.state'; -import { - WorkflowDto, - WorkflowsPayload, - WorkflowsService -} from './../services/workflows.service'; - interface Snapshot { // The current workflow. workflows: ReadonlyArray; diff --git a/frontend/app/shell/declarations.ts b/frontend/app/shell/declarations.ts index 0e99d5f09..683a6f4e7 100644 --- a/frontend/app/shell/declarations.ts +++ b/frontend/app/shell/declarations.ts @@ -17,4 +17,4 @@ export * from './pages/internal/profile-menu.component'; export * from './pages/internal/search-menu.component'; export * from './pages/login/login-page.component'; export * from './pages/logout/logout-page.component'; -export * from './pages/not-found/not-found-page.component'; \ No newline at end of file +export * from './pages/not-found/not-found-page.component'; diff --git a/frontend/app/shell/index.ts b/frontend/app/shell/index.ts index d34c6d2ae..da0f82225 100644 --- a/frontend/app/shell/index.ts +++ b/frontend/app/shell/index.ts @@ -6,4 +6,4 @@ */ export * from './declarations'; -export * from './module'; \ No newline at end of file +export * from './module'; diff --git a/frontend/app/shell/module.ts b/frontend/app/shell/module.ts index b6d4d6a37..eeaa01ca6 100644 --- a/frontend/app/shell/module.ts +++ b/frontend/app/shell/module.ts @@ -5,25 +5,11 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { NgModule } from '@angular/core'; +// tslint:disable: max-line-length +import { NgModule } from '@angular/core'; import { SqxFrameworkModule, SqxSharedModule } from '@app/shared'; - -import { - AppAreaComponent, - AppsMenuComponent, - ForbiddenPageComponent, - HomePageComponent, - InternalAreaComponent, - LeftMenuComponent, - LoginPageComponent, - LogoComponent, - LogoutPageComponent, - NotFoundPageComponent, - NotificationsMenuComponent, - ProfileMenuComponent, - SearchMenuComponent -} from './declarations'; +import { AppAreaComponent, AppsMenuComponent, ForbiddenPageComponent, HomePageComponent, InternalAreaComponent, LeftMenuComponent, LoginPageComponent, LogoComponent, LogoutPageComponent, NotFoundPageComponent, NotificationsMenuComponent, ProfileMenuComponent, SearchMenuComponent } from './declarations'; @NgModule({ imports: [ diff --git a/frontend/app/shell/pages/app/app-area.component.ts b/frontend/app/shell/pages/app/app-area.component.ts index 1837925de..d3de409c4 100644 --- a/frontend/app/shell/pages/app/app-area.component.ts +++ b/frontend/app/shell/pages/app/app-area.component.ts @@ -6,7 +6,6 @@ */ import { Component } from '@angular/core'; - import { AppsState } from '@app/shared'; @Component({ diff --git a/frontend/app/shell/pages/app/left-menu.component.ts b/frontend/app/shell/pages/app/left-menu.component.ts index 7e95e7496..8279f7d68 100644 --- a/frontend/app/shell/pages/app/left-menu.component.ts +++ b/frontend/app/shell/pages/app/left-menu.component.ts @@ -6,7 +6,6 @@ */ import { ChangeDetectionStrategy, Component } from '@angular/core'; - import { AppsState } from '@app/shared'; @Component({ diff --git a/frontend/app/shell/pages/home/home-page.component.ts b/frontend/app/shell/pages/home/home-page.component.ts index 4403ddaa4..a277baac0 100644 --- a/frontend/app/shell/pages/home/home-page.component.ts +++ b/frontend/app/shell/pages/home/home-page.component.ts @@ -7,7 +7,6 @@ import { Component } from '@angular/core'; import { Router } from '@angular/router'; - import { AuthService } from '@app/shared'; @Component({ diff --git a/frontend/app/shell/pages/internal/apps-menu.component.ts b/frontend/app/shell/pages/internal/apps-menu.component.ts index 18dc1d355..448ab3b97 100644 --- a/frontend/app/shell/pages/internal/apps-menu.component.ts +++ b/frontend/app/shell/pages/internal/apps-menu.component.ts @@ -6,15 +6,7 @@ */ import { ChangeDetectionStrategy, Component } from '@angular/core'; - -import { - AppDto, - AppsState, - DialogModel, - fadeAnimation, - ModalModel, - UIState -} from '@app/shared'; +import { AppDto, AppsState, DialogModel, fadeAnimation, ModalModel, UIState } from '@app/shared'; @Component({ selector: 'sqx-apps-menu', diff --git a/frontend/app/shell/pages/internal/internal-area.component.ts b/frontend/app/shell/pages/internal/internal-area.component.ts index 1213cb517..e07492f59 100644 --- a/frontend/app/shell/pages/internal/internal-area.component.ts +++ b/frontend/app/shell/pages/internal/internal-area.component.ts @@ -7,13 +7,7 @@ import { Component, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; - -import { - DialogService, - LoadingService, - Notification, - ResourceOwner -} from '@app/shared'; +import { DialogService, LoadingService, Notification, ResourceOwner } from '@app/shared'; @Component({ selector: 'sqx-internal-area', diff --git a/frontend/app/shell/pages/internal/notifications-menu.component.ts b/frontend/app/shell/pages/internal/notifications-menu.component.ts index 02e5dc9fe..1879e6d66 100644 --- a/frontend/app/shell/pages/internal/notifications-menu.component.ts +++ b/frontend/app/shell/pages/internal/notifications-menu.component.ts @@ -6,21 +6,10 @@ */ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit } from '@angular/core'; +import { AuthService, CommentDto, CommentsService, CommentsState, DialogService, fadeAnimation, LocalStoreService, ModalModel, ResourceOwner } from '@app/shared'; import { timer } from 'rxjs'; import { onErrorResumeNext, switchMap, tap } from 'rxjs/operators'; -import { - AuthService, - CommentDto, - CommentsService, - CommentsState, - DialogService, - fadeAnimation, - LocalStoreService, - ModalModel, - ResourceOwner -} from '@app/shared'; - const CONFIG_KEY = 'notifications.version'; @Component({ diff --git a/frontend/app/shell/pages/internal/profile-menu.component.ts b/frontend/app/shell/pages/internal/profile-menu.component.ts index b3302385c..bc37a1ced 100644 --- a/frontend/app/shell/pages/internal/profile-menu.component.ts +++ b/frontend/app/shell/pages/internal/profile-menu.component.ts @@ -6,15 +6,7 @@ */ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit } from '@angular/core'; - -import { - ApiUrlConfig, - AuthService, - fadeAnimation, - ModalModel, - StatefulComponent, - UIState -} from '@app/shared'; +import { ApiUrlConfig, AuthService, fadeAnimation, ModalModel, StatefulComponent, UIState } from '@app/shared'; interface State { // The display name of the user. diff --git a/frontend/app/shell/pages/internal/search-menu.component.ts b/frontend/app/shell/pages/internal/search-menu.component.ts index 85267b401..832f6c18a 100644 --- a/frontend/app/shell/pages/internal/search-menu.component.ts +++ b/frontend/app/shell/pages/internal/search-menu.component.ts @@ -7,18 +7,9 @@ import { ChangeDetectionStrategy, Component, Injectable, ViewChild } from '@angular/core'; import { Router } from '@angular/router'; +import { ApiUrlConfig, AppsState, AutocompleteComponent, AutocompleteSource, SearchResultDto, SearchService, Types } from '@app/shared/internal'; import { Observable, of } from 'rxjs'; -import { - ApiUrlConfig, - AppsState, - AutocompleteComponent, - AutocompleteSource, - SearchResultDto, - SearchService, - Types -} from '@app/shared/internal'; - @Injectable() export class SearchSource implements AutocompleteSource { public selectedAppOrNull = this.appsState.selectedAppOrNull; diff --git a/frontend/app/shell/pages/login/login-page.component.ts b/frontend/app/shell/pages/login/login-page.component.ts index 447454f44..9acf381c7 100644 --- a/frontend/app/shell/pages/login/login-page.component.ts +++ b/frontend/app/shell/pages/login/login-page.component.ts @@ -7,7 +7,6 @@ import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router'; - import { AuthService } from '@app/shared'; @Component({ diff --git a/frontend/app/shell/pages/logout/logout-page.component.ts b/frontend/app/shell/pages/logout/logout-page.component.ts index 166f8a484..a8db1137e 100644 --- a/frontend/app/shell/pages/logout/logout-page.component.ts +++ b/frontend/app/shell/pages/logout/logout-page.component.ts @@ -7,7 +7,6 @@ import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router'; - import { AuthService } from '@app/shared'; @Component({ diff --git a/frontend/app/shims.ts b/frontend/app/shims.ts index f42f6e637..e27812526 100644 --- a/frontend/app/shims.ts +++ b/frontend/app/shims.ts @@ -5,16 +5,36 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import 'reflect-metadata'; - -// ES2015 symbol capabilities -import 'core-js/modules/es.symbol'; - +import 'core-js/es/date'; +import 'core-js/es/math'; +import 'core-js/es/number'; +import 'core-js/es/regexp'; +// ES2015 array capabilities +import 'core-js/modules/es.array.copy-within'; +import 'core-js/modules/es.array.every'; +import 'core-js/modules/es.array.fill'; +import 'core-js/modules/es.array.filter'; +import 'core-js/modules/es.array.find'; +import 'core-js/modules/es.array.find-index'; +import 'core-js/modules/es.array.for-each'; +import 'core-js/modules/es.array.from'; +import 'core-js/modules/es.array.index-of'; +import 'core-js/modules/es.array.is-array'; +import 'core-js/modules/es.array.iterator'; +import 'core-js/modules/es.array.join'; +import 'core-js/modules/es.array.last-index-of'; +import 'core-js/modules/es.array.map'; +import 'core-js/modules/es.array.of'; +import 'core-js/modules/es.array.reduce'; +import 'core-js/modules/es.array.reduce-right'; +import 'core-js/modules/es.array.slice'; +import 'core-js/modules/es.array.some'; +import 'core-js/modules/es.array.sort'; // ES2015 function capabilities import 'core-js/modules/es.function.bind'; import 'core-js/modules/es.function.has-instance'; import 'core-js/modules/es.function.name'; - +import 'core-js/modules/es.map'; // ES2015 object capabilities import 'core-js/modules/es.object.assign'; import 'core-js/modules/es.object.create'; @@ -33,29 +53,10 @@ import 'core-js/modules/es.object.prevent-extensions'; import 'core-js/modules/es.object.seal'; import 'core-js/modules/es.object.set-prototype-of'; import 'core-js/modules/es.object.to-string'; - -// ES2015 array capabilities -import 'core-js/modules/es.array.copy-within'; -import 'core-js/modules/es.array.every'; -import 'core-js/modules/es.array.fill'; -import 'core-js/modules/es.array.filter'; -import 'core-js/modules/es.array.find'; -import 'core-js/modules/es.array.find-index'; -import 'core-js/modules/es.array.for-each'; -import 'core-js/modules/es.array.from'; -import 'core-js/modules/es.array.index-of'; -import 'core-js/modules/es.array.is-array'; -import 'core-js/modules/es.array.iterator'; -import 'core-js/modules/es.array.join'; -import 'core-js/modules/es.array.last-index-of'; -import 'core-js/modules/es.array.map'; -import 'core-js/modules/es.array.of'; -import 'core-js/modules/es.array.reduce'; -import 'core-js/modules/es.array.reduce-right'; -import 'core-js/modules/es.array.slice'; -import 'core-js/modules/es.array.some'; -import 'core-js/modules/es.array.sort'; - +import 'core-js/modules/es.parse-float'; +import 'core-js/modules/es.parse-int'; +import 'core-js/modules/es.promise'; +import 'core-js/modules/es.set'; // ES2015 string capabilities import 'core-js/modules/es.string.anchor'; import 'core-js/modules/es.string.big'; @@ -79,19 +80,9 @@ import 'core-js/modules/es.string.strike'; import 'core-js/modules/es.string.sub'; import 'core-js/modules/es.string.sup'; import 'core-js/modules/es.string.trim'; - -import 'core-js/modules/es.parse-float'; -import 'core-js/modules/es.parse-int'; - -import 'core-js/es/date'; -import 'core-js/es/math'; -import 'core-js/es/number'; -import 'core-js/es/regexp'; - -import 'core-js/modules/es.map'; -import 'core-js/modules/es.promise'; -import 'core-js/modules/es.set'; +// ES2015 symbol capabilities +import 'core-js/modules/es.symbol'; import 'core-js/modules/es.weak-map'; import 'core-js/modules/web.dom-collections.iterator'; - +import 'reflect-metadata'; import 'zone.js/dist/zone'; \ No newline at end of file