From fd51ab9f6365fe088516600183b56e6b68d18ae4 Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Sun, 12 Feb 2023 14:55:47 +0100 Subject: [PATCH] Autocompletion fixes (#972) * Several fixes. * Improved autocompletion. * Fix tests. --- .../Actions/Webhook/WebhookAction.cs | 1 + .../FieldDescriptions.Designer.cs | 1784 +++++++++-------- .../FieldDescriptions.resx | 11 +- .../ContentWrapper/ContentDataObject.cs | 2 +- .../Scripting/IScriptDescriptor.cs | 2 +- .../Scripting/ScriptExecutionContext.cs | 2 +- .../Scripting/ScriptingCompleter.cs | 62 +- .../Scripting/ScriptingValue.cs | 5 +- .../Controllers/Schemas/SchemasController.cs | 17 +- .../Scripting/ScriptingCompleterTests.cs | 21 + frontend/.storybook/main.js | 18 +- .../pages/content/content-event.component.ts | 10 +- .../content/editor/content-field.component.ts | 12 +- .../editor/content-section.component.ts | 10 +- .../editor/field-copy-button.component.ts | 10 +- .../content-inspection.component.ts | 12 +- .../content-references.component.ts | 10 +- .../contents/custom-view-editor.component.ts | 4 +- .../shared/content-extension.component.ts | 12 +- .../shared/forms/array-editor.component.ts | 12 +- .../shared/forms/array-item.component.ts | 12 +- .../shared/forms/component.component.ts | 10 +- .../shared/forms/field-editor.component.ts | 10 +- .../shared/forms/iframe-editor.component.ts | 18 +- .../content/shared/list/content.component.ts | 12 +- .../reference-dropdown.component.ts | 12 +- .../references/reference-item.component.ts | 4 +- .../references-checkboxes.component.html | 2 +- .../references-checkboxes.component.ts | 10 +- .../references/references-tag-converter.ts | 8 +- .../references/references-tags.component.html | 2 +- .../references/references-tags.component.ts | 12 +- .../pages/cards/history-card.component.ts | 4 +- .../pages/dashboard-config.component.ts | 12 +- .../src/app/features/rules/declarations.ts | 1 + frontend/src/app/features/rules/module.ts | 3 +- .../simulator/rule-transition.component.ts | 10 +- .../actions/formattable-input.component.html | 2 +- .../actions/formattable-input.component.scss | 4 + .../actions/formattable-input.component.ts | 2 +- .../actions/generic-action.component.ts | 10 +- .../shared/triggers/completions-cache.ts | 40 + .../content-changed-schema.component.html | 29 + .../content-changed-schema.component.scss | 8 + .../content-changed-schema.component.ts | 47 + .../content-changed-trigger.component.html | 63 +- .../content-changed-trigger.component.scss | 6 + .../content-changed-trigger.component.ts | 82 +- .../common/schema-edit-form.component.ts | 4 +- .../export/schema-export-form.component.ts | 4 +- .../schema/fields/field-group.component.html | 2 +- .../pages/schema/fields/field.component.ts | 10 +- .../fields/sortable-field-list.component.html | 9 +- .../types/boolean-validation.component.ts | 10 +- .../types/date-time-validation.component.ts | 10 +- .../fields/types/number-ui.component.ts | 10 +- .../fields/types/string-ui.component.ts | 10 +- .../types/string-validation.component.ts | 12 +- .../schema-preview-urls-form.component.html | 2 +- .../schema-preview-urls-form.component.ts | 4 +- .../schema-field-rules-form.component.html | 4 +- .../schema-field-rules-form.component.ts | 13 +- .../scripts/schema-scripts-form.component.ts | 6 +- .../pages/schema/ui/field-list.component.ts | 4 +- .../schema/ui/schema-ui-form.component.ts | 4 +- .../pages/backups/backup.component.ts | 10 +- .../pages/clients/client.component.ts | 10 +- .../contributor-add-form.component.ts | 4 +- .../pages/languages/language.component.ts | 4 +- .../settings/pages/roles/role.component.ts | 10 +- .../pages/templates/template.component.ts | 4 +- .../workflows/workflow-diagram.component.ts | 4 +- .../workflows/workflow-step.component.ts | 10 +- .../pages/workflows/workflow.component.ts | 4 +- .../app/framework/angular/avatar.component.ts | 13 +- .../angular/forms/control-errors.component.ts | 4 +- .../forms/editors/checkbox-group.component.ts | 4 +- .../forms/editors/code-editor.component.html | 5 +- .../forms/editors/code-editor.component.scss | 23 + .../forms/editors/code-editor.component.ts | 136 +- .../forms/editors/code-editor.stories.ts | 99 + .../forms/editors/dropdown.component.ts | 9 +- .../forms/editors/radio-group.component.ts | 4 +- .../forms/editors/tag-editor.component.html | 8 +- .../forms/editors/tag-editor.component.ts | 61 +- .../angular/forms/form-error.component.ts | 9 +- .../angular/forms/progress-bar.component.ts | 7 +- frontend/src/app/framework/angular/helpers.ts | 15 + .../angular/image-source.directive.ts | 4 +- .../framework/angular/image-url.directive.ts | 4 +- .../angular/language-selector.component.ts | 4 +- .../angular/markdown.directive.spec.ts | 12 +- .../framework/angular/markdown.directive.ts | 6 +- .../app/framework/angular/pager.component.ts | 4 +- .../framework/angular/resized.directive.ts | 4 +- .../angular/scroll-active.directive.ts | 4 +- .../angular/template-wrapper.directive.ts | 7 +- .../app/framework/angular/title.component.ts | 4 +- .../angular/video-player.component.ts | 4 +- frontend/src/app/framework/declarations.ts | 1 + .../assets/asset-history.component.ts | 4 +- .../assets/image-cropper.component.ts | 4 +- .../assets/image-focus-point.component.ts | 4 +- .../cards/api-calls-card.component.ts | 4 +- .../cards/api-calls-summary-card.component.ts | 4 +- .../cards/api-performance-card.component.ts | 4 +- .../cards/api-traffic-card.component.ts | 10 +- .../api-traffic-summary-card.component.ts | 4 +- .../asset-uploads-count-card.component.ts | 4 +- .../asset-uploads-size-card.component.ts | 4 +- ...set-uploads-size-summary-card.component.ts | 4 +- .../components/comments/comment.component.ts | 4 +- .../components/comments/comments.component.ts | 4 +- .../contents/content-list-cell.directive.ts | 6 +- .../contents/content-list-field.component.ts | 4 +- .../contents/content-list-header.component.ts | 4 +- .../contents/content-status.component.ts | 10 +- .../contents/content-value.component.ts | 10 +- .../app/shared/components/notifo.component.ts | 10 +- .../references/reference-input.component.ts | 10 +- .../components/schema-category.component.ts | 4 +- .../queries/filter-comparison.component.ts | 4 +- .../search/queries/query-path.component.ts | 4 +- .../search/search-form.component.ts | 12 +- .../components/table-header.component.ts | 4 +- .../shared/services/schemas.service.spec.ts | 42 +- .../app/shared/services/schemas.service.ts | 21 +- frontend/src/app/shared/state/rules.forms.ts | 20 +- 128 files changed, 1879 insertions(+), 1429 deletions(-) create mode 100644 frontend/src/app/features/rules/shared/triggers/completions-cache.ts create mode 100644 frontend/src/app/features/rules/shared/triggers/content-changed-schema.component.html create mode 100644 frontend/src/app/features/rules/shared/triggers/content-changed-schema.component.scss create mode 100644 frontend/src/app/features/rules/shared/triggers/content-changed-schema.component.ts create mode 100644 frontend/src/app/framework/angular/forms/editors/code-editor.stories.ts create mode 100644 frontend/src/app/framework/angular/helpers.ts diff --git a/backend/extensions/Squidex.Extensions/Actions/Webhook/WebhookAction.cs b/backend/extensions/Squidex.Extensions/Actions/Webhook/WebhookAction.cs index b63cce08f..657eb316e 100644 --- a/backend/extensions/Squidex.Extensions/Actions/Webhook/WebhookAction.cs +++ b/backend/extensions/Squidex.Extensions/Actions/Webhook/WebhookAction.cs @@ -44,6 +44,7 @@ public sealed record WebhookAction : RuleAction [Display(Name = "Headers (Optional)", Description = "The message headers in the format '[Key]=[Value]', one entry per line.")] [Editor(RuleFieldEditor.TextArea)] + [Formattable] public string Headers { get; set; } [Display(Name = "Shared Secret", Description = "The shared secret that is used to calculate the payload signature.")] diff --git a/backend/src/Squidex.Domain.Apps.Core.Model/FieldDescriptions.Designer.cs b/backend/src/Squidex.Domain.Apps.Core.Model/FieldDescriptions.Designer.cs index 490931468..12b84afa7 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Model/FieldDescriptions.Designer.cs +++ b/backend/src/Squidex.Domain.Apps.Core.Model/FieldDescriptions.Designer.cs @@ -8,991 +8,1019 @@ // //------------------------------------------------------------------------------ -namespace Squidex.Domain.Apps.Core; -using System; - - -/// -/// A strongly-typed resource class, for looking up localized strings, etc. -/// -// This class was auto-generated by the StronglyTypedResourceBuilder -// class via a tool like ResGen or Visual Studio. -// To add or remove a member, edit your .ResX file then rerun ResGen -// with the /str option, or rebuild your VS project. -[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] -[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] -[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] -public class FieldDescriptions { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal FieldDescriptions() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Squidex.Domain.Apps.Core.FieldDescriptions", typeof(FieldDescriptions).Assembly); - resourceMan = temp; +namespace Squidex.Domain.Apps.Core { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class FieldDescriptions { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal FieldDescriptions() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Squidex.Domain.Apps.Core.FieldDescriptions", typeof(FieldDescriptions).Assembly); + resourceMan = temp; + } + return resourceMan; } - return resourceMan; } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } } - set { - resourceCulture = value; + + /// + /// Looks up a localized string similar to The user or client that triggered the event or command.. + /// + public static string Actor { + get { + return ResourceManager.GetString("Actor", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The user or client that triggered the event or command.. - /// - public static string Actor { - get { - return ResourceManager.GetString("Actor", resourceCulture); + + /// + /// Looks up a localized string similar to The ID of this actor.. + /// + public static string ActorIdentifier { + get { + return ResourceManager.GetString("ActorIdentifier", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The ID of this actor.. - /// - public static string ActorIdentifier { - get { - return ResourceManager.GetString("ActorIdentifier", resourceCulture); + + /// + /// Looks up a localized string similar to The type of this actor.. + /// + public static string ActorType { + get { + return ResourceManager.GetString("ActorType", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The type of this actor.. - /// - public static string ActorType { - get { - return ResourceManager.GetString("ActorType", resourceCulture); + + /// + /// Looks up a localized string similar to The ID of the current app.. + /// + public static string AppId { + get { + return ResourceManager.GetString("AppId", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The ID of the current app.. - /// - public static string AppId { - get { - return ResourceManager.GetString("AppId", resourceCulture); + + /// + /// Looks up a localized string similar to The name of the current app.. + /// + public static string AppName { + get { + return ResourceManager.GetString("AppName", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The name of the current app.. - /// - public static string AppName { - get { - return ResourceManager.GetString("AppName", resourceCulture); + + /// + /// Looks up a localized string similar to The asset.. + /// + public static string Asset { + get { + return ResourceManager.GetString("Asset", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The asset.. - /// - public static string Asset { - get { - return ResourceManager.GetString("Asset", resourceCulture); + + /// + /// Looks up a localized string similar to The hash of the file. Can be null for old files.. + /// + public static string AssetFileHash { + get { + return ResourceManager.GetString("AssetFileHash", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The hash of the file. Can be null for old files.. - /// - public static string AssetFileHash { - get { - return ResourceManager.GetString("AssetFileHash", resourceCulture); + + /// + /// Looks up a localized string similar to The file name of the asset.. + /// + public static string AssetFileName { + get { + return ResourceManager.GetString("AssetFileName", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The file name of the asset.. - /// - public static string AssetFileName { - get { - return ResourceManager.GetString("AssetFileName", resourceCulture); + + /// + /// Looks up a localized string similar to The size of the file in bytes.. + /// + public static string AssetFileSize { + get { + return ResourceManager.GetString("AssetFileSize", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The size of the file in bytes.. - /// - public static string AssetFileSize { - get { - return ResourceManager.GetString("AssetFileSize", resourceCulture); + + /// + /// Looks up a localized string similar to The file type (file extension) of the asset.. + /// + public static string AssetFileType { + get { + return ResourceManager.GetString("AssetFileType", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The file type (file extension) of the asset.. - /// - public static string AssetFileType { - get { - return ResourceManager.GetString("AssetFileType", resourceCulture); + + /// + /// Looks up a localized string similar to The version of the file.. + /// + public static string AssetFileVersion { + get { + return ResourceManager.GetString("AssetFileVersion", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The version of the file.. - /// - public static string AssetFileVersion { - get { - return ResourceManager.GetString("AssetFileVersion", resourceCulture); + + /// + /// Looks up a localized string similar to Determines if the uploaded file is an image.. + /// + public static string AssetIsImage { + get { + return ResourceManager.GetString("AssetIsImage", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to Determines if the uploaded file is an image.. - /// - public static string AssetIsImage { - get { - return ResourceManager.GetString("AssetIsImage", resourceCulture); + + /// + /// Looks up a localized string similar to True, when the asset is not public.. + /// + public static string AssetIsProtected { + get { + return ResourceManager.GetString("AssetIsProtected", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to True, when the asset is not public.. - /// - public static string AssetIsProtected { - get { - return ResourceManager.GetString("AssetIsProtected", resourceCulture); + + /// + /// Looks up a localized string similar to The asset metadata.. + /// + public static string AssetMetadata { + get { + return ResourceManager.GetString("AssetMetadata", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The asset metadata.. - /// - public static string AssetMetadata { - get { - return ResourceManager.GetString("AssetMetadata", resourceCulture); + + /// + /// Looks up a localized string similar to The type of the image.. + /// + public static string AssetMetadataText { + get { + return ResourceManager.GetString("AssetMetadataText", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The type of the image.. - /// - public static string AssetMetadataText { - get { - return ResourceManager.GetString("AssetMetadataText", resourceCulture); + + /// + /// Looks up a localized string similar to The asset metadata with name 'name'.. + /// + public static string AssetMetadataValue { + get { + return ResourceManager.GetString("AssetMetadataValue", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The asset metadata with name 'name'.. - /// - public static string AssetMetadataValue { - get { - return ResourceManager.GetString("AssetMetadataValue", resourceCulture); + + /// + /// Looks up a localized string similar to The mime type.. + /// + public static string AssetMimeType { + get { + return ResourceManager.GetString("AssetMimeType", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The mime type.. - /// - public static string AssetMimeType { - get { - return ResourceManager.GetString("AssetMimeType", resourceCulture); + + /// + /// Looks up a localized string similar to The ID of the parent folder. Empty for files without parent.. + /// + public static string AssetParentId { + get { + return ResourceManager.GetString("AssetParentId", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The ID of the parent folder. Empty for files without parent.. - /// - public static string AssetParentId { - get { - return ResourceManager.GetString("AssetParentId", resourceCulture); + + /// + /// Looks up a localized string similar to The full path in the folder hierarchy as array of folder infos.. + /// + public static string AssetParentPath { + get { + return ResourceManager.GetString("AssetParentPath", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The full path in the folder hierarchy as array of folder infos.. - /// - public static string AssetParentPath { - get { - return ResourceManager.GetString("AssetParentPath", resourceCulture); + + /// + /// Looks up a localized string similar to The height of the image in pixels if the asset is an image.. + /// + public static string AssetPixelHeight { + get { + return ResourceManager.GetString("AssetPixelHeight", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The height of the image in pixels if the asset is an image.. - /// - public static string AssetPixelHeight { - get { - return ResourceManager.GetString("AssetPixelHeight", resourceCulture); + + /// + /// Looks up a localized string similar to The width of the image in pixels if the asset is an image.. + /// + public static string AssetPixelWidth { + get { + return ResourceManager.GetString("AssetPixelWidth", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The width of the image in pixels if the asset is an image.. - /// - public static string AssetPixelWidth { - get { - return ResourceManager.GetString("AssetPixelWidth", resourceCulture); + + /// + /// Looks up a localized string similar to The assets.. + /// + public static string AssetsItems { + get { + return ResourceManager.GetString("AssetsItems", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The assets.. - /// - public static string AssetsItems { - get { - return ResourceManager.GetString("AssetsItems", resourceCulture); + + /// + /// Looks up a localized string similar to The file name as slug.. + /// + public static string AssetSlug { + get { + return ResourceManager.GetString("AssetSlug", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The file name as slug.. - /// - public static string AssetSlug { - get { - return ResourceManager.GetString("AssetSlug", resourceCulture); + + /// + /// Looks up a localized string similar to The source URL of the asset.. + /// + public static string AssetSourceUrl { + get { + return ResourceManager.GetString("AssetSourceUrl", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The source URL of the asset.. - /// - public static string AssetSourceUrl { - get { - return ResourceManager.GetString("AssetSourceUrl", resourceCulture); + + /// + /// Looks up a localized string similar to The total count of assets.. + /// + public static string AssetsTotal { + get { + return ResourceManager.GetString("AssetsTotal", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The total count of assets.. - /// - public static string AssetsTotal { - get { - return ResourceManager.GetString("AssetsTotal", resourceCulture); + + /// + /// Looks up a localized string similar to The asset tags.. + /// + public static string AssetTags { + get { + return ResourceManager.GetString("AssetTags", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The asset tags.. - /// - public static string AssetTags { - get { - return ResourceManager.GetString("AssetTags", resourceCulture); + + /// + /// Looks up a localized string similar to The thumbnail URL to the asset.. + /// + public static string AssetThumbnailUrl { + get { + return ResourceManager.GetString("AssetThumbnailUrl", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The thumbnail URL to the asset.. - /// - public static string AssetThumbnailUrl { - get { - return ResourceManager.GetString("AssetThumbnailUrl", resourceCulture); + + /// + /// Looks up a localized string similar to The type of the asset.. + /// + public static string AssetType { + get { + return ResourceManager.GetString("AssetType", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The type of the asset.. - /// - public static string AssetType { - get { - return ResourceManager.GetString("AssetType", resourceCulture); + + /// + /// Looks up a localized string similar to The URL to the asset.. + /// + public static string AssetUrl { + get { + return ResourceManager.GetString("AssetUrl", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The URL to the asset.. - /// - public static string AssetUrl { - get { - return ResourceManager.GetString("AssetUrl", resourceCulture); + + /// + /// Looks up a localized string similar to The executed command.. + /// + public static string Command { + get { + return ResourceManager.GetString("Command", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The executed command.. - /// - public static string Command { - get { - return ResourceManager.GetString("Command", resourceCulture); + + /// + /// Looks up a localized string similar to The user when someone is mentioned with '@'.. + /// + public static string CommentMentionedUser { + get { + return ResourceManager.GetString("CommentMentionedUser", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The user when someone is mentioned with '@'.. - /// - public static string CommentMentionedUser { - get { - return ResourceManager.GetString("CommentMentionedUser", resourceCulture); + + /// + /// Looks up a localized string similar to The text of the comment.. + /// + public static string CommentText { + get { + return ResourceManager.GetString("CommentText", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The text of the comment.. - /// - public static string CommentText { - get { - return ResourceManager.GetString("CommentText", resourceCulture); + + /// + /// Looks up a localized string similar to The URL pointing to the source of the comment.. + /// + public static string CommentUrl { + get { + return ResourceManager.GetString("CommentUrl", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The URL pointing to the source of the comment.. - /// - public static string CommentUrl { - get { - return ResourceManager.GetString("CommentUrl", resourceCulture); + + /// + /// Looks up a localized string similar to {0} field ({1} component).. + /// + public static string ComponentField { + get { + return ResourceManager.GetString("ComponentField", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to {0} field ({1} component).. - /// - public static string ComponentField { - get { - return ResourceManager.GetString("ComponentField", resourceCulture); + + /// + /// Looks up a localized string similar to The schema id to identity the component type.. + /// + public static string ComponentSchemaId { + get { + return ResourceManager.GetString("ComponentSchemaId", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The schema id to identity the component type.. - /// - public static string ComponentSchemaId { - get { - return ResourceManager.GetString("ComponentSchemaId", resourceCulture); + + /// + /// Looks up a localized string similar to The content.. + /// + public static string Content { + get { + return ResourceManager.GetString("Content", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The content.. - /// - public static string Content { - get { - return ResourceManager.GetString("Content", resourceCulture); + + /// + /// Looks up a localized string similar to {0} nested field.. + /// + public static string ContentArrayField { + get { + return ResourceManager.GetString("ContentArrayField", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to {0} nested field.. - /// - public static string ContentArrayField { - get { - return ResourceManager.GetString("ContentArrayField", resourceCulture); + + /// + /// Looks up a localized string similar to The data of the content.. + /// + public static string ContentData { + get { + return ResourceManager.GetString("ContentData", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The data of the content.. - /// - public static string ContentData { - get { - return ResourceManager.GetString("ContentData", resourceCulture); + + /// + /// Looks up a localized string similar to The previous data of the content.. + /// + public static string ContentDataOld { + get { + return ResourceManager.GetString("ContentDataOld", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The previous data of the content.. - /// - public static string ContentDataOld { - get { - return ResourceManager.GetString("ContentDataOld", resourceCulture); + + /// + /// Looks up a localized string similar to {0} field.. + /// + public static string ContentField { + get { + return ResourceManager.GetString("ContentField", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to {0} field.. - /// - public static string ContentField { - get { - return ResourceManager.GetString("ContentField", resourceCulture); + + /// + /// Looks up a localized string similar to The flat data of the content.. + /// + public static string ContentFlatData { + get { + return ResourceManager.GetString("ContentFlatData", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The flat data of the content.. - /// - public static string ContentFlatData { - get { - return ResourceManager.GetString("ContentFlatData", resourceCulture); + + /// + /// Looks up a localized string similar to The new status of the content.. + /// + public static string ContentNewStatus { + get { + return ResourceManager.GetString("ContentNewStatus", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The new status of the content.. - /// - public static string ContentNewStatus { - get { - return ResourceManager.GetString("ContentNewStatus", resourceCulture); + + /// + /// Looks up a localized string similar to The new status color of the content.. + /// + public static string ContentNewStatusColor { + get { + return ResourceManager.GetString("ContentNewStatusColor", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The new status color of the content.. - /// - public static string ContentNewStatusColor { - get { - return ResourceManager.GetString("ContentNewStatusColor", resourceCulture); + + /// + /// Looks up a localized string similar to {0} field ({1}).. + /// + public static string ContentPartitionField { + get { + return ResourceManager.GetString("ContentPartitionField", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to {0} field ({1}).. - /// - public static string ContentPartitionField { - get { - return ResourceManager.GetString("ContentPartitionField", resourceCulture); + + /// + /// Looks up a localized string similar to The data for the content.. + /// + public static string ContentRequestData { + get { + return ResourceManager.GetString("ContentRequestData", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The data for the content.. - /// - public static string ContentRequestData { - get { - return ResourceManager.GetString("ContentRequestData", resourceCulture); + + /// + /// Looks up a localized string similar to The timestamp when the status should be changed.. + /// + public static string ContentRequestDueTime { + get { + return ResourceManager.GetString("ContentRequestDueTime", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The timestamp when the status should be changed.. - /// - public static string ContentRequestDueTime { - get { - return ResourceManager.GetString("ContentRequestDueTime", resourceCulture); + + /// + /// Looks up a localized string similar to The optional custom content ID.. + /// + public static string ContentRequestOptionalId { + get { + return ResourceManager.GetString("ContentRequestOptionalId", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The optional custom content ID.. - /// - public static string ContentRequestOptionalId { - get { - return ResourceManager.GetString("ContentRequestOptionalId", resourceCulture); + + /// + /// Looks up a localized string similar to The initial status.. + /// + public static string ContentRequestOptionalStatus { + get { + return ResourceManager.GetString("ContentRequestOptionalStatus", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The initial status.. - /// - public static string ContentRequestOptionalStatus { - get { - return ResourceManager.GetString("ContentRequestOptionalStatus", resourceCulture); + + /// + /// Looks up a localized string similar to Makes the update as patch.. + /// + public static string ContentRequestPatch { + get { + return ResourceManager.GetString("ContentRequestPatch", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to Makes the update as patch.. - /// - public static string ContentRequestPatch { - get { - return ResourceManager.GetString("ContentRequestPatch", resourceCulture); + + /// + /// Looks up a localized string similar to Set to true to autopublish content on create.. + /// + public static string ContentRequestPublish { + get { + return ResourceManager.GetString("ContentRequestPublish", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to Set to true to autopublish content on create.. - /// - public static string ContentRequestPublish { - get { - return ResourceManager.GetString("ContentRequestPublish", resourceCulture); + + /// + /// Looks up a localized string similar to The status for the content.. + /// + public static string ContentRequestStatus { + get { + return ResourceManager.GetString("ContentRequestStatus", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The status for the content.. - /// - public static string ContentRequestStatus { - get { - return ResourceManager.GetString("ContentRequestStatus", resourceCulture); + + /// + /// Looks up a localized string similar to The display name of the schema.. + /// + public static string ContentSchemaDisplayName { + get { + return ResourceManager.GetString("ContentSchemaDisplayName", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The display name of the schema.. - /// - public static string ContentSchemaDisplayName { - get { - return ResourceManager.GetString("ContentSchemaDisplayName", resourceCulture); + + /// + /// Looks up a localized string similar to The ID of the schema.. + /// + public static string ContentSchemaId { + get { + return ResourceManager.GetString("ContentSchemaId", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The ID of the schema.. - /// - public static string ContentSchemaId { - get { - return ResourceManager.GetString("ContentSchemaId", resourceCulture); + + /// + /// Looks up a localized string similar to The name of the schema.. + /// + public static string ContentSchemaName { + get { + return ResourceManager.GetString("ContentSchemaName", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The name of the schema.. - /// - public static string ContentSchemaName { - get { - return ResourceManager.GetString("ContentSchemaName", resourceCulture); + + /// + /// Looks up a localized string similar to The contents.. + /// + public static string ContentsItems { + get { + return ResourceManager.GetString("ContentsItems", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The contents.. - /// - public static string ContentsItems { - get { - return ResourceManager.GetString("ContentsItems", resourceCulture); + + /// + /// Looks up a localized string similar to The status of the content.. + /// + public static string ContentStatus { + get { + return ResourceManager.GetString("ContentStatus", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The status of the content.. - /// - public static string ContentStatus { - get { - return ResourceManager.GetString("ContentStatus", resourceCulture); + + /// + /// Looks up a localized string similar to The status color of the content.. + /// + public static string ContentStatusColor { + get { + return ResourceManager.GetString("ContentStatusColor", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The status color of the content.. - /// - public static string ContentStatusColor { - get { - return ResourceManager.GetString("ContentStatusColor", resourceCulture); + + /// + /// Looks up a localized string similar to The previous status of the content.. + /// + public static string ContentStatusOld { + get { + return ResourceManager.GetString("ContentStatusOld", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The previous status of the content.. - /// - public static string ContentStatusOld { - get { - return ResourceManager.GetString("ContentStatusOld", resourceCulture); + + /// + /// Looks up a localized string similar to The total count of contents.. + /// + public static string ContentsTotal { + get { + return ResourceManager.GetString("ContentsTotal", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The total count of contents.. - /// - public static string ContentsTotal { - get { - return ResourceManager.GetString("ContentsTotal", resourceCulture); + + /// + /// Looks up a localized string similar to The URL to the content.. + /// + public static string ContentUrl { + get { + return ResourceManager.GetString("ContentUrl", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The URL to the content.. - /// - public static string ContentUrl { - get { - return ResourceManager.GetString("ContentUrl", resourceCulture); + + /// + /// Looks up a localized string similar to Validates the content item.. + /// + public static string ContentValidate { + get { + return ResourceManager.GetString("ContentValidate", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to Validates the content item.. - /// - public static string ContentValidate { - get { - return ResourceManager.GetString("ContentValidate", resourceCulture); + + /// + /// Looks up a localized string similar to The context object holding all values.. + /// + public static string Context { + get { + return ResourceManager.GetString("Context", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The context object holding all values.. - /// - public static string Context { - get { - return ResourceManager.GetString("Context", resourceCulture); + + /// + /// Looks up a localized string similar to The edit token.. + /// + public static string EditToken { + get { + return ResourceManager.GetString("EditToken", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The edit token.. - /// - public static string EditToken { - get { - return ResourceManager.GetString("EditToken", resourceCulture); + + /// + /// Looks up a localized string similar to The timestamp when the object was created.. + /// + public static string EntityCreated { + get { + return ResourceManager.GetString("EntityCreated", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The timestamp when the object was created.. - /// - public static string EntityCreated { - get { - return ResourceManager.GetString("EntityCreated", resourceCulture); + + /// + /// Looks up a localized string similar to The user who created the object.. + /// + public static string EntityCreatedBy { + get { + return ResourceManager.GetString("EntityCreatedBy", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The user who created the object.. - /// - public static string EntityCreatedBy { - get { - return ResourceManager.GetString("EntityCreatedBy", resourceCulture); + + /// + /// Looks up a localized string similar to The expected version.. + /// + public static string EntityExpectedVersion { + get { + return ResourceManager.GetString("EntityExpectedVersion", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The expected version.. - /// - public static string EntityExpectedVersion { - get { - return ResourceManager.GetString("EntityExpectedVersion", resourceCulture); + + /// + /// Looks up a localized string similar to The ID of the object (usually GUID).. + /// + public static string EntityId { + get { + return ResourceManager.GetString("EntityId", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The ID of the object (usually GUID).. - /// - public static string EntityId { - get { - return ResourceManager.GetString("EntityId", resourceCulture); + + /// + /// Looks up a localized string similar to True when deleted.. + /// + public static string EntityIsDeleted { + get { + return ResourceManager.GetString("EntityIsDeleted", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to True when deleted.. - /// - public static string EntityIsDeleted { - get { - return ResourceManager.GetString("EntityIsDeleted", resourceCulture); + + /// + /// Looks up a localized string similar to The timestamp when the object was updated the last time.. + /// + public static string EntityLastModified { + get { + return ResourceManager.GetString("EntityLastModified", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The timestamp when the object was updated the last time.. - /// - public static string EntityLastModified { - get { - return ResourceManager.GetString("EntityLastModified", resourceCulture); + + /// + /// Looks up a localized string similar to The user who updated the object the last time.. + /// + public static string EntityLastModifiedBy { + get { + return ResourceManager.GetString("EntityLastModifiedBy", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The user who updated the object the last time.. - /// - public static string EntityLastModifiedBy { - get { - return ResourceManager.GetString("EntityLastModifiedBy", resourceCulture); + + /// + /// Looks up a localized string similar to True when the entity should be deleted permanently.. + /// + public static string EntityRequestDeletePermanent { + get { + return ResourceManager.GetString("EntityRequestDeletePermanent", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to True when the entity should be deleted permanently.. - /// - public static string EntityRequestDeletePermanent { - get { - return ResourceManager.GetString("EntityRequestDeletePermanent", resourceCulture); + + /// + /// Looks up a localized string similar to The version of the objec.. + /// + public static string EntityVersion { + get { + return ResourceManager.GetString("EntityVersion", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The version of the objec.. - /// - public static string EntityVersion { - get { - return ResourceManager.GetString("EntityVersion", resourceCulture); + + /// + /// Looks up a localized string similar to The actual event.. + /// + public static string Event { + get { + return ResourceManager.GetString("Event", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The actual event.. - /// - public static string Event { - get { - return ResourceManager.GetString("Event", resourceCulture); + + /// + /// Looks up a localized string similar to The name of the event.. + /// + public static string EventName { + get { + return ResourceManager.GetString("EventName", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The name of the event.. - /// - public static string EventName { - get { - return ResourceManager.GetString("EventName", resourceCulture); + + /// + /// Looks up a localized string similar to The event timestamp.. + /// + public static string EventTimestamp { + get { + return ResourceManager.GetString("EventTimestamp", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The event timestamp.. - /// - public static string EventTimestamp { - get { - return ResourceManager.GetString("EventTimestamp", resourceCulture); + + /// + /// Looks up a localized string similar to The type of the event.. + /// + public static string EventType { + get { + return ResourceManager.GetString("EventType", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The type of the event, e.g. 'Created' or 'Updated'.. - /// - public static string EventType { - get { - return ResourceManager.GetString("EventType", resourceCulture); + + /// + /// Looks up a localized string similar to The current item, if the field is part of an array.. + /// + public static string ItemData { + get { + return ResourceManager.GetString("ItemData", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The path to the json value.. - /// - public static string JsonPath { - get { - return ResourceManager.GetString("JsonPath", resourceCulture); + + /// + /// Looks up a localized string similar to The current item, if the field is part of an array.. + /// + public static string ItemDataField { + get { + return ResourceManager.GetString("ItemDataField", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The ID part of this ID.. - /// - public static string NamedId { - get { - return ResourceManager.GetString("NamedId", resourceCulture); + + /// + /// Looks up a localized string similar to The path to the json value.. + /// + public static string JsonPath { + get { + return ResourceManager.GetString("JsonPath", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The name part of this ID.. - /// - public static string NamedName { - get { - return ResourceManager.GetString("NamedName", resourceCulture); + + /// + /// Looks up a localized string similar to The ID part of this ID.. + /// + public static string NamedId { + get { + return ResourceManager.GetString("NamedId", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The current operation.. - /// - public static string Operation { - get { - return ResourceManager.GetString("Operation", resourceCulture); + + /// + /// Looks up a localized string similar to The name part of this ID.. + /// + public static string NamedName { + get { + return ResourceManager.GetString("NamedName", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to Optional OData filter.. - /// - public static string QueryFilter { - get { - return ResourceManager.GetString("QueryFilter", resourceCulture); + + /// + /// Looks up a localized string similar to The current operation.. + /// + public static string Operation { + get { + return ResourceManager.GetString("Operation", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to Comma separated list of object IDs. Overrides all other query parameters.. - /// - public static string QueryIds { - get { - return ResourceManager.GetString("QueryIds", resourceCulture); + + /// + /// Looks up a localized string similar to Optional OData filter.. + /// + public static string QueryFilter { + get { + return ResourceManager.GetString("QueryFilter", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to Optional OData order definition.. - /// - public static string QueryOrderBy { - get { - return ResourceManager.GetString("QueryOrderBy", resourceCulture); + + /// + /// Looks up a localized string similar to Comma separated list of object IDs. Overrides all other query parameters.. + /// + public static string QueryIds { + get { + return ResourceManager.GetString("QueryIds", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to JSON query as well formatted json string. Overrides all other query parameters, except 'ids'.. - /// - public static string QueryQ { - get { - return ResourceManager.GetString("QueryQ", resourceCulture); + + /// + /// Looks up a localized string similar to Optional OData order definition.. + /// + public static string QueryOrderBy { + get { + return ResourceManager.GetString("QueryOrderBy", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to Optional OData full text search.. - /// - public static string QuerySearch { - get { - return ResourceManager.GetString("QuerySearch", resourceCulture); + + /// + /// Looks up a localized string similar to JSON query as well formatted json string. Overrides all other query parameters, except 'ids'.. + /// + public static string QueryQ { + get { + return ResourceManager.GetString("QueryQ", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to Optional number of items to skip.. - /// - public static string QuerySkip { - get { - return ResourceManager.GetString("QuerySkip", resourceCulture); + + /// + /// Looks up a localized string similar to Optional OData full text search.. + /// + public static string QuerySearch { + get { + return ResourceManager.GetString("QuerySearch", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to Optional number of items to take.. - /// - public static string QueryTop { - get { - return ResourceManager.GetString("QueryTop", resourceCulture); + + /// + /// Looks up a localized string similar to Optional number of items to skip.. + /// + public static string QuerySkip { + get { + return ResourceManager.GetString("QuerySkip", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The optional version of the content to retrieve an older instance (not cached).. - /// - public static string QueryVersion { - get { - return ResourceManager.GetString("QueryVersion", resourceCulture); + + /// + /// Looks up a localized string similar to Optional number of items to take.. + /// + public static string QueryTop { + get { + return ResourceManager.GetString("QueryTop", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The ID of the schema.. - /// - public static string SchemaId { - get { - return ResourceManager.GetString("SchemaId", resourceCulture); + + /// + /// Looks up a localized string similar to The optional version of the content to retrieve an older instance (not cached).. + /// + public static string QueryVersion { + get { + return ResourceManager.GetString("QueryVersion", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The referenced assets.. - /// - public static string StringFieldAssets { - get { - return ResourceManager.GetString("StringFieldAssets", resourceCulture); + + /// + /// Looks up a localized string similar to The ID of the schema.. + /// + public static string SchemaId { + get { + return ResourceManager.GetString("SchemaId", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The referenced content items.. - /// - public static string StringFieldReferences { - get { - return ResourceManager.GetString("StringFieldReferences", resourceCulture); + + /// + /// Looks up a localized string similar to The referenced assets.. + /// + public static string StringFieldAssets { + get { + return ResourceManager.GetString("StringFieldAssets", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The text of this field.. - /// - public static string StringFieldText { - get { - return ResourceManager.GetString("StringFieldText", resourceCulture); + + /// + /// Looks up a localized string similar to The referenced content items.. + /// + public static string StringFieldReferences { + get { + return ResourceManager.GetString("StringFieldReferences", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The translation status.. - /// - public static string TranslationStatus { - get { - return ResourceManager.GetString("TranslationStatus", resourceCulture); + + /// + /// Looks up a localized string similar to The text of this field.. + /// + public static string StringFieldText { + get { + return ResourceManager.GetString("StringFieldText", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The translation status ({0}).. - /// - public static string TranslationStatusLanguage { - get { - return ResourceManager.GetString("TranslationStatusLanguage", resourceCulture); + + /// + /// Looks up a localized string similar to The translation status.. + /// + public static string TranslationStatus { + get { + return ResourceManager.GetString("TranslationStatus", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The current number of calls.. - /// - public static string UsageCallsCurrent { - get { - return ResourceManager.GetString("UsageCallsCurrent", resourceCulture); + + /// + /// Looks up a localized string similar to The translation status ({0}).. + /// + public static string TranslationStatusLanguage { + get { + return ResourceManager.GetString("TranslationStatusLanguage", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The configured usage limit.. - /// - public static string UsageCallsLimit { - get { - return ResourceManager.GetString("UsageCallsLimit", resourceCulture); + + /// + /// Looks up a localized string similar to The current number of calls.. + /// + public static string UsageCallsCurrent { + get { + return ResourceManager.GetString("UsageCallsCurrent", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to Information about the current user.. - /// - public static string User { - get { - return ResourceManager.GetString("User", resourceCulture); + + /// + /// Looks up a localized string similar to The configured usage limit.. + /// + public static string UsageCallsLimit { + get { + return ResourceManager.GetString("UsageCallsLimit", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The additional properties of this user.. - /// - public static string UserClaims { - get { - return ResourceManager.GetString("UserClaims", resourceCulture); + + /// + /// Looks up a localized string similar to Information about the current user.. + /// + public static string User { + get { + return ResourceManager.GetString("User", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The display name of this user.. - /// - public static string UserDisplayName { - get { - return ResourceManager.GetString("UserDisplayName", resourceCulture); + + /// + /// Looks up a localized string similar to The role of the user within the current app.. + /// + public static string UserAppRole { + get { + return ResourceManager.GetString("UserAppRole", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The email address ofthis user.. - /// - public static string UserEmail { - get { - return ResourceManager.GetString("UserEmail", resourceCulture); + + /// + /// Looks up a localized string similar to The additional properties of this user.. + /// + public static string UserClaims { + get { + return ResourceManager.GetString("UserClaims", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The ID of this user.. - /// - public static string UserId { - get { - return ResourceManager.GetString("UserId", resourceCulture); + + /// + /// Looks up a localized string similar to The display name of this user.. + /// + public static string UserDisplayName { + get { + return ResourceManager.GetString("UserDisplayName", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to True when this user is a client, which is typically the case when the request is made from the API.. - /// - public static string UserIsClient { - get { - return ResourceManager.GetString("UserIsClient", resourceCulture); + + /// + /// Looks up a localized string similar to The email address ofthis user.. + /// + public static string UserEmail { + get { + return ResourceManager.GetString("UserEmail", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to True when this user is a user, which is typically the case when the request is made in the UI.. - /// - public static string UserIsUser { - get { - return ResourceManager.GetString("UserIsUser", resourceCulture); + + /// + /// Looks up a localized string similar to The ID of this user.. + /// + public static string UserId { + get { + return ResourceManager.GetString("UserId", resourceCulture); + } } - } - - /// - /// Looks up a localized string similar to The list of additional properties that have the name 'name'.. - /// - public static string UsersClaimsValue { - get { - return ResourceManager.GetString("UsersClaimsValue", resourceCulture); + + /// + /// Looks up a localized string similar to True when this user is a client, which is typically the case when the request is made from the API.. + /// + public static string UserIsClient { + get { + return ResourceManager.GetString("UserIsClient", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to True when this user is a user, which is typically the case when the request is made in the UI.. + /// + public static string UserIsUser { + get { + return ResourceManager.GetString("UserIsUser", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The list of additional properties that have the name 'name'.. + /// + public static string UsersClaimsValue { + get { + return ResourceManager.GetString("UsersClaimsValue", resourceCulture); + } } } } diff --git a/backend/src/Squidex.Domain.Apps.Core.Model/FieldDescriptions.resx b/backend/src/Squidex.Domain.Apps.Core.Model/FieldDescriptions.resx index d1bd86513..784f19edb 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Model/FieldDescriptions.resx +++ b/backend/src/Squidex.Domain.Apps.Core.Model/FieldDescriptions.resx @@ -343,7 +343,13 @@ The event timestamp. - The type of the event, e.g. 'Created' or 'Updated'. + The type of the event. + + + The current item, if the field is part of an array. + + + The current item, if the field is part of an array. The path to the json value. @@ -408,6 +414,9 @@ Information about the current user. + + The role of the user within the current app. + The additional properties of this user. diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/ContentWrapper/ContentDataObject.cs b/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/ContentWrapper/ContentDataObject.cs index e2e68bab4..5b0bff140 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/ContentWrapper/ContentDataObject.cs +++ b/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/ContentWrapper/ContentDataObject.cs @@ -139,7 +139,7 @@ public sealed class ContentDataObject : ObjectInstance foreach (var (key, value) in contentData) { - fieldProperties.Add(key, new ContentDataProperty(this, new ContentFieldObject(this, value, false))); + fieldProperties[key] = new ContentDataProperty(this, new ContentFieldObject(this, value, false)); } } } diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/IScriptDescriptor.cs b/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/IScriptDescriptor.cs index fdf2889e7..b6275764d 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/IScriptDescriptor.cs +++ b/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/IScriptDescriptor.cs @@ -9,7 +9,7 @@ namespace Squidex.Domain.Apps.Core.Scripting; -public delegate void AddDescription(JsonType type, string name, string description); +public delegate void AddDescription(JsonType type, string name, string description, string[]? allowedValues = null); public interface IScriptDescriptor { diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/ScriptExecutionContext.cs b/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/ScriptExecutionContext.cs index 250c2a40a..7e5d640d3 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/ScriptExecutionContext.cs +++ b/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/ScriptExecutionContext.cs @@ -5,9 +5,9 @@ // All rights reserved. Licensed under the MIT license. // ========================================================================== +using System.Diagnostics; using Jint; using Squidex.Infrastructure.Tasks; -using System.Diagnostics; namespace Squidex.Domain.Apps.Core.Scripting; diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/ScriptingCompleter.cs b/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/ScriptingCompleter.cs index eabf3cfff..8119badb4 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/ScriptingCompleter.cs +++ b/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/ScriptingCompleter.cs @@ -73,6 +73,13 @@ public sealed class ScriptingCompleter return new Process(descriptors, dataSchema.Flatten()).ContentTrigger(); } + public IReadOnlyList FieldRule(FilterSchema dataSchema) + { + Guard.NotNull(dataSchema); + + return new Process(descriptors, dataSchema.Flatten()).FieldRule(); + } + public IReadOnlyList AssetScript() { return new Process(descriptors).AssetScript(); @@ -112,11 +119,6 @@ public sealed class ScriptingCompleter this.dataSchema = dataSchema; } - private IReadOnlyList Build() - { - return result.Values.OrderBy(x => x.Path).ToList(); - } - public IReadOnlyList SchemaTrigger() { AddHelpers(ScriptScope.SchemaTrigger | ScriptScope.Async); @@ -205,6 +207,41 @@ public sealed class ScriptingCompleter return Build(); } + public IReadOnlyList FieldRule() + { + AddObject("user", FieldDescriptions.User, () => + { + AddString("id", + FieldDescriptions.UserId); + + AddString("email", + FieldDescriptions.UserEmail); + + AddString("displayName", + FieldDescriptions.UserDisplayName); + + AddString("role", + FieldDescriptions.UserAppRole); + }); + + AddObject("data", FieldDescriptions.ContentData, () => + { + AddData(); + }); + + AddObject("itemData", FieldDescriptions.ItemData, () => + { + AddAny("my-field", FieldDescriptions.ItemDataField); + }); + + return Build(); + } + + private IReadOnlyList Build() + { + return result.Values.OrderBy(x => x.Path).ToList(); + } + private void AddHelpers(ScriptScope scope) { foreach (var descriptor in descriptors) @@ -219,7 +256,13 @@ public sealed class ScriptingCompleter { var propertyType = Nullable.GetUnderlyingType(propertyTypeOrNullable) ?? propertyTypeOrNullable; - if (propertyType.IsEnum || + if (propertyType.IsEnum) + { + var allowedValues = Enum.GetValues(propertyType).OfType().Select(x => x.ToString()!).Order().ToArray(); + + Add(JsonType.String, name, description, allowedValues); + } + else if ( propertyType == typeof(string) || propertyType == typeof(DomainId) || propertyType == typeof(Instant) || @@ -410,7 +453,7 @@ public sealed class ScriptingCompleter Add(JsonType.String, name, description); } - private void Add(JsonType type, string? name, string? description) + private void Add(JsonType type, string? name, string? description, string[]? allowedValues = null) { var parts = name?.Split('.') ?? Array.Empty(); @@ -426,7 +469,10 @@ public sealed class ScriptingCompleter var path = string.Concat(prefixes.Reverse()); - result[path] = new ScriptingValue(path, type, description); + result[path] = new ScriptingValue(path, type, description) + { + AllowedValues = allowedValues + }; for (int i = 0; i < parts.Length; i++) { diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/ScriptingValue.cs b/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/ScriptingValue.cs index bf5c5492f..a67045c37 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/ScriptingValue.cs +++ b/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/ScriptingValue.cs @@ -9,4 +9,7 @@ namespace Squidex.Domain.Apps.Core.Scripting; -public sealed record ScriptingValue(string Path, JsonType Type, string? Description); +public sealed record ScriptingValue(string Path, JsonType Type, string? Description) +{ + public string[]? AllowedValues { get; init; } +} diff --git a/backend/src/Squidex/Areas/Api/Controllers/Schemas/SchemasController.cs b/backend/src/Squidex/Areas/Api/Controllers/Schemas/SchemasController.cs index 83ca9c36a..d639f3f3c 100644 --- a/backend/src/Squidex/Areas/Api/Controllers/Schemas/SchemasController.cs +++ b/backend/src/Squidex/Areas/Api/Controllers/Schemas/SchemasController.cs @@ -309,7 +309,7 @@ public sealed class SchemasController : ApiController } [HttpGet] - [Route("apps/{app}/schemas/{schema}/completion")] + [Route("apps/{app}/schemas/{schema}/completion/content-scripts")] [ApiPermissionOrAnonymous] [ApiCosts(1)] [ApiExplorerSettings(IgnoreApi = true)] @@ -322,7 +322,7 @@ public sealed class SchemasController : ApiController } [HttpGet] - [Route("apps/{app}/schemas/{schema}/completion/triggers")] + [Route("apps/{app}/schemas/{schema}/completion/content-triggers")] [ApiPermissionOrAnonymous] [ApiCosts(1)] [ApiExplorerSettings(IgnoreApi = true)] @@ -334,6 +334,19 @@ public sealed class SchemasController : ApiController return Ok(completion); } + [HttpGet] + [Route("apps/{app}/schemas/{schema}/completion/field-rules")] + [ApiPermissionOrAnonymous] + [ApiCosts(1)] + [ApiExplorerSettings(IgnoreApi = true)] + public async Task GetScriptFieldRulesCompletion(string app, string schema, + [FromServices] ScriptingCompleter completer) + { + var completion = completer.FieldRule(await BuildModel()); + + return Ok(completion); + } + [HttpGet] [Route("apps/{app}/schemas/{schema}/filters")] [ApiPermissionOrAnonymous] diff --git a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/Scripting/ScriptingCompleterTests.cs b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/Scripting/ScriptingCompleterTests.cs index 5018cd702..44f860738 100644 --- a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/Scripting/ScriptingCompleterTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/Scripting/ScriptingCompleterTests.cs @@ -173,6 +173,27 @@ public class ScriptingCompleterTests }); } + [Fact] + public void Should_describe_field_rule() + { + var actual = sut.FieldRule(dataSchema); + + AssertCompletion(actual, + new[] + { + "data", + "data['my-field']", + "data['my-field'].iv", + "itemData", + "itemData['my-field']", + "user", + "user.displayName", + "user.email", + "user.id", + "user.role", + }); + } + [Fact] public void Should_describe_asset_trigger() { diff --git a/frontend/.storybook/main.js b/frontend/.storybook/main.js index 0f386e4ab..cf48bb794 100644 --- a/frontend/.storybook/main.js +++ b/frontend/.storybook/main.js @@ -5,18 +5,24 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +const customConfig = require('./../src/config/webpack.config'); + module.exports = { - "stories": [ + stories: [ "../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)" ], - "addons": [ + addons: [ "@storybook/addon-links", "@storybook/addon-essentials", "@storybook/addon-interactions" ], - "framework": "@storybook/angular", - "core": { - "builder": "@storybook/builder-webpack5" - } + framework: "@storybook/angular", + core: { + builder: "@storybook/builder-webpack5" + }, + webpackFinal: async (config) => { + customConfig(config, {}, {}); + return config; + }, } \ No newline at end of file diff --git a/frontend/src/app/features/content/pages/content/content-event.component.ts b/frontend/src/app/features/content/pages/content/content-event.component.ts index 651e3231c..1fd4e13b3 100644 --- a/frontend/src/app/features/content/pages/content/content-event.component.ts +++ b/frontend/src/app/features/content/pages/content/content-event.component.ts @@ -5,8 +5,8 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core'; -import { ContentDto, HistoryEventDto } from '@app/shared'; +import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; +import { ContentDto, HistoryEventDto, TypedSimpleChanges } from '@app/shared'; @Component({ selector: 'sqx-content-event[content][event]', @@ -14,7 +14,7 @@ import { ContentDto, HistoryEventDto } from '@app/shared'; templateUrl: './content-event.component.html', changeDetection: ChangeDetectionStrategy.OnPush, }) -export class ContentEventComponent implements OnChanges { +export class ContentEventComponent { @Output() public dataLoad = new EventEmitter(); @@ -29,8 +29,8 @@ export class ContentEventComponent implements OnChanges { public canLoadOrCompare = false; - public ngOnChanges(changes: SimpleChanges) { - if (changes['event']) { + public ngOnChanges(changes: TypedSimpleChanges) { + if (changes.event) { this.canLoadOrCompare = (this.event.eventType === 'ContentUpdatedEvent' || this.event.eventType === 'ContentCreatedEventV2') && diff --git a/frontend/src/app/features/content/pages/content/editor/content-field.component.ts b/frontend/src/app/features/content/pages/content/editor/content-field.component.ts index dd87fb53c..9dd5d6144 100644 --- a/frontend/src/app/features/content/pages/content/editor/content-field.component.ts +++ b/frontend/src/app/features/content/pages/content/editor/content-field.component.ts @@ -5,16 +5,16 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Component, EventEmitter, HostBinding, Input, OnChanges, Output, SimpleChanges } from '@angular/core'; +import { Component, EventEmitter, HostBinding, Input, Output } from '@angular/core'; import { Observable } from 'rxjs'; -import { AppLanguageDto, AppsState, changed$, disabled$, EditContentForm, FieldForm, invalid$, LocalStoreService, SchemaDto, Settings, TranslationsService } from '@app/shared'; +import { AppLanguageDto, AppsState, changed$, disabled$, EditContentForm, FieldForm, invalid$, LocalStoreService, SchemaDto, Settings, TranslationsService, TypedSimpleChanges } from '@app/shared'; @Component({ selector: 'sqx-content-field[form][formContext][formLevel][formModel][language][languages][schema]', styleUrls: ['./content-field.component.scss'], templateUrl: './content-field.component.html', }) -export class ContentFieldComponent implements OnChanges { +export class ContentFieldComponent { @Output() public languageChange = new EventEmitter(); @@ -74,15 +74,15 @@ export class ContentFieldComponent implements OnChanges { ) { } - public ngOnChanges(changes: SimpleChanges) { + public ngOnChanges(changes: TypedSimpleChanges) { this.showAllControls = this.localStore.getBoolean(this.showAllControlsKey()); - if (changes['formModel'] && this.formModel) { + if (changes.formModel && this.formModel) { this.isInvalid = invalid$(this.formModel.form); this.isDisabled = disabled$(this.formModel.form); } - if ((changes['formModel'] || changes['formModelCompare']) && this.formModelCompare) { + if ((changes.formModel || changes.formModelCompare) && this.formModelCompare) { this.isDifferent = changed$(this.formModel.form, this.formModelCompare.form); } } diff --git a/frontend/src/app/features/content/pages/content/editor/content-section.component.ts b/frontend/src/app/features/content/pages/content/editor/content-section.component.ts index e0b79bc01..b9d593cd4 100644 --- a/frontend/src/app/features/content/pages/content/editor/content-section.component.ts +++ b/frontend/src/app/features/content/pages/content/editor/content-section.component.ts @@ -5,8 +5,8 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core'; -import { AppLanguageDto, EditContentForm, FieldForm, FieldSection, LocalStoreService, RootFieldDto, SchemaDto, Settings, StatefulComponent } from '@app/shared'; +import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, Output } from '@angular/core'; +import { AppLanguageDto, EditContentForm, FieldForm, FieldSection, LocalStoreService, RootFieldDto, SchemaDto, Settings, StatefulComponent, TypedSimpleChanges } from '@app/shared'; interface State { // The when the section is collapsed. @@ -19,7 +19,7 @@ interface State { templateUrl: './content-section.component.html', changeDetection: ChangeDetectionStrategy.OnPush, }) -export class ContentSectionComponent extends StatefulComponent implements OnChanges { +export class ContentSectionComponent extends StatefulComponent { @Output() public languageChange = new EventEmitter(); @@ -64,8 +64,8 @@ export class ContentSectionComponent extends StatefulComponent implements }); } - public ngOnChanges(changes: SimpleChanges) { - if (changes['formSection' || changes['schema']]) { + public ngOnChanges(changes: TypedSimpleChanges) { + if (changes.formSection || changes.schema) { if (this.formSection?.separator && this.schema) { const isCollapsed = this.localStore.getBoolean(this.isCollapsedKey()); diff --git a/frontend/src/app/features/content/pages/content/editor/field-copy-button.component.ts b/frontend/src/app/features/content/pages/content/editor/field-copy-button.component.ts index 719f5a021..a0eacd729 100644 --- a/frontend/src/app/features/content/pages/content/editor/field-copy-button.component.ts +++ b/frontend/src/app/features/content/pages/content/editor/field-copy-button.component.ts @@ -5,15 +5,15 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Component, Input, OnChanges, SimpleChanges } from '@angular/core'; -import { AppLanguageDto, FieldForm, ModalModel } from '@app/shared'; +import { Component, Input } from '@angular/core'; +import { AppLanguageDto, FieldForm, ModalModel, TypedSimpleChanges } from '@app/shared'; @Component({ selector: 'sqx-field-copy-button[formModel][languages]', styleUrls: ['./field-copy-button.component.scss'], templateUrl: './field-copy-button.component.html', }) -export class FieldCopyButtonComponent implements OnChanges { +export class FieldCopyButtonComponent { @Input() public formModel!: FieldForm; @@ -31,8 +31,8 @@ export class FieldCopyButtonComponent implements OnChanges { return this.formModel.field.isLocalizable && this.languages.length > 1; } - public ngOnChanges(changes: SimpleChanges) { - if (changes['languages']) { + public ngOnChanges(changes: TypedSimpleChanges) { + if (changes.languages) { this.setCopySource(this.languages[0]?.iso2Code); } } diff --git a/frontend/src/app/features/content/pages/content/inspecting/content-inspection.component.ts b/frontend/src/app/features/content/pages/content/inspecting/content-inspection.component.ts index fb86f024e..89e63d037 100644 --- a/frontend/src/app/features/content/pages/content/inspecting/content-inspection.component.ts +++ b/frontend/src/app/features/content/pages/content/inspecting/content-inspection.component.ts @@ -5,10 +5,10 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectorRef, Component, Input, OnChanges, OnDestroy, SimpleChanges } from '@angular/core'; +import { ChangeDetectorRef, Component, Input, OnDestroy } from '@angular/core'; import { BehaviorSubject, combineLatest, of } from 'rxjs'; import { filter, map, switchMap } from 'rxjs/operators'; -import { AppLanguageDto, ContentDto, ContentsService, ContentsState, ErrorDto, ToolbarService } from '@app/shared'; +import { AppLanguageDto, ContentDto, ContentsService, ContentsState, ErrorDto, ToolbarService, TypedSimpleChanges } from '@app/shared'; type Mode = 'Content' | 'Data' | 'FlatData'; @@ -17,7 +17,7 @@ type Mode = 'Content' | 'Data' | 'FlatData'; styleUrls: ['./content-inspection.component.scss'], templateUrl: './content-inspection.component.html', }) -export class ContentInspectionComponent implements OnChanges, OnDestroy { +export class ContentInspectionComponent implements OnDestroy { private languageChanges$ = new BehaviorSubject(null); @Input() @@ -69,12 +69,12 @@ export class ContentInspectionComponent implements OnChanges, OnDestroy { this.toolbar.remove(this); } - public ngOnChanges(changes: SimpleChanges) { - if (changes['language']) { + public ngOnChanges(changes: TypedSimpleChanges) { + if (changes.language) { this.languageChanges$.next(this.language); } - if (changes['content']) { + if (changes.content) { this.updateActions(); } } diff --git a/frontend/src/app/features/content/pages/content/references/content-references.component.ts b/frontend/src/app/features/content/pages/content/references/content-references.component.ts index dc7d56948..82d6834fe 100644 --- a/frontend/src/app/features/content/pages/content/references/content-references.component.ts +++ b/frontend/src/app/features/content/pages/content/references/content-references.component.ts @@ -5,8 +5,8 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core'; -import { AppLanguageDto, ComponentContentsState, ContentDto, QuerySynchronizer, Router2State, ToolbarService } from '@app/shared'; +import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnDestroy, OnInit } from '@angular/core'; +import { AppLanguageDto, ComponentContentsState, ContentDto, QuerySynchronizer, Router2State, ToolbarService, TypedSimpleChanges } from '@app/shared'; @Component({ selector: 'sqx-content-references[content][language][languages]', @@ -17,7 +17,7 @@ import { AppLanguageDto, ComponentContentsState, ContentDto, QuerySynchronizer, Router2State, ComponentContentsState, ], }) -export class ContentReferencesComponent implements OnChanges, OnInit, OnDestroy { +export class ContentReferencesComponent implements OnInit, OnDestroy { @Input() public content!: ContentDto; @@ -56,8 +56,8 @@ export class ContentReferencesComponent implements OnChanges, OnInit, OnDestroy }); } - public ngOnChanges(changes: SimpleChanges) { - if (changes['content'] || changes['mode']) { + public ngOnChanges(changes: TypedSimpleChanges) { + if (changes.content || changes.mode) { this.contentsState.schema = { name: this.content.schemaName }; const initial = diff --git a/frontend/src/app/features/content/pages/contents/custom-view-editor.component.ts b/frontend/src/app/features/content/pages/contents/custom-view-editor.component.ts index 162675071..44b8172e3 100644 --- a/frontend/src/app/features/content/pages/contents/custom-view-editor.component.ts +++ b/frontend/src/app/features/content/pages/contents/custom-view-editor.component.ts @@ -6,7 +6,7 @@ */ import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop'; -import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, Output } from '@angular/core'; +import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; import { TableField } from '@app/shared'; @Component({ @@ -15,7 +15,7 @@ import { TableField } from '@app/shared'; templateUrl: './custom-view-editor.component.html', changeDetection: ChangeDetectionStrategy.OnPush, }) -export class CustomViewEditorComponent implements OnChanges { +export class CustomViewEditorComponent { @Output() public reset = new EventEmitter(); diff --git a/frontend/src/app/features/content/shared/content-extension.component.ts b/frontend/src/app/features/content/shared/content-extension.component.ts index 7be9b25d4..685e2abcc 100644 --- a/frontend/src/app/features/content/shared/content-extension.component.ts +++ b/frontend/src/app/features/content/shared/content-extension.component.ts @@ -5,10 +5,10 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, ElementRef, HostListener, Input, OnChanges, SimpleChanges, ViewChild } from '@angular/core'; +import { ChangeDetectionStrategy, Component, ElementRef, HostListener, Input, ViewChild } from '@angular/core'; import { Router } from '@angular/router'; import { ApiUrlConfig, ResourceOwner, Types } from '@app/framework/internal'; -import { AppsState, AuthService, computeEditorUrl, ContentDto, SchemaDto } from '@app/shared'; +import { AppsState, AuthService, computeEditorUrl, ContentDto, SchemaDto, TypedSimpleChanges } from '@app/shared'; @Component({ selector: 'sqx-content-extension[content][contentSchema]', @@ -16,7 +16,7 @@ import { AppsState, AuthService, computeEditorUrl, ContentDto, SchemaDto } from templateUrl: './content-extension.component.html', changeDetection: ChangeDetectionStrategy.OnPush, }) -export class ContentExtensionComponent extends ResourceOwner implements OnChanges { +export class ContentExtensionComponent extends ResourceOwner { private readonly context: any; private isInitialized = false; @@ -50,13 +50,13 @@ export class ContentExtensionComponent extends ResourceOwner implements OnChange }; } - public ngOnChanges(changes: SimpleChanges) { - if (changes['contentSchema']) { + public ngOnChanges(changes: TypedSimpleChanges) { + if (changes.contentSchema) { this.context['schemaName'] = this.contentSchema?.name; this.context['schemaId'] = this.contentSchema?.id; } - if (changes['content']) { + if (changes.content) { this.sendContent(); } } diff --git a/frontend/src/app/features/content/shared/forms/array-editor.component.ts b/frontend/src/app/features/content/shared/forms/array-editor.component.ts index 22e878416..08256ef9d 100644 --- a/frontend/src/app/features/content/shared/forms/array-editor.component.ts +++ b/frontend/src/app/features/content/shared/forms/array-editor.component.ts @@ -6,11 +6,11 @@ */ import { CdkDragDrop } from '@angular/cdk/drag-drop'; -import { ChangeDetectionStrategy, Component, Input, OnChanges, QueryList, SimpleChanges, ViewChildren } from '@angular/core'; +import { ChangeDetectionStrategy, Component, Input, QueryList, ViewChildren } from '@angular/core'; import { VirtualScrollerComponent } from 'ngx-virtual-scroller'; import { combineLatest, Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { AppLanguageDto, ComponentsFieldPropertiesDto, disabled$, EditContentForm, FieldArrayForm, LocalStoreService, ModalModel, ObjectFormBase, SchemaDto, Settings, sorted, Types } from '@app/shared'; +import { AppLanguageDto, ComponentsFieldPropertiesDto, disabled$, EditContentForm, FieldArrayForm, LocalStoreService, ModalModel, ObjectFormBase, SchemaDto, Settings, sorted, TypedSimpleChanges, Types } from '@app/shared'; import { ArrayItemComponent } from './array-item.component'; @Component({ @@ -19,7 +19,7 @@ import { ArrayItemComponent } from './array-item.component'; templateUrl: './array-editor.component.html', changeDetection: ChangeDetectionStrategy.OnPush, }) -export class ArrayEditorComponent implements OnChanges { +export class ArrayEditorComponent { @Input() public form!: EditContentForm; @@ -71,8 +71,8 @@ export class ArrayEditorComponent implements OnChanges { ) { } - public ngOnChanges(changes: SimpleChanges) { - if (changes['formModel']) { + public ngOnChanges(changes: TypedSimpleChanges) { + if (changes.formModel) { const maxItems = this.formModel.field.properties['maxItems'] || Number.MAX_VALUE; if (Types.is(this.formModel.field.properties, ComponentsFieldPropertiesDto)) { @@ -90,7 +90,7 @@ export class ArrayEditorComponent implements OnChanges { })); } - if (changes['formModel'] || changes['formLevel']) { + if (changes.formModel || changes.formLevel) { this.isCollapsedInitial = this.localStore.getBoolean(this.isCollapsedKey()) || this.formLevel > 0; } } diff --git a/frontend/src/app/features/content/shared/forms/array-item.component.ts b/frontend/src/app/features/content/shared/forms/array-item.component.ts index aef249f02..65a0ab634 100644 --- a/frontend/src/app/features/content/shared/forms/array-item.component.ts +++ b/frontend/src/app/features/content/shared/forms/array-item.component.ts @@ -5,10 +5,10 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, Output, QueryList, SimpleChanges, ViewChildren } from '@angular/core'; +import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, QueryList, ViewChildren } from '@angular/core'; import { Observable, of } from 'rxjs'; import { map } from 'rxjs/operators'; -import { AppLanguageDto, ComponentForm, EditContentForm, FieldDto, FieldFormatter, FieldSection, invalid$, ObjectFormBase, RootFieldDto, Types, valueProjection$ } from '@app/shared'; +import { AppLanguageDto, ComponentForm, EditContentForm, FieldDto, FieldFormatter, FieldSection, invalid$, ObjectFormBase, RootFieldDto, TypedSimpleChanges, Types, valueProjection$ } from '@app/shared'; import { ComponentSectionComponent } from './component-section.component'; @Component({ @@ -17,7 +17,7 @@ import { ComponentSectionComponent } from './component-section.component'; templateUrl: './array-item.component.html', changeDetection: ChangeDetectionStrategy.OnPush, }) -export class ArrayItemComponent implements OnChanges { +export class ArrayItemComponent { @Output() public itemRemove = new EventEmitter(); @@ -81,8 +81,8 @@ export class ArrayItemComponent implements OnChanges { return this.formModel.collapsedChanges; } - public ngOnChanges(changes: SimpleChanges) { - if (changes['formModel']) { + public ngOnChanges(changes: TypedSimpleChanges) { + if (changes.formModel) { this.isInvalidForm = invalid$(this.formModel.form); if (Types.is(this.formModel, ComponentForm)) { @@ -94,7 +94,7 @@ export class ArrayItemComponent implements OnChanges { this.title = valueProjection$(this.formModel.form, () => getTitle(this.formModel)); } - if (changes['formModel'] || changes['isCollapsedInitial']) { + if (changes.formModel || changes.isCollapsedInitial) { if (this.isCollapsedInitial && this.formModel.collapsed === null) { this.collapse(); } diff --git a/frontend/src/app/features/content/shared/forms/component.component.ts b/frontend/src/app/features/content/shared/forms/component.component.ts index 49a919a17..f76f33ae8 100644 --- a/frontend/src/app/features/content/shared/forms/component.component.ts +++ b/frontend/src/app/features/content/shared/forms/component.component.ts @@ -5,9 +5,9 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnChanges, QueryList, SimpleChanges, ViewChildren } from '@angular/core'; +import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, QueryList, ViewChildren } from '@angular/core'; import { Observable } from 'rxjs'; -import { AppLanguageDto, ComponentFieldPropertiesDto, ComponentForm, disabled$, EditContentForm, FieldDto, FieldSection, ModalModel, ResourceOwner, SchemaDto, Types } from '@app/shared'; +import { AppLanguageDto, ComponentFieldPropertiesDto, ComponentForm, disabled$, EditContentForm, FieldDto, FieldSection, ModalModel, ResourceOwner, SchemaDto, TypedSimpleChanges, Types } from '@app/shared'; import { ComponentSectionComponent } from './component-section.component'; @Component({ @@ -16,7 +16,7 @@ import { ComponentSectionComponent } from './component-section.component'; templateUrl: './component.component.html', changeDetection: ChangeDetectionStrategy.OnPush, }) -export class ComponentComponent extends ResourceOwner implements OnChanges { +export class ComponentComponent extends ResourceOwner { @Input() public canUnset?: boolean | null; @@ -55,8 +55,8 @@ export class ComponentComponent extends ResourceOwner implements OnChanges { super(); } - public ngOnChanges(changes: SimpleChanges) { - if (changes['formModel']) { + public ngOnChanges(changes: TypedSimpleChanges) { + if (changes.formModel) { this.unsubscribeAll(); this.isDisabled = disabled$(this.formModel.form); diff --git a/frontend/src/app/features/content/shared/forms/field-editor.component.ts b/frontend/src/app/features/content/shared/forms/field-editor.component.ts index 5dc0e45e7..2ac0f9ae8 100644 --- a/frontend/src/app/features/content/shared/forms/field-editor.component.ts +++ b/frontend/src/app/features/content/shared/forms/field-editor.component.ts @@ -5,17 +5,17 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Component, ElementRef, EventEmitter, Input, OnChanges, Output, SimpleChanges, ViewChild } from '@angular/core'; +import { Component, ElementRef, EventEmitter, Input, Output, ViewChild } from '@angular/core'; import { AbstractControl } from '@angular/forms'; import { Observable } from 'rxjs'; -import { AbstractContentForm, AppLanguageDto, EditContentForm, FieldDto, hasNoValue$, MathHelper, Types } from '@app/shared'; +import { AbstractContentForm, AppLanguageDto, EditContentForm, FieldDto, hasNoValue$, MathHelper, TypedSimpleChanges, Types } from '@app/shared'; @Component({ selector: 'sqx-field-editor[form][formContext][formLevel][formModel][isComparing][language][languages]', styleUrls: ['./field-editor.component.scss'], templateUrl: './field-editor.component.html', }) -export class FieldEditorComponent implements OnChanges { +export class FieldEditorComponent { public readonly uniqueId = MathHelper.guid(); @Output() @@ -65,8 +65,8 @@ export class FieldEditorComponent implements OnChanges { return this.formModel.form; } - public ngOnChanges(changes: SimpleChanges) { - if (changes['formModel']) { + public ngOnChanges(changes: TypedSimpleChanges) { + if (changes.formModel) { this.isEmpty = hasNoValue$(this.formModel.form); } } diff --git a/frontend/src/app/features/content/shared/forms/iframe-editor.component.ts b/frontend/src/app/features/content/shared/forms/iframe-editor.component.ts index 5bdc3f411..5db64bed6 100644 --- a/frontend/src/app/features/content/shared/forms/iframe-editor.component.ts +++ b/frontend/src/app/features/content/shared/forms/iframe-editor.component.ts @@ -5,10 +5,10 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, EventEmitter, HostListener, Input, OnChanges, OnDestroy, Output, Renderer2, SimpleChanges, ViewChild } from '@angular/core'; +import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, EventEmitter, HostListener, Input, OnDestroy, Output, Renderer2, ViewChild } from '@angular/core'; import { AbstractControl } from '@angular/forms'; import { Router } from '@angular/router'; -import { DialogModel, DialogService, disabled$, StatefulComponent, Types, value$ } from '@app/framework'; +import { DialogModel, DialogService, disabled$, StatefulComponent, TypedSimpleChanges, Types, value$ } from '@app/framework'; import { AppLanguageDto, AppsState, AssetDto, computeEditorUrl, ContentDto } from '@app/shared'; interface State { @@ -22,7 +22,7 @@ interface State { templateUrl: './iframe-editor.component.html', changeDetection: ChangeDetectionStrategy.OnPush, }) -export class IFrameEditorComponent extends StatefulComponent implements OnChanges, OnDestroy { +export class IFrameEditorComponent extends StatefulComponent implements OnDestroy { private value: any; private isInitialized = false; private isDisabled = false; @@ -99,24 +99,24 @@ export class IFrameEditorComponent extends StatefulComponent implements O this.toggleFullscreen(false); } - public ngOnChanges(changes: SimpleChanges) { - if (changes['formValue']) { + public ngOnChanges(changes: TypedSimpleChanges) { + if (changes.formValue) { this.sendFormValue(); } - if (changes['formIndex']) { + if (changes.formIndex) { this.sendMoved(); } - if (changes['expanded']) { + if (changes.isExpanded) { this.sendExpanded(); } - if (changes['language']) { + if (changes.language) { this.sendLanguage(); } - if (changes['formControlBinding']) { + if (changes.formControlBinding) { this.unsubscribeAll(); const control = this.formControlBinding; diff --git a/frontend/src/app/features/content/shared/list/content.component.ts b/frontend/src/app/features/content/shared/list/content.component.ts index c1a2e72ef..2168f3ec8 100644 --- a/frontend/src/app/features/content/shared/list/content.component.ts +++ b/frontend/src/app/features/content/shared/list/content.component.ts @@ -5,8 +5,8 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, OnChanges, Output, QueryList, SimpleChanges, ViewChildren } from '@angular/core'; -import { AppLanguageDto, ContentDto, ContentListFieldComponent, ContentsState, ModalModel, PatchContentForm, SchemaDto, TableField, TableSettings } from '@app/shared'; +import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, Output, QueryList, ViewChildren } from '@angular/core'; +import { AppLanguageDto, ContentDto, ContentListFieldComponent, ContentsState, ModalModel, PatchContentForm, SchemaDto, TableField, TableSettings, TypedSimpleChanges } from '@app/shared'; /* tslint:disable: component-selector */ @@ -16,7 +16,7 @@ import { AppLanguageDto, ContentDto, ContentListFieldComponent, ContentsState, M templateUrl: './content.component.html', changeDetection: ChangeDetectionStrategy.OnPush, }) -export class ContentComponent implements OnChanges { +export class ContentComponent { @Output() public clone = new EventEmitter(); @@ -74,12 +74,12 @@ export class ContentComponent implements OnChanges { ) { } - public ngOnChanges(changes: SimpleChanges) { - if (changes['content']) { + public ngOnChanges(changes: TypedSimpleChanges) { + if (changes.content) { this.patchAllowed = this.content.canUpdate; } - if (this.patchAllowed && (changes['listFields'] || changes['language'])) { + if (this.patchAllowed && (changes.tableFields || changes.language)) { this.patchForm = new PatchContentForm(this.tableFields, this.language); } } diff --git a/frontend/src/app/features/content/shared/references/reference-dropdown.component.ts b/frontend/src/app/features/content/shared/references/reference-dropdown.component.ts index 380d3621c..53ef09f5f 100644 --- a/frontend/src/app/features/content/shared/references/reference-dropdown.component.ts +++ b/frontend/src/app/features/content/shared/references/reference-dropdown.component.ts @@ -5,11 +5,11 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, ChangeDetectorRef, Component, forwardRef, Input, OnChanges, SimpleChanges } from '@angular/core'; +import { ChangeDetectionStrategy, ChangeDetectorRef, Component, forwardRef, Input } from '@angular/core'; import { NG_VALUE_ACCESSOR, UntypedFormControl } from '@angular/forms'; import { Observable } from 'rxjs'; import { ContentsDto } from '@app/shared'; -import { ContentDto, getContentValue, LanguageDto, LocalizerService, ResolveContents, StatefulControlComponent, Types, value$ } from '@app/shared/internal'; +import { ContentDto, getContentValue, LanguageDto, LocalizerService, ResolveContents, StatefulControlComponent, TypedSimpleChanges, Types, value$ } from '@app/shared/internal'; export const SQX_REFERENCE_DROPDOWN_CONTROL_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => ReferenceDropdownComponent), multi: true, @@ -39,7 +39,7 @@ const NO_EMIT = { emitEvent: false }; ], changeDetection: ChangeDetectionStrategy.OnPush, }) -export class ReferenceDropdownComponent extends StatefulControlComponent | string> implements OnChanges { +export class ReferenceDropdownComponent extends StatefulControlComponent | string> { private readonly contents: ContentDto[] = []; private isOpenedBefore = false; private isLoadingFailed = false; @@ -96,14 +96,14 @@ export class ReferenceDropdownComponent extends StatefulControlComponent) { + if (changes.schemaId) { this.contents.clear(); this.resetState(); } - if (changes['language'] || changes['schemaId']) { + if (changes.language || changes.schemaId) { this.resetContentNames(true); } } diff --git a/frontend/src/app/features/content/shared/references/reference-item.component.ts b/frontend/src/app/features/content/shared/references/reference-item.component.ts index 534202e0d..10082c364 100644 --- a/frontend/src/app/features/content/shared/references/reference-item.component.ts +++ b/frontend/src/app/features/content/shared/references/reference-item.component.ts @@ -7,7 +7,7 @@ /* tslint:disable: component-selector */ -import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, Output } from '@angular/core'; +import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; import { ContentDto, getContentValue, LanguageDto, META_FIELDS } from '@app/shared'; @Component({ @@ -16,7 +16,7 @@ import { ContentDto, getContentValue, LanguageDto, META_FIELDS } from '@app/shar templateUrl: './reference-item.component.html', changeDetection: ChangeDetectionStrategy.OnPush, }) -export class ReferenceItemComponent implements OnChanges { +export class ReferenceItemComponent { public readonly metaFields = META_FIELDS; @Output() diff --git a/frontend/src/app/features/content/shared/references/references-checkboxes.component.html b/frontend/src/app/features/content/shared/references/references-checkboxes.component.html index af91f915e..a458afa7a 100644 --- a/frontend/src/app/features/content/shared/references/references-checkboxes.component.html +++ b/frontend/src/app/features/content/shared/references/references-checkboxes.component.html @@ -1,3 +1,3 @@ + [values]="snapshot.converter.tags"> \ No newline at end of file diff --git a/frontend/src/app/features/content/shared/references/references-checkboxes.component.ts b/frontend/src/app/features/content/shared/references/references-checkboxes.component.ts index 64de50569..64b840c95 100644 --- a/frontend/src/app/features/content/shared/references/references-checkboxes.component.ts +++ b/frontend/src/app/features/content/shared/references/references-checkboxes.component.ts @@ -5,9 +5,9 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, ChangeDetectorRef, Component, forwardRef, Input, OnChanges, SimpleChanges } from '@angular/core'; +import { ChangeDetectionStrategy, ChangeDetectorRef, Component, forwardRef, Input } from '@angular/core'; import { NG_VALUE_ACCESSOR, UntypedFormControl } from '@angular/forms'; -import { AppsState, ContentDto, ContentsService, LanguageDto, LocalizerService, StatefulControlComponent, UIOptions } from '@app/shared/internal'; +import { AppsState, ContentDto, ContentsService, LanguageDto, LocalizerService, StatefulControlComponent, TypedSimpleChanges, UIOptions } from '@app/shared/internal'; import { ReferencesTagsConverter } from './references-tag-converter'; export const SQX_REFERENCES_CHECKBOXES_CONTROL_VALUE_ACCESSOR: any = { @@ -30,7 +30,7 @@ const NO_EMIT = { emitEvent: false }; ], changeDetection: ChangeDetectionStrategy.OnPush, }) -export class ReferencesCheckboxesComponent extends StatefulControlComponent> implements OnChanges { +export class ReferencesCheckboxesComponent extends StatefulControlComponent> { private readonly itemCount: number; private contentItems: ReadonlyArray | null = null; @@ -75,8 +75,8 @@ export class ReferencesCheckboxesComponent extends StatefulControlComponent) { + if (changes.schemaId) { this.resetState(); if (this.isValid) { diff --git a/frontend/src/app/features/content/shared/references/references-tag-converter.ts b/frontend/src/app/features/content/shared/references/references-tag-converter.ts index 7f6af85b0..6432a0cfa 100644 --- a/frontend/src/app/features/content/shared/references/references-tag-converter.ts +++ b/frontend/src/app/features/content/shared/references/references-tag-converter.ts @@ -8,22 +8,22 @@ import { ContentDto, getContentValue, LanguageDto, LocalizerService, TagConverter, TagValue } from '@app/shared/internal'; export class ReferencesTagsConverter implements TagConverter { - public suggestions: ReadonlyArray = []; + public tags: ReadonlyArray = []; constructor(language: LanguageDto, contents: ReadonlyArray, private readonly localizer: LocalizerService, ) { - this.suggestions = this.createTags(language, contents); + this.tags = this.createTags(language, contents); } public convertInput(input: string) { - const result = this.suggestions.find(x => x.name === input); + const result = this.tags.find(x => x.name === input); return result || null; } public convertValue(value: any) { - const result = this.suggestions.find(x => x.id === value); + const result = this.tags.find(x => x.id === value); return result || null; } diff --git a/frontend/src/app/features/content/shared/references/references-tags.component.html b/frontend/src/app/features/content/shared/references/references-tags.component.html index f71756738..21fe41cd8 100644 --- a/frontend/src/app/features/content/shared/references/references-tags.component.html +++ b/frontend/src/app/features/content/shared/references/references-tags.component.html @@ -4,6 +4,6 @@ [allowOpen]="true" [formControl]="control" [itemConverter]="snapshot.converter" - [itemsSource]="snapshot.converter.suggestions" + [itemsSource]="snapshot.converter.tags" [itemsSourceLoading]="snapshot.isLoading"> \ No newline at end of file diff --git a/frontend/src/app/features/content/shared/references/references-tags.component.ts b/frontend/src/app/features/content/shared/references/references-tags.component.ts index 52777b3ef..f70e2fe27 100644 --- a/frontend/src/app/features/content/shared/references/references-tags.component.ts +++ b/frontend/src/app/features/content/shared/references/references-tags.component.ts @@ -5,10 +5,10 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, ChangeDetectorRef, Component, forwardRef, Input, OnChanges, SimpleChanges } from '@angular/core'; +import { ChangeDetectionStrategy, ChangeDetectorRef, Component, forwardRef, Input } from '@angular/core'; import { NG_VALUE_ACCESSOR, UntypedFormControl } from '@angular/forms'; import { Observable } from 'rxjs'; -import { Types } from '@app/framework'; +import { TypedSimpleChanges, Types } from '@app/framework'; import { ContentDto, ContentsDto, LanguageDto, LocalizerService, ResolveContents, StatefulControlComponent } from '@app/shared/internal'; import { ReferencesTagsConverter } from './references-tag-converter'; @@ -35,7 +35,7 @@ const NO_EMIT = { emitEvent: false }; ], changeDetection: ChangeDetectionStrategy.OnPush, }) -export class ReferencesTagsComponent extends StatefulControlComponent> implements OnChanges { +export class ReferencesTagsComponent extends StatefulControlComponent> { private readonly contents: ContentDto[] = []; private isOpenedBefore = false; private isLoadingFailed = false; @@ -81,14 +81,14 @@ export class ReferencesTagsComponent extends StatefulControlComponent) { + if (changes.schemaId) { this.contents.clear(); this.resetState(); } - if (changes['language'] || changes['schemaId']) { + if (changes.language || changes.schemaId) { this.resetConverterState(true); } } diff --git a/frontend/src/app/features/dashboard/pages/cards/history-card.component.ts b/frontend/src/app/features/dashboard/pages/cards/history-card.component.ts index a2628495a..24df294ec 100644 --- a/frontend/src/app/features/dashboard/pages/cards/history-card.component.ts +++ b/frontend/src/app/features/dashboard/pages/cards/history-card.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, Input, OnChanges } from '@angular/core'; +import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; import { Observable } from 'rxjs'; import { AppDto, HistoryEventDto, HistoryService } from '@app/shared'; @@ -15,7 +15,7 @@ import { AppDto, HistoryEventDto, HistoryService } from '@app/shared'; templateUrl: './history-card.component.html', changeDetection: ChangeDetectionStrategy.OnPush, }) -export class HistoryCardComponent implements OnChanges { +export class HistoryCardComponent { @Input() public app!: AppDto; diff --git a/frontend/src/app/features/dashboard/pages/dashboard-config.component.ts b/frontend/src/app/features/dashboard/pages/dashboard-config.component.ts index 4482f0c40..b058f2cb8 100644 --- a/frontend/src/app/features/dashboard/pages/dashboard-config.component.ts +++ b/frontend/src/app/features/dashboard/pages/dashboard-config.component.ts @@ -5,17 +5,17 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core'; +import { Component, EventEmitter, Input, Output } from '@angular/core'; import { GridsterItem } from 'angular-gridster2'; import { take } from 'rxjs/operators'; -import { AppDto, AppsState, AuthService, DialogModel, DialogService, LocalizerService, ModalModel, Types, UIState } from '@app/shared'; +import { AppDto, AppsState, AuthService, DialogModel, DialogService, LocalizerService, ModalModel, TypedSimpleChanges, Types, UIState } from '@app/shared'; @Component({ selector: 'sqx-dashboard-config[app][config]', styleUrls: ['./dashboard-config.component.scss'], templateUrl: './dashboard-config.component.html', }) -export class DashboardConfigComponent implements OnChanges { +export class DashboardConfigComponent { @Input() public app!: AppDto; @@ -50,8 +50,8 @@ export class DashboardConfigComponent implements OnChanges { ) { } - public ngOnChanges(changes: SimpleChanges) { - if (changes['configAvailable']) { + public ngOnChanges(changes: TypedSimpleChanges) { + if (changes.configAvailable) { this.configOptions = this.configAvailable.map(item => { const name = this.localizer.getOrKey(item.name); @@ -59,7 +59,7 @@ export class DashboardConfigComponent implements OnChanges { }).sortByString(x => x.name); } - if (changes['app']) { + if (changes.app) { this.uiState.getUser('dashboard.grid', this.configDefaults).pipe(take(1)) .subscribe(dto => { this.setConfig(dto); diff --git a/frontend/src/app/features/rules/declarations.ts b/frontend/src/app/features/rules/declarations.ts index f8db251d2..ee608d8ee 100644 --- a/frontend/src/app/features/rules/declarations.ts +++ b/frontend/src/app/features/rules/declarations.ts @@ -20,6 +20,7 @@ export * from './shared/rule-icon.component'; export * from './shared/pipes'; export * from './shared/triggers/asset-changed-trigger.component'; export * from './shared/triggers/comment-trigger.component'; +export * from './shared/triggers/content-changed-schema.component'; export * from './shared/triggers/content-changed-trigger.component'; export * from './shared/triggers/schema-changed-trigger.component'; export * from './shared/triggers/usage-trigger.component'; diff --git a/frontend/src/app/features/rules/module.ts b/frontend/src/app/features/rules/module.ts index 121b6ee7e..04fde209a 100644 --- a/frontend/src/app/features/rules/module.ts +++ b/frontend/src/app/features/rules/module.ts @@ -8,7 +8,7 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; import { HelpComponent, RuleMustExistGuard, SqxFrameworkModule, SqxSharedModule } from '@app/shared'; -import { AssetChangedTriggerComponent, CommentTriggerComponent, ContentChangedTriggerComponent, GenericActionComponent, RuleClassPipe, RuleComponent, RuleElementComponent, RuleEventsPageComponent, RuleIconComponent, RuleSimulatorPageComponent, RulesPageComponent, RuleTransitionComponent, SchemaChangedTriggerComponent, SimulatedRuleEventStatusPipe, UsageTriggerComponent } from './declarations'; +import { AssetChangedTriggerComponent, CommentTriggerComponent, ContentChangedSchemaComponent, ContentChangedTriggerComponent, GenericActionComponent, RuleClassPipe, RuleComponent, RuleElementComponent, RuleEventsPageComponent, RuleIconComponent, RuleSimulatorPageComponent, RulesPageComponent, RuleTransitionComponent, SchemaChangedTriggerComponent, SimulatedRuleEventStatusPipe, UsageTriggerComponent } from './declarations'; import { RuleEventComponent } from './pages/events/rule-event.component'; import { RulePageComponent } from './pages/rule/rule-page.component'; import { SimulatedRuleEventComponent } from './pages/simulator/simulated-rule-event.component'; @@ -68,6 +68,7 @@ const routes: Routes = [ declarations: [ AssetChangedTriggerComponent, CommentTriggerComponent, + ContentChangedSchemaComponent, ContentChangedTriggerComponent, FormattableInputComponent, GenericActionComponent, diff --git a/frontend/src/app/features/rules/pages/simulator/rule-transition.component.ts b/frontend/src/app/features/rules/pages/simulator/rule-transition.component.ts index 1227f3588..672450328 100644 --- a/frontend/src/app/features/rules/pages/simulator/rule-transition.component.ts +++ b/frontend/src/app/features/rules/pages/simulator/rule-transition.component.ts @@ -5,8 +5,8 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, Input, OnChanges, SimpleChanges } from '@angular/core'; -import { SimulatedRuleEventDto } from '@app/shared'; +import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; +import { SimulatedRuleEventDto, TypedSimpleChanges } from '@app/shared'; @Component({ selector: 'sqx-rule-transition', @@ -14,7 +14,7 @@ import { SimulatedRuleEventDto } from '@app/shared'; templateUrl: './rule-transition.component.html', changeDetection: ChangeDetectionStrategy.OnPush, }) -export class RuleTransitionComponent implements OnChanges { +export class RuleTransitionComponent { @Input() public event: SimulatedRuleEventDto | undefined | null; @@ -26,8 +26,8 @@ export class RuleTransitionComponent implements OnChanges { public filteredErrors?: string[] | null; - public ngOnChanges(changes: SimpleChanges) { - if (changes['event'] || changes['errors']) { + public ngOnChanges(changes: TypedSimpleChanges) { + if (changes.event || changes.errors) { const errors = this.errors; if (!errors) { diff --git a/frontend/src/app/features/rules/shared/actions/formattable-input.component.html b/frontend/src/app/features/rules/shared/actions/formattable-input.component.html index 600ba1c47..bd75523bf 100644 --- a/frontend/src/app/features/rules/shared/actions/formattable-input.component.html +++ b/frontend/src/app/features/rules/shared/actions/formattable-input.component.html @@ -1,6 +1,6 @@
- +
+ + +
+ +
+
{{ 'schemas.rules.when' | sqxTranslate }}
+
+ +
+ + + +
+ +
+ +
+
\ No newline at end of file diff --git a/frontend/src/app/features/rules/shared/triggers/content-changed-schema.component.scss b/frontend/src/app/features/rules/shared/triggers/content-changed-schema.component.scss new file mode 100644 index 000000000..f0272d417 --- /dev/null +++ b/frontend/src/app/features/rules/shared/triggers/content-changed-schema.component.scss @@ -0,0 +1,8 @@ +@import 'mixins'; +@import 'vars'; + +.label { + font-size: $font-small; + font-weight: normal; + line-height: 2.4rem; +} \ No newline at end of file diff --git a/frontend/src/app/features/rules/shared/triggers/content-changed-schema.component.ts b/frontend/src/app/features/rules/shared/triggers/content-changed-schema.component.ts new file mode 100644 index 000000000..9b36772f1 --- /dev/null +++ b/frontend/src/app/features/rules/shared/triggers/content-changed-schema.component.ts @@ -0,0 +1,47 @@ +/* + * Squidex Headless CMS + * + * @license + * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. + */ + +import { Component, EventEmitter, Input, Output } from '@angular/core'; +import { FormGroup } from '@angular/forms'; +import { EMPTY, Observable, switchMap } from 'rxjs'; +import { SchemaCompletions, SchemaDto, TypedSimpleChanges, value$ } from '@app/shared'; +import { CompletionsCache } from './completions-cache'; + +@Component({ + selector: 'sqx-content-changed-schema[form][schemas]', + styleUrls: ['./content-changed-schema.component.scss'], + templateUrl: './content-changed-schema.component.html', +}) +export class ContentChangedSchemaComponent { + @Input() + public schemas?: ReadonlyArray | null; + + @Input() + public form!: FormGroup; + + @Output() + public remove = new EventEmitter(); + + public completions: Observable = EMPTY; + + constructor( + private readonly completionsCache: CompletionsCache, + ) { + } + + public ngOnChanges(changes: TypedSimpleChanges) { + if (changes.form) { + this.completions = + value$(this.form.controls['schemaId']).pipe( + switchMap(x => this.completionsCache.getCompletions(x, true))); + } + } + + public trackBySchema(_index: number, schema: SchemaDto) { + return schema.id; + } +} diff --git a/frontend/src/app/features/rules/shared/triggers/content-changed-trigger.component.html b/frontend/src/app/features/rules/shared/triggers/content-changed-trigger.component.html index 67275eb43..64dd9c040 100644 --- a/frontend/src/app/features/rules/shared/triggers/content-changed-trigger.component.html +++ b/frontend/src/app/features/rules/shared/triggers/content-changed-trigger.component.html @@ -1,55 +1,28 @@ - - - - - - +
+ +
- - - - - +
+
+
{{ 'common.schema' | sqxTranslate }}
+
-
- - - - -
- - - -
- {{triggerSchema.schema.displayName}} - - - - -
+
+
{{ 'schemas.rules.when' | sqxTranslate }}
+
-
-
-
- -
+
+
{{ 'schemas.rules.condition' | sqxTranslate }}
+
-
- -
-
+
+ +
-

{{ 'common.conditions' | sqxTranslate }}

diff --git a/frontend/src/app/features/rules/shared/triggers/content-changed-trigger.component.scss b/frontend/src/app/features/rules/shared/triggers/content-changed-trigger.component.scss index a0e3dc8b1..306db21fb 100644 --- a/frontend/src/app/features/rules/shared/triggers/content-changed-trigger.component.scss +++ b/frontend/src/app/features/rules/shared/triggers/content-changed-trigger.component.scss @@ -9,4 +9,10 @@ .form-check { margin-top: 1rem; +} + +.label { + font-size: $font-small; + font-weight: normal; + line-height: 2.4rem; } \ No newline at end of file diff --git a/frontend/src/app/features/rules/shared/triggers/content-changed-trigger.component.ts b/frontend/src/app/features/rules/shared/triggers/content-changed-trigger.component.ts index af2983159..a656750cf 100644 --- a/frontend/src/app/features/rules/shared/triggers/content-changed-trigger.component.ts +++ b/frontend/src/app/features/rules/shared/triggers/content-changed-trigger.component.ts @@ -5,21 +5,19 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Component, Input, OnChanges } from '@angular/core'; -import { SchemaDto, TriggerForm } from '@app/shared'; - -export interface TriggerSchemaForm { - schema: SchemaDto; - - condition?: string; -} +import { Component, Input } from '@angular/core'; +import { SchemaDto, TemplatedFormArray, TriggerForm } from '@app/shared'; +import { CompletionsCache } from './completions-cache'; @Component({ selector: 'sqx-content-changed-trigger[trigger][triggerForm]', styleUrls: ['./content-changed-trigger.component.scss'], templateUrl: './content-changed-trigger.component.html', + providers: [ + CompletionsCache, + ], }) -export class ContentChangedTriggerComponent implements OnChanges { +export class ContentChangedTriggerComponent { @Input() public schemas?: ReadonlyArray | null; @@ -29,69 +27,15 @@ export class ContentChangedTriggerComponent implements OnChanges { @Input() public triggerForm!: TriggerForm; - public triggerSchemas: TriggerSchemaForm[] = []; - - public schemaToAdd!: SchemaDto; - public schemasToAdd!: ReadonlyArray; - - public get hasSchema() { - return !!this.schemaToAdd; - } - - public ngOnChanges() { - const schemas: TriggerSchemaForm[] = []; - - if (this.trigger.schemas && this.schemas) { - for (const triggerSchema of this.trigger.schemas) { - const schema = this.schemas.find(s => s.id === triggerSchema.schemaId); - - if (schema) { - const condition = triggerSchema.condition; - - schemas.push({ schema, condition }); - } - } - } - - this.triggerSchemas = schemas; - this.triggerSchemas.sortByString(x => x.schema.name); - - this.updateSchemaToAdd(); - } - - public removeSchema(schemaForm: TriggerSchemaForm) { - this.triggerSchemas.remove(schemaForm); - - this.updateValue(); - this.updateSchemaToAdd(); - } - - public addSchema() { - this.triggerSchemas.push({ schema: this.schemaToAdd }); - this.triggerSchemas.sortByString(x => x.schema.name); - - this.updateValue(); - this.updateSchemaToAdd(); - } - - public updateCondition(schema: SchemaDto, condition: string) { - this.triggerSchemas.replaceBy('schema', { schema, condition }); - - this.updateValue(); - } - - public updateValue() { - const schemas = this.triggerSchemas.map(({ schema, condition }) => ({ schemaId: schema.id, condition })); - - this.triggerForm.form.patchValue({ schemas }); + public get schemasForm() { + return this.triggerForm.form.get('schemas') as TemplatedFormArray; } - private updateSchemaToAdd() { - this.schemasToAdd = this.schemas?.filter(schema => !this.triggerSchemas.find(s => s.schema.id === schema.id)).sortByString(x => x.name) || []; - this.schemaToAdd = this.schemasToAdd[0]; + public add() { + this.schemasForm.add(); } - public trackBySchema(_index: number, schema: SchemaDto) { - return schema.id; + public remove(index: number) { + this.schemasForm.removeAt(index); } } diff --git a/frontend/src/app/features/schemas/pages/schema/common/schema-edit-form.component.ts b/frontend/src/app/features/schemas/pages/schema/common/schema-edit-form.component.ts index 139826f4d..0fa1ac0b8 100644 --- a/frontend/src/app/features/schemas/pages/schema/common/schema-edit-form.component.ts +++ b/frontend/src/app/features/schemas/pages/schema/common/schema-edit-form.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Component, Input, OnChanges } from '@angular/core'; +import { Component, Input } from '@angular/core'; import { EditSchemaForm, SchemaDto, SchemasState } from '@app/shared'; @Component({ @@ -13,7 +13,7 @@ import { EditSchemaForm, SchemaDto, SchemasState } from '@app/shared'; styleUrls: ['./schema-edit-form.component.scss'], templateUrl: './schema-edit-form.component.html', }) -export class SchemaEditFormComponent implements OnChanges { +export class SchemaEditFormComponent { @Input() public schema!: SchemaDto; diff --git a/frontend/src/app/features/schemas/pages/schema/export/schema-export-form.component.ts b/frontend/src/app/features/schemas/pages/schema/export/schema-export-form.component.ts index c4e548f9a..2bf9e57b3 100644 --- a/frontend/src/app/features/schemas/pages/schema/export/schema-export-form.component.ts +++ b/frontend/src/app/features/schemas/pages/schema/export/schema-export-form.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Component, Input, OnChanges } from '@angular/core'; +import { Component, Input } from '@angular/core'; import { SchemaDto, SchemasState, SynchronizeSchemaForm } from '@app/shared'; @Component({ @@ -13,7 +13,7 @@ import { SchemaDto, SchemasState, SynchronizeSchemaForm } from '@app/shared'; styleUrls: ['./schema-export-form.component.scss'], templateUrl: './schema-export-form.component.html', }) -export class SchemaExportFormComponent implements OnChanges { +export class SchemaExportFormComponent { @Input() public schema!: SchemaDto; diff --git a/frontend/src/app/features/schemas/pages/schema/fields/field-group.component.html b/frontend/src/app/features/schemas/pages/schema/fields/field-group.component.html index b5fea017b..377245971 100644 --- a/frontend/src/app/features/schemas/pages/schema/fields/field-group.component.html +++ b/frontend/src/app/features/schemas/pages/schema/fields/field-group.component.html @@ -3,7 +3,7 @@
- +