diff --git a/backend/i18n/frontend_en.json b/backend/i18n/frontend_en.json index 8ed9dafca..ddd81686d 100644 --- a/backend/i18n/frontend_en.json +++ b/backend/i18n/frontend_en.json @@ -331,6 +331,7 @@ "common.tagsAll": "All tags", "common.time": "Time", "common.update": "Update", + "common.upload": "Upload", "common.url": "URL", "common.users": "Users", "common.value": "Value", diff --git a/backend/i18n/frontend_it.json b/backend/i18n/frontend_it.json index a3c316938..5096effdc 100644 --- a/backend/i18n/frontend_it.json +++ b/backend/i18n/frontend_it.json @@ -331,6 +331,7 @@ "common.tagsAll": "Tutti i tag", "common.time": "Ora", "common.update": "Aggiorna", + "common.upload": "Upload", "common.url": "URL", "common.users": "Utenti", "common.value": "Valore", diff --git a/backend/i18n/frontend_nl.json b/backend/i18n/frontend_nl.json index 4c5f50f50..dcdc9e828 100644 --- a/backend/i18n/frontend_nl.json +++ b/backend/i18n/frontend_nl.json @@ -331,6 +331,7 @@ "common.tagsAll": "Alle tags", "common.time": "Tijd", "common.update": "Update", + "common.upload": "Upload", "common.url": "URL", "common.users": "Gebruikers", "common.value": "Waarde", diff --git a/backend/i18n/source/frontend_en.json b/backend/i18n/source/frontend_en.json index 8ed9dafca..ddd81686d 100644 --- a/backend/i18n/source/frontend_en.json +++ b/backend/i18n/source/frontend_en.json @@ -331,6 +331,7 @@ "common.tagsAll": "All tags", "common.time": "Time", "common.update": "Update", + "common.upload": "Upload", "common.url": "URL", "common.users": "Users", "common.value": "Value", diff --git a/backend/src/Squidex.Infrastructure.MongoDb/MongoDb/DomainIdSerializer.cs b/backend/src/Squidex.Infrastructure.MongoDb/MongoDb/DomainIdSerializer.cs index b4b77117b..475763e3c 100644 --- a/backend/src/Squidex.Infrastructure.MongoDb/MongoDb/DomainIdSerializer.cs +++ b/backend/src/Squidex.Infrastructure.MongoDb/MongoDb/DomainIdSerializer.cs @@ -6,7 +6,6 @@ // ========================================================================== using System; -using System.Threading; using MongoDB.Bson; using MongoDB.Bson.Serialization; using MongoDB.Bson.Serialization.Serializers; @@ -15,20 +14,15 @@ namespace Squidex.Infrastructure.MongoDb { public sealed class DomainIdSerializer : SerializerBase, IBsonPolymorphicSerializer, IRepresentationConfigurable { - private static int isRegistered; - public static void Register() { - if (Interlocked.Increment(ref isRegistered) == 1) + try + { + BsonSerializer.RegisterSerializer(new DomainIdSerializer()); + } + catch (BsonSerializationException) { - try - { - BsonSerializer.RegisterSerializer(new DomainIdSerializer()); - } - catch (BsonSerializationException) - { - return; - } + return; } } diff --git a/backend/src/Squidex.Infrastructure.MongoDb/MongoDb/InstantSerializer.cs b/backend/src/Squidex.Infrastructure.MongoDb/MongoDb/InstantSerializer.cs index e3ceb9e22..63c871406 100644 --- a/backend/src/Squidex.Infrastructure.MongoDb/MongoDb/InstantSerializer.cs +++ b/backend/src/Squidex.Infrastructure.MongoDb/MongoDb/InstantSerializer.cs @@ -18,14 +18,7 @@ namespace Squidex.Infrastructure.MongoDb { try { - try - { - BsonSerializer.RegisterSerializer(new InstantSerializer()); - } - catch (BsonSerializationException) - { - return; - } + BsonSerializer.RegisterSerializer(new InstantSerializer()); } catch (BsonSerializationException) { diff --git a/backend/src/Squidex.Infrastructure.MongoDb/MongoDb/RefTokenSerializer.cs b/backend/src/Squidex.Infrastructure.MongoDb/MongoDb/RefTokenSerializer.cs index debb9770b..890bade4a 100644 --- a/backend/src/Squidex.Infrastructure.MongoDb/MongoDb/RefTokenSerializer.cs +++ b/backend/src/Squidex.Infrastructure.MongoDb/MongoDb/RefTokenSerializer.cs @@ -17,14 +17,7 @@ namespace Squidex.Infrastructure.MongoDb { try { - try - { - BsonSerializer.RegisterSerializer(new RefTokenSerializer()); - } - catch (BsonSerializationException) - { - return; - } + BsonSerializer.RegisterSerializer(new RefTokenSerializer()); } catch (BsonSerializationException) { diff --git a/frontend/app/features/content/shared/forms/field-editor.component.html b/frontend/app/features/content/shared/forms/field-editor.component.html index 37c13a742..d0bd80b2e 100644 --- a/frontend/app/features/content/shared/forms/field-editor.component.html +++ b/frontend/app/features/content/shared/forms/field-editor.component.html @@ -51,7 +51,7 @@ - + diff --git a/frontend/app/features/dashboard/pages/dashboard-config.component.html b/frontend/app/features/dashboard/pages/dashboard-config.component.html index 916b34518..26db96e1d 100644 --- a/frontend/app/features/dashboard/pages/dashboard-config.component.html +++ b/frontend/app/features/dashboard/pages/dashboard-config.component.html @@ -42,7 +42,7 @@
- +
diff --git a/frontend/app/features/schemas/pages/schema/export/schema-export-form.component.html b/frontend/app/features/schemas/pages/schema/export/schema-export-form.component.html index ebb91e9c8..d9caf56e1 100644 --- a/frontend/app/features/schemas/pages/schema/export/schema-export-form.component.html +++ b/frontend/app/features/schemas/pages/schema/export/schema-export-form.component.html @@ -28,6 +28,6 @@
- +
\ No newline at end of file diff --git a/frontend/app/features/schemas/pages/schemas/schema-form.component.html b/frontend/app/features/schemas/pages/schemas/schema-form.component.html index 49e66aced..643321e68 100644 --- a/frontend/app/features/schemas/pages/schemas/schema-form.component.html +++ b/frontend/app/features/schemas/pages/schemas/schema-form.component.html @@ -88,7 +88,7 @@ {{ 'common.hide' | sqxTranslate }} - +
diff --git a/frontend/app/framework/angular/forms/editors/json-editor.component.html b/frontend/app/framework/angular/forms/editors/json-editor.component.html deleted file mode 100644 index 4f3456fb7..000000000 --- a/frontend/app/framework/angular/forms/editors/json-editor.component.html +++ /dev/null @@ -1 +0,0 @@ -
\ No newline at end of file diff --git a/frontend/app/framework/angular/forms/editors/json-editor.component.scss b/frontend/app/framework/angular/forms/editors/json-editor.component.scss deleted file mode 100644 index 56197ee78..000000000 --- a/frontend/app/framework/angular/forms/editors/json-editor.component.scss +++ /dev/null @@ -1,26 +0,0 @@ -// sass-lint:disable class-name-format - -$editor-height: 30rem; - -:host ::ng-deep { - .ace_editor { - border: 1px solid $color-input; - - &.no-border { - border: 0; - } - } - - .ace_active-line, - .ace_gutter-active-line { - background: none !important; - } - - .ace_gutter-active-line { - background: darken($color-border, 5%) !important; - } - - .ace_gutter { - background: $color-border !important; - } -} \ No newline at end of file diff --git a/frontend/app/framework/angular/forms/editors/json-editor.component.ts b/frontend/app/framework/angular/forms/editors/json-editor.component.ts deleted file mode 100644 index b38f9a6f1..000000000 --- a/frontend/app/framework/angular/forms/editors/json-editor.component.ts +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Squidex Headless CMS - * - * @license - * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. - */ - -import { AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, forwardRef, Input, ViewChild } from '@angular/core'; -import { NG_VALUE_ACCESSOR } from '@angular/forms'; -import { ResourceLoaderService, StatefulControlComponent } from '@app/framework/internal'; -import { Subject } from 'rxjs'; -import { debounceTime } from 'rxjs/operators'; -import { FocusComponent } from './../forms-helper'; - -declare var ace: any; - -export const SQX_JSON_EDITOR_CONTROL_VALUE_ACCESSOR: any = { - provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => JsonEditorComponent), multi: true -}; - -@Component({ - selector: 'sqx-json-editor', - styleUrls: ['./json-editor.component.scss'], - templateUrl: './json-editor.component.html', - providers: [ - SQX_JSON_EDITOR_CONTROL_VALUE_ACCESSOR - ], - changeDetection: ChangeDetectionStrategy.OnPush -}) -export class JsonEditorComponent extends StatefulControlComponent<{}, string> implements AfterViewInit, FocusComponent { - private valueChanged = new Subject(); - private aceEditor: any; - private value: any; - private valueString: string; - - @ViewChild('editor', { static: false }) - public editor: ElementRef; - - @Input() - public noBorder = false; - - @Input() - public height = 0; - - constructor(changeDetector: ChangeDetectorRef, - private readonly resourceLoader: ResourceLoaderService - ) { - super(changeDetector, {}); - } - - public ngAfterViewInit() { - this.valueChanged.pipe( - debounceTime(500)) - .subscribe(() => { - this.changeValue(); - }); - - if (this.height) { - this.editor.nativeElement.style.height = `${this.height}px`; - } - - this.resourceLoader.loadLocalScript('dependencies/ace/ace.js').then(() => { - this.aceEditor = ace.edit(this.editor.nativeElement); - - this.aceEditor.getSession().setMode('ace/mode/javascript'); - this.aceEditor.setReadOnly(this.snapshot.isDisabled); - this.aceEditor.setFontSize(14); - - this.setValue(this.value); - - this.aceEditor.on('blur', () => { - this.changeValue(); - this.callTouched(); - }); - - this.aceEditor.on('change', () => { - this.valueChanged.next(); - }); - - this.detach(); - }); - } - - public writeValue(obj: any) { - this.value = obj; - - try { - this.valueString = JSON.stringify(obj); - } catch (e) { - this.valueString = ''; - } - - if (this.aceEditor) { - this.setValue(obj); - } - } - - public setDisabledState(isDisabled: boolean): void { - super.setDisabledState(isDisabled); - - if (this.aceEditor) { - this.aceEditor.setReadOnly(isDisabled); - } - } - - public focus() { - if (this.aceEditor) { - this.aceEditor.focus(); - } - } - - private changeValue() { - const isValid = this.aceEditor.getSession().getAnnotations().length === 0; - - let newValue: any = null; - - if (isValid) { - try { - newValue = JSON.parse(this.aceEditor.getValue()); - } catch (e) { - newValue = null; - } - } - - const newValueString = JSON.stringify(newValue); - - if (this.valueString !== newValueString) { - this.callChange(newValue); - } - - this.value = newValue; - this.valueString = newValueString; - } - - private setValue(value: any) { - if (value) { - const jsonString = JSON.stringify(value, undefined, 4); - - this.aceEditor.setValue(jsonString); - } else { - this.aceEditor.setValue(''); - } - - this.aceEditor.clearSelection(); - } -} \ No newline at end of file diff --git a/frontend/app/framework/declarations.ts b/frontend/app/framework/declarations.ts index a8a2b7921..47c823986 100644 --- a/frontend/app/framework/declarations.ts +++ b/frontend/app/framework/declarations.ts @@ -19,7 +19,6 @@ export * from './angular/forms/editors/color-picker.component'; export * from './angular/forms/editors/date-time-editor.component'; export * from './angular/forms/editors/dropdown.component'; export * from './angular/forms/editors/iframe-editor.component'; -export * from './angular/forms/editors/json-editor.component'; export * from './angular/forms/editors/localized-input.component'; export * from './angular/forms/editors/stars.component'; export * from './angular/forms/editors/tag-editor.component'; diff --git a/frontend/app/framework/module.ts b/frontend/app/framework/module.ts index 95d89a9c8..a140e33c8 100644 --- a/frontend/app/framework/module.ts +++ b/frontend/app/framework/module.ts @@ -12,7 +12,7 @@ import { HTTP_INTERCEPTORS } from '@angular/common/http'; import { ModuleWithProviders, NgModule } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { ColorPickerModule } from 'ngx-color-picker'; -import { AnalyticsService, AutocompleteComponent, AvatarComponent, CachingInterceptor, CanDeactivateGuard, CheckboxGroupComponent, ClipboardService, CodeComponent, CodeEditorComponent, ColorPickerComponent, ConfirmClickDirective, ControlErrorsComponent, CopyDirective, DarkenPipe, DatePipe, DateTimeEditorComponent, DayOfWeekPipe, DayPipe, DialogRendererComponent, DialogService, DisplayNamePipe, DropdownComponent, DurationPipe, EditableTitleComponent, ExternalLinkDirective, FileDropDirective, FileSizePipe, FocusOnInitDirective, FormAlertComponent, FormErrorComponent, FormHintComponent, FromNowPipe, FullDateTimePipe, HighlightPipe, HoverBackgroundDirective, IFrameEditorComponent, ImageSourceDirective, IndeterminateValueDirective, ISODatePipe, JsonEditorComponent, KeysPipe, KNumberPipe, LanguageSelectorComponent, LightenPipe, ListViewComponent, LoadingInterceptor, LoadingService, LocalizedInputComponent, LocalStoreService, MarkdownInlinePipe, MarkdownPipe, MessageBus, ModalDialogComponent, ModalDirective, ModalPlacementDirective, MoneyPipe, MonthPipe, OnboardingService, OnboardingTooltipComponent, PagerComponent, PanelComponent, PanelContainerDirective, ParentLinkDirective, PopupLinkDirective, ProgressBarComponent, ResizedDirective, ResizeService, ResourceLoaderService, RootViewComponent, SafeHtmlPipe, SafeUrlPipe, ScrollActiveDirective, ShortcutComponent, ShortcutService, ShortDatePipe, ShortTimePipe, StarsComponent, StatusIconComponent, StopClickDirective, SyncScollingDirective, SyncWidthDirective, TabRouterlinkDirective, TagEditorComponent, TemplateWrapperDirective, TempService, TitleComponent, TitleService, ToggleComponent, TooltipDirective, TransformInputDirective, TranslatePipe, VideoPlayerComponent } from './declarations'; +import { AnalyticsService, AutocompleteComponent, AvatarComponent, CachingInterceptor, CanDeactivateGuard, CheckboxGroupComponent, ClipboardService, CodeComponent, CodeEditorComponent, ColorPickerComponent, ConfirmClickDirective, ControlErrorsComponent, CopyDirective, DarkenPipe, DatePipe, DateTimeEditorComponent, DayOfWeekPipe, DayPipe, DialogRendererComponent, DialogService, DisplayNamePipe, DropdownComponent, DurationPipe, EditableTitleComponent, ExternalLinkDirective, FileDropDirective, FileSizePipe, FocusOnInitDirective, FormAlertComponent, FormErrorComponent, FormHintComponent, FromNowPipe, FullDateTimePipe, HighlightPipe, HoverBackgroundDirective, IFrameEditorComponent, ImageSourceDirective, IndeterminateValueDirective, ISODatePipe, KeysPipe, KNumberPipe, LanguageSelectorComponent, LightenPipe, ListViewComponent, LoadingInterceptor, LoadingService, LocalizedInputComponent, LocalStoreService, MarkdownInlinePipe, MarkdownPipe, MessageBus, ModalDialogComponent, ModalDirective, ModalPlacementDirective, MoneyPipe, MonthPipe, OnboardingService, OnboardingTooltipComponent, PagerComponent, PanelComponent, PanelContainerDirective, ParentLinkDirective, PopupLinkDirective, ProgressBarComponent, ResizedDirective, ResizeService, ResourceLoaderService, RootViewComponent, SafeHtmlPipe, SafeUrlPipe, ScrollActiveDirective, ShortcutComponent, ShortcutService, ShortDatePipe, ShortTimePipe, StarsComponent, StatusIconComponent, StopClickDirective, SyncScollingDirective, SyncWidthDirective, TabRouterlinkDirective, TagEditorComponent, TemplateWrapperDirective, TempService, TitleComponent, TitleService, ToggleComponent, TooltipDirective, TransformInputDirective, TranslatePipe, VideoPlayerComponent } from './declarations'; @NgModule({ imports: [ @@ -56,7 +56,6 @@ import { AnalyticsService, AutocompleteComponent, AvatarComponent, CachingInterc ImageSourceDirective, IndeterminateValueDirective, ISODatePipe, - JsonEditorComponent, KeysPipe, KNumberPipe, LanguageSelectorComponent, @@ -137,7 +136,6 @@ import { AnalyticsService, AutocompleteComponent, AvatarComponent, CachingInterc ImageSourceDirective, IndeterminateValueDirective, ISODatePipe, - JsonEditorComponent, KeysPipe, KNumberPipe, LanguageSelectorComponent, diff --git a/frontend/app/shared/components/assets/asset-dialog.component.html b/frontend/app/shared/components/assets/asset-dialog.component.html index 17d458cb5..e3da7433e 100644 --- a/frontend/app/shared/components/assets/asset-dialog.component.html +++ b/frontend/app/shared/components/assets/asset-dialog.component.html @@ -42,7 +42,7 @@
@@ -51,8 +51,8 @@ -