Skip to content

Commit

Permalink
chore(edit-content): remove module with all fields #30389
Browse files Browse the repository at this point in the history
  • Loading branch information
nicobytes committed Oct 18, 2024
1 parent e42386d commit 6b900b2
Show file tree
Hide file tree
Showing 4 changed files with 133 additions and 118 deletions.
8 changes: 8 additions & 0 deletions core-web/.betterer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { typescript } from '@betterer/typescript';

export default {
'stricter compilation': () =>
typescript('./tsconfig.json', {
strict: true
}).include('./src/**/*.ts')
};
Original file line number Diff line number Diff line change
Expand Up @@ -8,103 +8,139 @@

@switch (field.fieldType) {
@case (fieldTypes.SELECT) {
<dot-edit-content-select-field
[field]="field"
[attr.data-testId]="'field-' + field.variable" />
@defer (on immediate) {
<dot-edit-content-select-field
[field]="field"
[attr.data-testId]="'field-' + field.variable" />
}
}
@case (fieldTypes.RADIO) {
<dot-edit-content-radio-field
[field]="field"
[attr.data-testId]="'field-' + field.variable" />
@defer (on immediate) {
<dot-edit-content-radio-field
[field]="field"
[attr.data-testId]="'field-' + field.variable" />
}
}
@case (fieldTypes.TEXT) {
<dot-edit-content-text-field
[field]="field"
[attr.data-testId]="'field-' + field.variable" />
@defer (on immediate) {
<dot-edit-content-text-field
[field]="field"
[attr.data-testId]="'field-' + field.variable" />
}
}
@case (fieldTypes.TEXTAREA) {
<dot-edit-content-text-area
[field]="field"
[attr.data-testId]="'field-' + field.variable" />
@defer (on immediate) {
<dot-edit-content-text-area
[field]="field"
[attr.data-testId]="'field-' + field.variable" />
}
}
@case (fieldTypes.CHECKBOX) {
<dot-edit-content-checkbox-field
[field]="field"
[attr.data-testId]="'field-' + field.variable" />
@defer (on immediate) {
<dot-edit-content-checkbox-field
[field]="field"
[attr.data-testId]="'field-' + field.variable" />
}
}
@case (fieldTypes.MULTI_SELECT) {
<dot-edit-content-multi-select-field
[field]="field"
[attr.data-testId]="'field-' + field.variable" />
@defer (on immediate) {
<dot-edit-content-multi-select-field
[field]="field"
[attr.data-testId]="'field-' + field.variable" />
}
}
@case (calendarTypes.includes(field.fieldType) ? field.fieldType : '') {
<dot-edit-content-calendar-field
[field]="field"
[attr.data-testId]="'field-' + field.variable" />
@defer (on immediate) {
<dot-edit-content-calendar-field
[field]="field"
[attr.data-testId]="'field-' + field.variable" />
}
}
@case (fieldTypes.TAG) {
<dot-edit-content-tag-field
[field]="field"
[attr.data-testId]="'field-' + field.variable" />
@defer (on immediate) {
<dot-edit-content-tag-field
[field]="field"
[attr.data-testId]="'field-' + field.variable" />
}
}
@case (fieldTypes.JSON) {
<dot-edit-content-json-field
[field]="field"
[attr.data-testId]="'field-' + field.variable" />
@defer (on immediate) {
<dot-edit-content-json-field
[field]="field"
[attr.data-testId]="'field-' + field.variable" />
}
}
@case (fieldTypes.BINARY) {
<dot-edit-content-binary-field
[formControlName]="field.variable"
[contentlet]="contentlet"
[field]="field"
[attr.data-testId]="'field-' + field.variable" />
@defer (on immediate) {
<dot-edit-content-binary-field
[formControlName]="field.variable"
[contentlet]="contentlet"
[field]="field"
[attr.data-testId]="'field-' + field.variable" />
}
}
@case (fieldTypes.CUSTOM_FIELD) {
<dot-edit-content-custom-field
[field]="field"
[contentType]="contentType"
[attr.data-testId]="'field-' + field.variable" />
@defer (on immediate) {
<dot-edit-content-custom-field
[field]="field"
[contentType]="contentType"
[attr.data-testId]="'field-' + field.variable" />
}
}
@case (fieldTypes.BLOCK_EDITOR) {
<dot-block-editor
[formControlName]="field.variable"
[contentlet]="contentlet"
[field]="field"
[attr.data-testId]="'field-' + field.variable" />
@defer (on immediate) {
<dot-block-editor
[formControlName]="field.variable"
[contentlet]="contentlet"
[field]="field"
[attr.data-testId]="'field-' + field.variable" />
}
}
@case (fieldTypes.KEY_VALUE) {
<dot-edit-content-key-value
[formControlName]="field.variable"
[attr.data-testId]="'field-' + field.variable" />
@defer (on immediate) {
<dot-edit-content-key-value
[formControlName]="field.variable"
[attr.data-testId]="'field-' + field.variable" />
}
}
@case (fieldTypes.WYSIWYG) {
<dot-edit-content-wysiwyg-field
[field]="field"
[contentlet]="contentlet"
[attr.data-testId]="'field-' + field.variable" />
@defer (on immediate) {
<dot-edit-content-wysiwyg-field
[field]="field"
[contentlet]="contentlet"
[attr.data-testId]="'field-' + field.variable" />
}
}
@case (fieldTypes.HOST_FOLDER) {
<dot-edit-content-host-folder-field
[field]="field"
[attr.data-testId]="'field-' + field.variable" />
@defer (on immediate) {
<dot-edit-content-host-folder-field
[field]="field"
[attr.data-testId]="'field-' + field.variable" />
}
}
@case (fieldTypes.CATEGORY) {
<dot-edit-content-category-field
[attr.data-testId]="'field-' + field.variable"
[contentlet]="contentlet"
[field]="field" />
@defer (on immediate) {
<dot-edit-content-category-field
[attr.data-testId]="'field-' + field.variable"
[contentlet]="contentlet"
[field]="field" />
}
}
@case (fieldTypes.FILE) {
<dot-edit-content-file-field
[formControlName]="field.variable"
[attr.data-testId]="'field-' + field.variable"
[field]="field" />
@defer (on immediate) {
<dot-edit-content-file-field
[formControlName]="field.variable"
[attr.data-testId]="'field-' + field.variable"
[field]="field" />
}
}
@case (fieldTypes.IMAGE) {
<dot-edit-content-file-field
[formControlName]="field.variable"
[attr.data-testId]="'field-' + field.variable"
[field]="field" />
@defer (on immediate) {
<dot-edit-content-file-field
[formControlName]="field.variable"
[attr.data-testId]="'field-' + field.variable"
[field]="field" />
}
}
}
@if (field.hint) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,20 @@ import { DotCMSContentlet, DotCMSContentTypeField } from '@dotcms/dotcms-models'
import { DotFieldRequiredDirective } from '@dotcms/ui';

import { DotEditContentBinaryFieldComponent } from '../../fields/dot-edit-content-binary-field/dot-edit-content-binary-field.component';
import { DotEditContentFieldsModule } from '../../fields/dot-edit-content-fields.module';
import { DotEditContentCalendarFieldComponent } from '../../fields/dot-edit-content-calendar-field/dot-edit-content-calendar-field.component';
import { DotEditContentCategoryFieldComponent } from '../../fields/dot-edit-content-category-field/dot-edit-content-category-field.component';
import { DotEditContentCheckboxFieldComponent } from '../../fields/dot-edit-content-checkbox-field/dot-edit-content-checkbox-field.component';
import { DotEditContentCustomFieldComponent } from '../../fields/dot-edit-content-custom-field/dot-edit-content-custom-field.component';
import { DotEditContentFileFieldComponent } from '../../fields/dot-edit-content-file-field/dot-edit-content-file-field.component';
import { DotEditContentHostFolderFieldComponent } from '../../fields/dot-edit-content-host-folder-field/dot-edit-content-host-folder-field.component';
import { DotEditContentJsonFieldComponent } from '../../fields/dot-edit-content-json-field/dot-edit-content-json-field.component';
import { DotEditContentKeyValueComponent } from '../../fields/dot-edit-content-key-value/dot-edit-content-key-value.component';
import { DotEditContentMultiSelectFieldComponent } from '../../fields/dot-edit-content-multi-select-field/dot-edit-content-multi-select-field.component';
import { DotEditContentRadioFieldComponent } from '../../fields/dot-edit-content-radio-field/dot-edit-content-radio-field.component';
import { DotEditContentSelectFieldComponent } from '../../fields/dot-edit-content-select-field/dot-edit-content-select-field.component';
import { DotEditContentTagFieldComponent } from '../../fields/dot-edit-content-tag-field/dot-edit-content-tag-field.component';
import { DotEditContentTextAreaComponent } from '../../fields/dot-edit-content-text-area/dot-edit-content-text-area.component';
import { DotEditContentTextFieldComponent } from '../../fields/dot-edit-content-text-field/dot-edit-content-text-field.component';
import { DotEditContentWYSIWYGFieldComponent } from '../../fields/dot-edit-content-wysiwyg-field/dot-edit-content-wysiwyg-field.component';
import { CALENDAR_FIELD_TYPES } from '../../models/dot-edit-content-field.constant';
import { FIELD_TYPES } from '../../models/dot-edit-content-field.enum';
Expand All @@ -27,7 +38,20 @@ import { FIELD_TYPES } from '../../models/dot-edit-content-field.enum';
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [
ReactiveFormsModule,
DotEditContentFieldsModule,
DotEditContentTextAreaComponent,
DotEditContentRadioFieldComponent,
DotEditContentSelectFieldComponent,
DotEditContentTextFieldComponent,
DotEditContentCalendarFieldComponent,
DotEditContentTagFieldComponent,
DotEditContentCheckboxFieldComponent,
DotEditContentMultiSelectFieldComponent,
DotEditContentBinaryFieldComponent,
DotEditContentJsonFieldComponent,
DotEditContentCustomFieldComponent,
DotEditContentWYSIWYGFieldComponent,
DotEditContentHostFolderFieldComponent,
DotEditContentCategoryFieldComponent,
DotFieldRequiredDirective,
BlockEditorModule,
DotEditContentBinaryFieldComponent,
Expand Down

This file was deleted.

0 comments on commit 6b900b2

Please sign in to comment.