move all manifest types from server generation to client

This commit is contained in:
Mads Rasmussen
2022-10-27 13:58:44 +02:00
parent aa46f09311
commit a19f8a082c
28 changed files with 516 additions and 1795 deletions

View File

@@ -105,66 +105,6 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/ProblemDetails'
/property-editors/list:
get:
operationId: PropertyEditorsListEndpoint
responses:
'200':
description: 200 response
content:
application/json:
schema:
$ref: '#/components/schemas/PropertyEditorsListResponse'
default:
description: default response
content:
application/json:
schema:
$ref: '#/components/schemas/ProblemDetails'
/property-editors/property-editor/{propertyEditorAlias}:
get:
operationId: PropertyEditorEndpoint
parameters:
- name: propertyEditorAlias
in: path
required: true
schema:
type: string
responses:
'200':
description: 200 response
content:
application/json:
schema:
$ref: '#/components/schemas/PropertyEditorResponse'
default:
description: default response
content:
application/json:
schema:
$ref: '#/components/schemas/ProblemDetails'
/property-editors/property-editor/config/{propertyEditorAlias}:
get:
operationId: PropertyEditorConfigEndpoint
parameters:
- name: propertyEditorAlias
in: path
required: true
schema:
type: string
responses:
'200':
description: 200 response
content:
application/json:
schema:
$ref: '#/components/schemas/PropertyEditorConfigResponse'
default:
description: default response
content:
application/json:
schema:
$ref: '#/components/schemas/ProblemDetails'
/published-cache/status:
get:
operationId: PublishedCacheStatus
@@ -559,555 +499,13 @@ components:
required:
- user
- telemetryLevel
MetaSection:
type: object
properties:
label:
type: string
pathname:
type: string
required:
- label
- pathname
IManifestSection:
type: object
properties:
type:
type: string
enum:
- section
meta:
$ref: '#/components/schemas/MetaSection'
js:
type: string
elementName:
type: string
alias:
type: string
name:
type: string
weight:
type: number
format: float
required:
- type
- meta
- alias
- name
MetaSectionView:
type: object
properties:
sections:
type: array
items:
type: string
label:
type: string
pathname:
type: string
weight:
type: number
format: float
icon:
type: string
required:
- sections
- label
- pathname
- weight
- icon
IManifestSectionView:
type: object
properties:
type:
type: string
enum:
- sectionView
meta:
$ref: '#/components/schemas/MetaSectionView'
js:
type: string
elementName:
type: string
alias:
type: string
name:
type: string
weight:
type: number
format: float
required:
- type
- meta
- alias
- name
MetaTree:
type: object
properties:
sections:
type: array
items:
type: string
required:
- sections
IManifestTree:
type: object
properties:
type:
type: string
enum:
- tree
meta:
$ref: '#/components/schemas/MetaTree'
js:
type: string
elementName:
type: string
alias:
type: string
name:
type: string
weight:
type: number
format: float
required:
- type
- meta
- alias
- name
MetaEditor:
type: object
properties:
entityType:
type: string
required:
- entityType
IManifestEditor:
type: object
properties:
type:
type: string
enum:
- editor
meta:
$ref: '#/components/schemas/MetaEditor'
js:
type: string
elementName:
type: string
alias:
type: string
name:
type: string
weight:
type: number
format: float
required:
- type
- meta
- alias
- name
MetaEditorAction:
type: object
properties:
editors:
type: array
items:
type: string
required:
- editors
IManifestEditorAction:
type: object
properties:
type:
type: string
enum:
- editorAction
meta:
$ref: '#/components/schemas/MetaEditorAction'
js:
type: string
elementName:
type: string
alias:
type: string
name:
type: string
weight:
type: number
format: float
required:
- type
- meta
- alias
- name
MetaEditorView:
type: object
properties:
editors:
type: array
items:
type: string
pathname:
type: string
label:
type: string
icon:
type: string
required:
- editors
- pathname
- label
- icon
IManifestEditorView:
type: object
properties:
type:
type: string
enum:
- editorView
meta:
$ref: '#/components/schemas/MetaEditorView'
js:
type: string
elementName:
type: string
alias:
type: string
name:
type: string
weight:
type: number
format: float
required:
- type
- meta
- alias
- name
MetaTreeItemAction:
type: object
properties:
trees:
type: array
items:
type: string
label:
type: string
icon:
type: string
required:
- trees
- label
- icon
IManifestTreeItemAction:
type: object
properties:
type:
type: string
enum:
- treeItemAction
meta:
$ref: '#/components/schemas/MetaTreeItemAction'
js:
type: string
elementName:
type: string
alias:
type: string
name:
type: string
weight:
type: number
format: float
required:
- type
- meta
- alias
- name
PropertyEditorConfigProperty:
type: object
properties:
label:
type: string
description:
type: string
alias:
type: string
propertyEditorUI:
type: string
required:
- label
- alias
- propertyEditorUI
PropertyEditorConfigDefaultData:
type: object
properties:
alias:
type: string
value:
nullable: true
oneOf:
- type: string
- type: number
format: float
- type: boolean
- type: object
- type: array
items:
type: string
- type: array
items:
type: number
format: float
- type: array
items:
type: boolean
- type: array
items:
type: object
required:
- alias
- value
PropertyEditorConfig:
type: object
properties:
properties:
type: array
items:
$ref: '#/components/schemas/PropertyEditorConfigProperty'
defaultData:
type: array
items:
$ref: '#/components/schemas/PropertyEditorConfigDefaultData'
required:
- properties
MetaPropertyEditorUI:
type: object
properties:
label:
type: string
propertyEditor:
type: string
icon:
type: string
group:
type: string
config:
$ref: '#/components/schemas/PropertyEditorConfig'
required:
- label
- propertyEditor
- icon
- group
IManifestPropertyEditorUI:
type: object
properties:
type:
type: string
enum:
- propertyEditorUI
meta:
$ref: '#/components/schemas/MetaPropertyEditorUI'
js:
type: string
elementName:
type: string
alias:
type: string
name:
type: string
weight:
type: number
format: float
required:
- type
- meta
- alias
- name
MetaDashboard:
type: object
properties:
sections:
type: array
items:
type: string
pathname:
type: string
label:
type: string
required:
- sections
- pathname
IManifestDashboard:
type: object
properties:
type:
type: string
enum:
- dashboard
meta:
$ref: '#/components/schemas/MetaDashboard'
js:
type: string
elementName:
type: string
alias:
type: string
name:
type: string
weight:
type: number
format: float
required:
- type
- meta
- alias
- name
MetaPropertyAction:
type: object
properties:
propertyEditors:
type: array
items:
type: string
required:
- propertyEditors
IManifestPropertyAction:
type: object
properties:
type:
type: string
enum:
- propertyAction
meta:
$ref: '#/components/schemas/MetaPropertyAction'
js:
type: string
elementName:
type: string
alias:
type: string
name:
type: string
weight:
type: number
format: float
required:
- type
- meta
- alias
- name
MetaPackageView:
type: object
properties:
packageAlias:
type: string
required:
- packageAlias
IManifestPackageView:
type: object
properties:
type:
type: string
enum:
- packageView
meta:
$ref: '#/components/schemas/MetaPackageView'
js:
type: string
elementName:
type: string
alias:
type: string
name:
type: string
weight:
type: number
format: float
required:
- type
- meta
- alias
- name
IManifestEntrypoint:
type: object
properties:
type:
type: string
enum:
- entrypoint
js:
type: string
alias:
type: string
name:
type: string
weight:
type: number
format: float
required:
- type
- js
- alias
- name
IManifestCustom:
type: object
properties:
type:
type: string
enum:
- custom
meta:
type: object
alias:
type: string
name:
type: string
weight:
type: number
format: float
required:
- type
- alias
- name
Manifest:
oneOf:
- $ref: '#/components/schemas/IManifestSection'
- $ref: '#/components/schemas/IManifestSectionView'
- $ref: '#/components/schemas/IManifestTree'
- $ref: '#/components/schemas/IManifestEditor'
- $ref: '#/components/schemas/IManifestEditorAction'
- $ref: '#/components/schemas/IManifestEditorView'
- $ref: '#/components/schemas/IManifestTreeItemAction'
- $ref: '#/components/schemas/IManifestPropertyEditorUI'
- $ref: '#/components/schemas/IManifestDashboard'
- $ref: '#/components/schemas/IManifestPropertyAction'
- $ref: '#/components/schemas/IManifestPackageView'
- $ref: '#/components/schemas/IManifestEntrypoint'
- $ref: '#/components/schemas/IManifestCustom'
discriminator:
propertyName: type
mapping:
section: '#/components/schemas/IManifestSection'
sectionView: '#/components/schemas/IManifestSectionView'
tree: '#/components/schemas/IManifestTree'
editor: '#/components/schemas/IManifestEditor'
editorAction: '#/components/schemas/IManifestEditorAction'
editorView: '#/components/schemas/IManifestEditorView'
treeItemAction: '#/components/schemas/IManifestTreeItemAction'
propertyEditorUI: '#/components/schemas/IManifestPropertyEditorUI'
dashboard: '#/components/schemas/IManifestDashboard'
propertyAction: '#/components/schemas/IManifestPropertyAction'
packageView: '#/components/schemas/IManifestPackageView'
entrypoint: '#/components/schemas/IManifestEntrypoint'
custom: '#/components/schemas/IManifestCustom'
ManifestsResponse:
type: object
properties:
manifests:
type: array
items:
$ref: '#/components/schemas/Manifest'
type: object
required:
- manifests
PackageInstalled:
@@ -1146,74 +544,6 @@ components:
$ref: '#/components/schemas/PackageInstalled'
required:
- packages
PropertyEditor:
type: object
properties:
alias:
type: string
name:
type: string
icon:
type: string
group:
type: string
isSystem:
type: boolean
hasConfig:
type: boolean
config:
$ref: '#/components/schemas/PropertyEditorConfig'
required:
- alias
- name
- icon
- isSystem
- hasConfig
PropertyEditorsListResponse:
type: object
properties:
propertyEditors:
type: array
items:
$ref: '#/components/schemas/PropertyEditor'
required:
- propertyEditors
PropertyEditorResponse:
type: object
properties:
alias:
type: string
name:
type: string
icon:
type: string
group:
type: string
isSystem:
type: boolean
hasConfig:
type: boolean
config:
$ref: '#/components/schemas/PropertyEditorConfig'
required:
- alias
- name
- icon
- isSystem
- hasConfig
PropertyEditorConfigResponse:
type: object
properties:
properties:
type: array
items:
$ref: '#/components/schemas/PropertyEditorConfigProperty'
defaultData:
type: array
items:
$ref: '#/components/schemas/PropertyEditorConfigDefaultData'
required:
- properties
ServerStatus:
type: string
enum:

View File

@@ -22,15 +22,6 @@ export interface paths {
"/manifests/packages/installed": {
get: operations["ManifestsPackagesInstalled"];
};
"/property-editors/list": {
get: operations["PropertyEditorsListEndpoint"];
};
"/property-editors/property-editor/{propertyEditorAlias}": {
get: operations["PropertyEditorEndpoint"];
};
"/property-editors/property-editor/config/{propertyEditorAlias}": {
get: operations["PropertyEditorConfigEndpoint"];
};
"/published-cache/status": {
get: operations["PublishedCacheStatus"];
};
@@ -139,236 +130,8 @@ export interface components {
telemetryLevel: components["schemas"]["ConsentLevel"];
database?: components["schemas"]["InstallSetupDatabaseConfiguration"];
};
MetaSection: {
label: string;
pathname: string;
};
IManifestSection: {
/** @enum {string} */
type: "section";
meta: components["schemas"]["MetaSection"];
js?: string;
elementName?: string;
alias: string;
name: string;
/** Format: float */
weight?: number;
};
MetaSectionView: {
sections: string[];
label: string;
pathname: string;
/** Format: float */
weight: number;
icon: string;
};
IManifestSectionView: {
/** @enum {string} */
type: "sectionView";
meta: components["schemas"]["MetaSectionView"];
js?: string;
elementName?: string;
alias: string;
name: string;
/** Format: float */
weight?: number;
};
MetaTree: {
sections: string[];
};
IManifestTree: {
/** @enum {string} */
type: "tree";
meta: components["schemas"]["MetaTree"];
js?: string;
elementName?: string;
alias: string;
name: string;
/** Format: float */
weight?: number;
};
MetaEditor: {
entityType: string;
};
IManifestEditor: {
/** @enum {string} */
type: "editor";
meta: components["schemas"]["MetaEditor"];
js?: string;
elementName?: string;
alias: string;
name: string;
/** Format: float */
weight?: number;
};
MetaEditorAction: {
editors: string[];
};
IManifestEditorAction: {
/** @enum {string} */
type: "editorAction";
meta: components["schemas"]["MetaEditorAction"];
js?: string;
elementName?: string;
alias: string;
name: string;
/** Format: float */
weight?: number;
};
MetaEditorView: {
editors: string[];
pathname: string;
label: string;
icon: string;
};
IManifestEditorView: {
/** @enum {string} */
type: "editorView";
meta: components["schemas"]["MetaEditorView"];
js?: string;
elementName?: string;
alias: string;
name: string;
/** Format: float */
weight?: number;
};
MetaTreeItemAction: {
trees: string[];
label: string;
icon: string;
};
IManifestTreeItemAction: {
/** @enum {string} */
type: "treeItemAction";
meta: components["schemas"]["MetaTreeItemAction"];
js?: string;
elementName?: string;
alias: string;
name: string;
/** Format: float */
weight?: number;
};
PropertyEditorConfigProperty: {
label: string;
description?: string;
alias: string;
propertyEditorUI: string;
};
PropertyEditorConfigDefaultData: {
alias: string;
value:
| (
| string
| number
| boolean
| { [key: string]: unknown }
| string[]
| number[]
| boolean[]
| { [key: string]: unknown }[]
)
| null;
};
PropertyEditorConfig: {
properties: components["schemas"]["PropertyEditorConfigProperty"][];
defaultData?: components["schemas"]["PropertyEditorConfigDefaultData"][];
};
MetaPropertyEditorUI: {
label: string;
propertyEditor: string;
icon: string;
group: string;
config?: components["schemas"]["PropertyEditorConfig"];
};
IManifestPropertyEditorUI: {
/** @enum {string} */
type: "propertyEditorUI";
meta: components["schemas"]["MetaPropertyEditorUI"];
js?: string;
elementName?: string;
alias: string;
name: string;
/** Format: float */
weight?: number;
};
MetaDashboard: {
sections: string[];
pathname: string;
label?: string;
};
IManifestDashboard: {
/** @enum {string} */
type: "dashboard";
meta: components["schemas"]["MetaDashboard"];
js?: string;
elementName?: string;
alias: string;
name: string;
/** Format: float */
weight?: number;
};
MetaPropertyAction: {
propertyEditors: string[];
};
IManifestPropertyAction: {
/** @enum {string} */
type: "propertyAction";
meta: components["schemas"]["MetaPropertyAction"];
js?: string;
elementName?: string;
alias: string;
name: string;
/** Format: float */
weight?: number;
};
MetaPackageView: {
packageAlias: string;
};
IManifestPackageView: {
/** @enum {string} */
type: "packageView";
meta: components["schemas"]["MetaPackageView"];
js?: string;
elementName?: string;
alias: string;
name: string;
/** Format: float */
weight?: number;
};
IManifestEntrypoint: {
/** @enum {string} */
type: "entrypoint";
js: string;
alias: string;
name: string;
/** Format: float */
weight?: number;
};
IManifestCustom: {
/** @enum {string} */
type: "custom";
meta?: { [key: string]: unknown };
alias: string;
name: string;
/** Format: float */
weight?: number;
};
Manifest:
| components["schemas"]["IManifestSection"]
| components["schemas"]["IManifestSectionView"]
| components["schemas"]["IManifestTree"]
| components["schemas"]["IManifestEditor"]
| components["schemas"]["IManifestEditorAction"]
| components["schemas"]["IManifestEditorView"]
| components["schemas"]["IManifestTreeItemAction"]
| components["schemas"]["IManifestPropertyEditorUI"]
| components["schemas"]["IManifestDashboard"]
| components["schemas"]["IManifestPropertyAction"]
| components["schemas"]["IManifestPackageView"]
| components["schemas"]["IManifestEntrypoint"]
| components["schemas"]["IManifestCustom"];
ManifestsResponse: {
manifests: components["schemas"]["Manifest"][];
manifests: { [key: string]: unknown }[];
};
PackageInstalled: {
id: string;
@@ -382,31 +145,6 @@ export interface components {
ManifestsPackagesInstalledResponse: {
packages: components["schemas"]["PackageInstalled"][];
};
PropertyEditor: {
alias: string;
name: string;
icon: string;
group?: string;
isSystem: boolean;
hasConfig: boolean;
config?: components["schemas"]["PropertyEditorConfig"];
};
PropertyEditorsListResponse: {
propertyEditors: components["schemas"]["PropertyEditor"][];
};
PropertyEditorResponse: {
alias: string;
name: string;
icon: string;
group?: string;
isSystem: boolean;
hasConfig: boolean;
config?: components["schemas"]["PropertyEditorConfig"];
};
PropertyEditorConfigResponse: {
properties: components["schemas"]["PropertyEditorConfigProperty"][];
defaultData?: components["schemas"]["PropertyEditorConfigDefaultData"][];
};
/** @enum {string} */
ServerStatus: "running" | "must-install" | "must-upgrade";
StatusResponse: {
@@ -541,64 +279,6 @@ export interface operations {
};
};
};
PropertyEditorsListEndpoint: {
responses: {
/** 200 response */
200: {
content: {
"application/json": components["schemas"]["PropertyEditorsListResponse"];
};
};
/** default response */
default: {
content: {
"application/json": components["schemas"]["ProblemDetails"];
};
};
};
};
PropertyEditorEndpoint: {
parameters: {
path: {
propertyEditorAlias: string;
};
};
responses: {
/** 200 response */
200: {
content: {
"application/json": components["schemas"]["PropertyEditorResponse"];
};
};
/** default response */
default: {
content: {
"application/json": components["schemas"]["ProblemDetails"];
};
};
};
};
PropertyEditorConfigEndpoint: {
parameters: {
path: {
propertyEditorAlias: string;
};
};
responses: {
/** 200 response */
200: {
content: {
"application/json": components["schemas"]["PropertyEditorConfigResponse"];
};
};
/** default response */
default: {
content: {
"application/json": components["schemas"]["ProblemDetails"];
};
};
};
};
PublishedCacheStatus: {
responses: {
/** 200 response */

View File

@@ -24,11 +24,10 @@ import { UmbNodeStore } from '../core/stores/node.store';
import { UmbSectionStore } from '../core/stores/section.store';
import { UmbEntityStore } from '../core/stores/entity.store';
import { UmbUserStore } from '../core/stores/user/user.store';
import { UmbPropertyEditorStore } from '../core/stores/property-editor/property-editor.store';
import { UmbIconStore } from '../core/stores/icon/icon.store';
import { UmbPropertyEditorConfigStore } from '../core/stores/property-editor-config/property-editor-config.store';
import { UmbUserGroupStore } from '../core/stores/user/user-group.store';
import { manifests as sectionManifests } from './sections/manifests';
import { manifests as propertyEditorModelManifests } from './property-editor-models/manifests';
import { manifests as propertyEditorUIManifests } from './property-editor-uis/manifests';
import { manifests as treeManifests } from './trees/manifests';
import { manifests as editorManifests } from './editors/manifests';
@@ -63,6 +62,7 @@ export class UmbBackofficeElement extends UmbContextConsumerMixin(UmbContextProv
this._registerExtensions(sectionManifests);
this._registerExtensions(treeManifests);
this._registerExtensions(editorManifests);
this._registerExtensions(propertyEditorModelManifests);
this._registerExtensions(propertyEditorUIManifests);
this._registerExtensions(propertyActionManifests);
@@ -74,8 +74,6 @@ export class UmbBackofficeElement extends UmbContextConsumerMixin(UmbContextProv
this.provideContext('umbDocumentTypeStore', new UmbDocumentTypeStore(this._umbEntityStore));
this.provideContext('umbUserStore', new UmbUserStore(this._umbEntityStore));
this.provideContext('umbUserGroupStore', new UmbUserGroupStore(this._umbEntityStore));
this.provideContext('umbPropertyEditorStore', new UmbPropertyEditorStore());
this.provideContext('umbPropertyEditorConfigStore', new UmbPropertyEditorConfigStore());
this.provideContext('umbNotificationService', new UmbNotificationService());
this.provideContext('umbModalService', new UmbModalService());
this.provideContext('umbSectionStore', new UmbSectionStore());

View File

@@ -0,0 +1,254 @@
import type { ManifestPropertyEditorModel } from '@umbraco-cms/models';
export const manifests: Array<ManifestPropertyEditorModel> = [
{
type: 'propertyEditorModel',
name: 'Color Picker',
alias: 'Umbraco.ColorPicker',
meta: {},
},
{
type: 'propertyEditorModel',
name: 'Content Picker',
alias: 'Umbraco.ContentPicker',
meta: {},
},
{
type: 'propertyEditorModel',
name: 'Eye Dropper Color Picker',
alias: 'Umbraco.ColorPicker.EyeDropper',
meta: {},
},
{
type: 'propertyEditorModel',
name: 'Form Picker',
alias: 'UmbracoForms.FormPicker',
meta: {},
},
{
type: 'propertyEditorModel',
name: 'Form Theme Picker',
alias: 'UmbracoForms.ThemePicker',
meta: {},
},
{
type: 'propertyEditorModel',
name: 'Multi URL Picker',
alias: 'Umbraco.MultiUrlPicker',
meta: {},
},
{
type: 'propertyEditorModel',
name: 'Multinode Treepicker',
alias: 'Umbraco.MultiNodeTreePicker',
meta: {},
},
{
type: 'propertyEditorModel',
name: 'Date/Time',
alias: 'Umbraco.DateTime',
meta: {},
},
{
type: 'propertyEditorModel',
name: 'Decimal',
alias: 'Umbraco.Decimal',
meta: {},
},
{
type: 'propertyEditorModel',
name: 'Email address',
alias: 'Umbraco.EmailAddress',
meta: {},
},
{
type: 'propertyEditorModel',
name: 'Label',
alias: 'Umbraco.Label',
meta: {},
},
{
type: 'propertyEditorModel',
name: 'Numeric',
alias: 'Umbraco.Integer',
meta: {},
},
{
type: 'propertyEditorModel',
name: 'Slider',
alias: 'Umbraco.Slider',
meta: {},
},
{
type: 'propertyEditorModel',
name: 'Tags',
alias: 'Umbraco.Tags',
meta: {},
},
{
type: 'propertyEditorModel',
name: 'Textarea',
alias: 'Umbraco.TextArea',
meta: {
config: {
properties: [
{
alias: 'maxChars',
label: 'Maximum allowed characters',
description: 'If empty - no character limit',
propertyEditorUI: 'Umb.PropertyEditorUI.Number',
},
],
},
},
},
{
type: 'propertyEditorModel',
name: 'Textbox',
alias: 'Umbraco.TextBox',
meta: {
config: {
properties: [
{
alias: 'maxChars',
label: 'Maximum allowed characters',
description: 'If empty, 512 character limit',
propertyEditorUI: 'Umb.PropertyEditorUI.Number',
},
],
defaultData: [
{
alias: 'maxChars',
value: 512,
},
],
},
},
},
{
type: 'propertyEditorModel',
name: 'Toggle',
alias: 'Umbraco.TrueFalse',
meta: {},
},
{
type: 'propertyEditorModel',
name: 'Grid layout',
alias: 'Umbraco.Grid',
meta: {},
},
{
type: 'propertyEditorModel',
name: 'Markdown editor',
alias: 'Umbraco.MarkdownEditor',
meta: {},
},
{
type: 'propertyEditorModel',
name: 'Rich Text Editor',
alias: 'Umbraco.TinyMCE',
meta: {},
},
{
type: 'propertyEditorModel',
name: 'Member Group Picker',
alias: 'Umbraco.MemberGroupPicker',
meta: {},
},
{
type: 'propertyEditorModel',
name: 'Member Picker',
alias: 'Umbraco.MemberPicker',
meta: {},
},
{
type: 'propertyEditorModel',
name: 'User Picker',
alias: 'Umbraco.UserPicker',
meta: {},
},
{
type: 'propertyEditorModel',
name: 'Block Grid',
alias: 'Umbraco.BlockGrid',
meta: {},
},
{
type: 'propertyEditorModel',
name: 'Block List',
alias: 'Umbraco.BlockList',
meta: {},
},
{
type: 'propertyEditorModel',
name: 'Checkbox list',
alias: 'Umbraco.CheckBoxList',
meta: {},
},
{
type: 'propertyEditorModel',
name: 'Dropdown',
alias: 'Umbraco.DropDown.Flexible',
meta: {},
},
{
type: 'propertyEditorModel',
name: 'List view',
alias: 'Umbraco.ListView',
meta: {},
},
{
type: 'propertyEditorModel',
name: 'Nested Content',
alias: 'Umbraco.NestedContent',
meta: {},
},
{
type: 'propertyEditorModel',
name: 'Radio button list',
alias: 'Umbraco.RadioButtonList',
meta: {},
},
{
type: 'propertyEditorModel',
name: 'Repeatable textstrings',
alias: 'Umbraco.MultipleTextstring',
meta: {},
},
{
type: 'propertyEditorModel',
name: 'File upload',
alias: 'Umbraco.UploadField',
meta: {},
},
{
type: 'propertyEditorModel',
name: 'Image Cropper',
alias: 'Umbraco.ImageCropper',
meta: {},
},
{
type: 'propertyEditorModel',
name: 'Media Picker',
alias: 'Umbraco.MediaPicker3',
meta: {},
},
{
type: 'propertyEditorModel',
name: 'Media Picker (legacy)',
alias: 'Umbraco.MediaPicker',
meta: {},
},
{
type: 'propertyEditorModel',
name: 'Custom Property Editor',
alias: 'Umbraco.Custom',
meta: {},
},
{
type: 'propertyEditorModel',
name: 'Icon Picker',
alias: 'Umbraco.IconPicker',
meta: {},
},
];

View File

@@ -10,7 +10,7 @@ export const manifests: Array<ManifestWithLoader<ManifestPropertyEditorUI>> = [
label: 'Block List',
icon: 'umb:thumbnail-list',
group: 'Lists',
propertyEditor: 'Umbraco.BlockList',
propertyEditorModel: 'Umbraco.BlockList',
},
},
{
@@ -22,7 +22,7 @@ export const manifests: Array<ManifestWithLoader<ManifestPropertyEditorUI>> = [
label: 'Toggle',
icon: 'umb:checkbox',
group: 'Common',
propertyEditor: 'Umbraco.TrueFalse',
propertyEditorModel: 'Umbraco.TrueFalse',
},
},
{
@@ -34,7 +34,7 @@ export const manifests: Array<ManifestWithLoader<ManifestPropertyEditorUI>> = [
label: 'Checkbox List',
icon: 'umb:bulleted-list',
group: 'Lists',
propertyEditor: 'Umbraco.CheckBoxList',
propertyEditorModel: 'Umbraco.CheckBoxList',
},
},
{
@@ -46,7 +46,7 @@ export const manifests: Array<ManifestWithLoader<ManifestPropertyEditorUI>> = [
label: 'Text',
icon: 'umb:edit',
group: 'Common',
propertyEditor: 'Umbraco.TextBox',
propertyEditorModel: 'Umbraco.TextBox',
},
},
{
@@ -58,7 +58,7 @@ export const manifests: Array<ManifestWithLoader<ManifestPropertyEditorUI>> = [
label: 'Textarea',
icon: 'umb:edit',
group: 'Common',
propertyEditor: 'Umbraco.TextArea',
propertyEditorModel: 'Umbraco.TextArea',
config: {
properties: [
{
@@ -80,7 +80,7 @@ export const manifests: Array<ManifestWithLoader<ManifestPropertyEditorUI>> = [
label: 'Number',
icon: 'umb:autofill',
group: 'Common',
propertyEditor: 'Umbraco.Integer',
propertyEditorModel: 'Umbraco.Integer',
},
},
{
@@ -90,7 +90,7 @@ export const manifests: Array<ManifestWithLoader<ManifestPropertyEditorUI>> = [
loader: () => import('./content-picker/property-editor-ui-content-picker.element'),
meta: {
label: 'Content Picker',
propertyEditor: 'Umbraco.ContentPicker',
propertyEditorModel: 'Umbraco.ContentPicker',
icon: 'umb:document',
group: 'Common',
},
@@ -102,7 +102,7 @@ export const manifests: Array<ManifestWithLoader<ManifestPropertyEditorUI>> = [
loader: () => import('./icon-picker/property-editor-ui-icon-picker.element'),
meta: {
label: 'Icon Picker',
propertyEditor: 'Umbraco.IconPicker',
propertyEditorModel: 'Umbraco.IconPicker',
icon: 'umb:document',
group: 'Common',
},

View File

@@ -25,16 +25,6 @@ export const getConsentLevels = fetcher.path('/telemetry/ConsentLevels').method(
export const getConsentLevel = fetcher.path('/telemetry/ConsentLevel').method('get').create();
export const postConsentLevel = fetcher.path('/telemetry/ConsentLevel').method('post').create();
// Property Editors
export const getPropertyEditorsList = fetcher.path('/property-editors/list').method('get').create();
export const getPropertyEditor = fetcher
.path('/property-editors/property-editor/{propertyEditorAlias}')
.method('get')
.create();
export const getPropertyEditorConfig = fetcher
.path('/property-editors/property-editor/config/{propertyEditorAlias}')
.method('get')
.create();
export const getPublishedCacheStatus = fetcher.path('/published-cache/status').method('get').create();
export const postPublishedCacheReload = fetcher.path('/published-cache/reload').method('post').create();
export const postPublishedCacheRebuild = fetcher.path('/published-cache/rebuild').method('post').create();

View File

@@ -0,0 +1,12 @@
import type { ManifestElement } from './models';
export interface ManifestDashboard extends ManifestElement {
type: 'dashboard';
meta: MetaDashboard;
}
export interface MetaDashboard {
sections: string[];
pathname: string;
label?: string;
}

View File

@@ -0,0 +1,10 @@
import type { ManifestElement } from './models';
export interface ManifestEditorAction extends ManifestElement {
type: 'editorAction';
meta: MetaEditorAction;
}
export interface MetaEditorAction {
editors: Array<string>;
}

View File

@@ -0,0 +1,13 @@
import type { ManifestElement } from './models';
export interface ManifestEditorView extends ManifestElement {
type: 'editorView';
meta: MetaEditorView;
}
export interface MetaEditorView {
editors: string[];
pathname: string;
label: string;
icon: string;
}

View File

@@ -0,0 +1,10 @@
import type { ManifestElement } from './models';
export interface ManifestEditor extends ManifestElement {
type: 'editor';
meta: MetaEditor;
}
export interface MetaEditor {
entityType: string;
}

View File

@@ -1,3 +1,4 @@
import { UmbExtensionRegistry } from '@umbraco-cms/extensions-api';
export * from './models';
export const umbExtensionsRegistry = new UmbExtensionRegistry();

View File

@@ -0,0 +1,91 @@
import type { ManifestSection } from './section.models';
import type { ManifestSectionView } from './section-view.models';
import type { ManifestTree } from './tree.models';
import type { ManifestTreeItemAction } from './tree-item-action.models';
import type { ManifestEditor } from './editor.models';
import type { ManifestEditorAction } from './editor-action.models';
import type { ManifestEditorView } from './editor-view.models';
import type { ManifestPropertyEditorUI, ManifestPropertyEditorModel } from './property-editor.models';
import type { ManifestDashboard } from './dashboard.models';
import type { ManifestPropertyAction } from './property-action.models';
import type { ManifestPackageView } from './package-view.models';
export * from './section.models';
export * from './section-view.models';
export * from './tree.models';
export * from './tree-item-action.models';
export * from './editor.models';
export * from './editor-action.models';
export * from './editor-view.models';
export * from './property-editor.models';
export * from './dashboard.models';
export * from './property-action.models';
export * from './package-view.models';
export type Manifest =
| ManifestSection
| ManifestSectionView
| ManifestTree
| ManifestEditor
| ManifestEditorAction
| ManifestEditorView
| ManifestTreeItemAction
| ManifestPropertyEditorUI
| ManifestPropertyEditorModel
| ManifestDashboard
| ManifestPropertyAction
| ManifestPackageView
| ManifestEntrypoint
| ManifestCustom;
export type ManifestStandardTypes =
| 'section'
| 'sectionView'
| 'tree'
| 'editor'
| 'editorView'
| 'editorAction'
| 'treeItemAction'
| 'propertyEditorUI'
| 'propertyEditorModel'
| 'dashboard'
| 'propertyAction'
| 'packageView'
| 'entrypoint';
export type ManifestElementType =
| ManifestSection
| ManifestSectionView
| ManifestTree
| ManifestTreeItemAction
| ManifestEditor
| ManifestPropertyAction
| ManifestPropertyEditorUI
| ManifestDashboard
| ManifestEditorView
| ManifestEditorAction
| ManifestPackageView;
export interface ManifestBase {
type: string;
alias: string;
name: string;
weight?: number;
}
export interface ManifestElement extends ManifestBase {
type: ManifestStandardTypes;
js?: string;
elementName?: string;
meta?: any;
}
export interface ManifestCustom extends ManifestBase {
type: 'custom';
meta?: any;
}
export interface ManifestEntrypoint extends ManifestBase {
type: 'entrypoint';
js: string;
}

View File

@@ -0,0 +1,10 @@
import type { ManifestElement } from './models';
export interface ManifestPackageView extends ManifestElement {
type: 'packageView';
meta: MetaPackageView;
}
export interface MetaPackageView {
packageAlias: string;
}

View File

@@ -0,0 +1,10 @@
import type { ManifestElement } from './models';
export interface ManifestPropertyAction extends ManifestElement {
type: 'propertyAction';
meta: MetaPropertyAction;
}
export interface MetaPropertyAction {
propertyEditors: string[];
}

View File

@@ -0,0 +1,43 @@
import type { ManifestElement, ManifestBase } from './models';
// UI
export interface ManifestPropertyEditorUI extends ManifestElement {
type: 'propertyEditorUI';
meta: MetaPropertyEditorUI;
}
export interface MetaPropertyEditorUI {
label: string;
propertyEditorModel: string;
icon: string;
group: string;
config?: PropertyEditorConfig;
}
// Model
export interface ManifestPropertyEditorModel extends ManifestBase {
type: 'propertyEditorModel';
meta: MetaPropertyEditorModel;
}
export interface MetaPropertyEditorModel {
config?: PropertyEditorConfig;
}
// Config
export interface PropertyEditorConfig {
properties: PropertyEditorConfigProperty[];
defaultData?: PropertyEditorConfigDefaultData[];
}
export interface PropertyEditorConfigProperty {
label: string;
description?: string;
alias: string;
propertyEditorUI: string;
}
export interface PropertyEditorConfigDefaultData {
alias: string;
value: any;
}

View File

@@ -0,0 +1,14 @@
import type { ManifestElement } from './models';
export interface ManifestSectionView extends ManifestElement {
type: 'sectionView';
meta: MetaSectionView;
}
export interface MetaSectionView {
sections: Array<string>;
label: string;
pathname: string;
weight: number;
icon: string;
}

View File

@@ -0,0 +1,11 @@
import type { ManifestElement } from './models';
export interface ManifestSection extends ManifestElement {
type: 'section';
meta: MetaSection;
}
export interface MetaSection {
label: string;
pathname: string;
}

View File

@@ -0,0 +1,12 @@
import type { ManifestElement } from './models';
export interface ManifestTreeItemAction extends ManifestElement {
type: 'treeItemAction';
meta: MetaTreeItemAction;
}
export interface MetaTreeItemAction {
trees: Array<string>;
label: string;
icon: string;
}

View File

@@ -0,0 +1,10 @@
import type { ManifestElement } from './models';
export interface ManifestTree extends ManifestElement {
type: 'tree';
meta: MetaTree;
}
export interface MetaTree {
sections: Array<string>;
}

View File

@@ -9,7 +9,6 @@ import * as serverHandlers from './domains/server.handlers';
import { handlers as upgradeHandlers } from './domains/upgrade.handlers';
import { handlers as userHandlers } from './domains/user.handlers';
import { handlers as telemetryHandlers } from './domains/telemetry.handlers';
import { handlers as propertyEditorHandlers } from './domains/property-editor.handlers';
import { handlers as usersHandlers } from './domains/users.handlers';
import { handlers as userGroupsHandlers } from './domains/user-groups.handlers';
@@ -22,7 +21,6 @@ const handlers = [
...dataTypeHandlers,
...documentTypeHandlers,
...treeHandlers,
...propertyEditorHandlers,
...manifestsHandlers.default,
...telemetryHandlers,
...publishedStatusHandlers,

View File

@@ -1,363 +0,0 @@
import { cloneDeep } from 'lodash';
import { UmbData } from './data';
import type { PropertyEditor } from '@umbraco-cms/models';
export const data: Array<PropertyEditor> = [
{
isSystem: false,
group: 'Pickers',
hasConfig: true,
name: 'Color Picker',
icon: 'umb:colorpicker',
alias: 'Umbraco.ColorPicker',
},
{
isSystem: false,
group: 'Pickers',
hasConfig: true,
name: 'Content Picker',
icon: 'umb:autofill',
alias: 'Umbraco.ContentPicker',
},
{
isSystem: false,
group: 'Pickers',
hasConfig: true,
name: 'Eye Dropper Color Picker',
icon: 'umb:colorpicker',
alias: 'Umbraco.ColorPicker.EyeDropper',
},
{
isSystem: false,
group: 'Pickers',
hasConfig: true,
name: 'Form Picker',
icon: 'umb:umb-contour',
alias: 'UmbracoForms.FormPicker',
},
{
isSystem: false,
group: 'Pickers',
hasConfig: false,
name: 'Form Theme Picker',
icon: 'umb:brush',
alias: 'UmbracoForms.ThemePicker',
},
{
isSystem: false,
group: 'Pickers',
hasConfig: true,
name: 'Multi URL Picker',
icon: 'umb:link',
alias: 'Umbraco.MultiUrlPicker',
},
{
isSystem: false,
group: 'Pickers',
hasConfig: true,
name: 'Multinode Treepicker',
icon: 'umb:page-add',
alias: 'Umbraco.MultiNodeTreePicker',
},
{
isSystem: false,
group: 'Common',
hasConfig: true,
name: 'Date/Time',
icon: 'umb:time',
alias: 'Umbraco.DateTime',
},
{
isSystem: false,
group: 'Common',
hasConfig: true,
name: 'Decimal',
icon: 'umb:autofill',
alias: 'Umbraco.Decimal',
},
{
isSystem: false,
group: 'Common',
hasConfig: true,
name: 'Email address',
icon: 'umb:message',
alias: 'Umbraco.EmailAddress',
},
{
isSystem: false,
group: 'Common',
hasConfig: true,
name: 'Label',
icon: 'umb:readonly',
alias: 'Umbraco.Label',
},
{
isSystem: false,
group: 'Common',
hasConfig: true,
name: 'Numeric',
icon: 'umb:autofill',
alias: 'Umbraco.Integer',
},
{
isSystem: false,
group: 'Common',
hasConfig: true,
name: 'Open Street Map',
icon: 'umb:map-location',
alias: 'Bergmania.OpenStreetMap',
},
{
isSystem: false,
group: 'Common',
hasConfig: true,
name: 'Slider',
icon: 'umb:navigation-horizontal',
alias: 'Umbraco.Slider',
},
{
isSystem: false,
group: 'Common',
hasConfig: true,
name: 'Tags',
icon: 'umb:tags',
alias: 'Umbraco.Tags',
},
{
isSystem: false,
group: 'Common',
hasConfig: true,
name: 'Textarea',
icon: 'umb:application-window-alt',
alias: 'Umbraco.TextArea',
config: {
properties: [
{
alias: 'maxChars',
label: 'Maximum allowed characters',
description: 'If empty - no character limit',
propertyEditorUI: 'Umb.PropertyEditorUI.Number',
},
],
},
},
{
isSystem: false,
group: 'Common',
hasConfig: true,
name: 'Textbox',
icon: 'umb:autofill',
alias: 'Umbraco.TextBox',
config: {
properties: [
{
alias: 'maxChars',
label: 'Maximum allowed characters',
description: 'If empty, 512 character limit',
propertyEditorUI: 'Umb.PropertyEditorUI.Number',
},
],
defaultData: [
{
alias: 'maxChars',
value: 512,
},
],
},
},
{
isSystem: false,
group: 'Common',
hasConfig: true,
name: 'Toggle',
icon: 'umb:checkbox',
alias: 'Umbraco.TrueFalse',
},
{
isSystem: false,
group: 'Rich Content',
hasConfig: true,
name: 'Grid layout',
icon: 'umb:layout',
alias: 'Umbraco.Grid',
},
{
isSystem: false,
group: 'Rich Content',
hasConfig: true,
name: 'Markdown editor',
icon: 'umb:code',
alias: 'Umbraco.MarkdownEditor',
},
{
isSystem: false,
group: 'Rich Content',
hasConfig: true,
name: 'Rich Text Editor',
icon: 'umb:browser-window',
alias: 'Umbraco.TinyMCE',
},
{
isSystem: false,
group: 'People',
hasConfig: false,
name: 'Member Group Picker',
icon: 'umb:users-alt',
alias: 'Umbraco.MemberGroupPicker',
},
{
isSystem: false,
group: 'People',
hasConfig: false,
name: 'Member Picker',
icon: 'umb:user',
alias: 'Umbraco.MemberPicker',
},
{
isSystem: false,
group: 'People',
hasConfig: false,
name: 'User Picker',
icon: 'umb:user',
alias: 'Umbraco.UserPicker',
},
{
isSystem: false,
group: 'Lists',
hasConfig: true,
name: 'Block Grid',
icon: 'umb:thumbnail-list',
alias: 'Umbraco.BlockGrid',
},
{
isSystem: false,
group: 'Lists',
hasConfig: true,
name: 'Block List',
icon: 'umb:thumbnail-list',
alias: 'Umbraco.BlockList',
},
{
isSystem: false,
group: 'Lists',
hasConfig: true,
name: 'Checkbox list',
icon: 'umb:bulleted-list',
alias: 'Umbraco.CheckBoxList',
},
{
isSystem: false,
group: 'Lists',
hasConfig: true,
name: 'Dropdown',
icon: 'umb:indent',
alias: 'Umbraco.DropDown.Flexible',
},
{
isSystem: false,
group: 'Lists',
hasConfig: true,
name: 'List view',
icon: 'umb:thumbnail-list',
alias: 'Umbraco.ListView',
},
{
isSystem: false,
group: 'Lists',
hasConfig: true,
name: 'Nested Content',
icon: 'umb:thumbnail-list',
alias: 'Umbraco.NestedContent',
},
{
isSystem: false,
group: 'Lists',
hasConfig: true,
name: 'Radio button list',
icon: 'umb:target',
alias: 'Umbraco.RadioButtonList',
},
{
isSystem: false,
group: 'Lists',
hasConfig: true,
name: 'Repeatable textstrings',
icon: 'umb:ordered-list',
alias: 'Umbraco.MultipleTextstring',
},
{
isSystem: false,
group: 'Media',
hasConfig: true,
name: 'File upload',
icon: 'umb:download-alt',
alias: 'Umbraco.UploadField',
},
{
isSystem: false,
group: 'Media',
hasConfig: true,
name: 'Image Cropper',
icon: 'umb:crop',
alias: 'Umbraco.ImageCropper',
},
{
isSystem: false,
group: 'Media',
hasConfig: true,
name: 'Media Picker',
icon: 'umb:picture',
alias: 'Umbraco.MediaPicker3',
},
{
isSystem: false,
group: 'Media',
hasConfig: true,
name: 'Media Picker (legacy)',
icon: 'umb:picture',
alias: 'Umbraco.MediaPicker',
},
{
isSystem: false,
group: 'Custom',
hasConfig: true,
name: 'Custom Property Editor',
icon: 'umb:autofill',
alias: 'Umbraco.Custom',
},
{
isSystem: false,
group: 'Custom',
hasConfig: true,
name: 'Icon Picker',
icon: 'umb:autofill',
alias: 'Umbraco.IconPicker',
},
];
// Temp mocked database
class UmbPropertyEditorData extends UmbData<PropertyEditor> {
constructor() {
super(data);
}
getAll() {
const clonedEditors = cloneDeep(this.data);
clonedEditors.forEach((editor) => delete editor.config);
return clonedEditors;
}
getByAlias(alias: string) {
const editor = this.data.find((e) => e.alias === alias);
const clone = cloneDeep(editor);
delete clone?.config;
return clone;
}
getConfig(alias: string) {
const editor = this.data.find((e) => e.alias === alias);
return editor?.config ?? undefined;
}
}
export const umbPropertyEditorData = new UmbPropertyEditorData();

View File

@@ -1,43 +0,0 @@
import { rest } from 'msw';
import { umbPropertyEditorData } from '../data/property-editor.data';
import { umbracoPath } from '@umbraco-cms/utils';
import type {
PropertyEditorsListResponse,
PropertyEditorResponse,
PropertyEditorConfigResponse,
} from '@umbraco-cms/models';
// TODO: add schema
export const handlers = [
rest.get(umbracoPath('/property-editors/list'), (req, res, ctx) => {
const propertyEditors = umbPropertyEditorData.getAll();
const response = {
propertyEditors,
};
return res(ctx.status(200), ctx.json<PropertyEditorsListResponse>(response));
}),
rest.get('/umbraco/backoffice/property-editors/property-editor/:alias', (req, res, ctx) => {
const alias = req.params.alias as string;
if (!alias) return;
const propertyEditor = umbPropertyEditorData.getByAlias(alias);
if (propertyEditor) {
return res(ctx.status(200), ctx.json<PropertyEditorResponse>(propertyEditor));
} else {
return res(ctx.status(404));
}
}),
rest.get('/umbraco/backoffice/property-editors/property-editor/config/:alias', (req, res, ctx) => {
const alias = req.params.alias as string;
if (!alias) return;
const config = umbPropertyEditorData.getConfig(alias);
if (!config) return;
return res(ctx.status(200), ctx.json<PropertyEditorConfigResponse>(config));
}),
];

View File

@@ -19,44 +19,11 @@ export type UmbracoInstallerDatabaseModel = components['schemas']['InstallDataba
export type UmbracoInstallerUserModel = components['schemas']['InstallUserModel'];
export type TelemetryModel = components['schemas']['TelemetryModel'];
export type ServerStatus = components['schemas']['ServerStatus'];
export type ManifestTypes = components['schemas']['Manifest'];
export type ManifestSection = components['schemas']['IManifestSection'];
export type ManifestSectionView = components['schemas']['IManifestSectionView'];
export type ManifestTree = components['schemas']['IManifestTree'];
export type ManifestTreeItemAction = components['schemas']['IManifestTreeItemAction'];
export type ManifestEditor = components['schemas']['IManifestEditor'];
export type ManifestEditorAction = components['schemas']['IManifestEditorAction'];
export type ManifestPropertyEditorUI = components['schemas']['IManifestPropertyEditorUI'];
export type ManifestDashboard = components['schemas']['IManifestDashboard'];
export type ManifestEditorView = components['schemas']['IManifestEditorView'];
export type ManifestPropertyAction = components['schemas']['IManifestPropertyAction'];
export type ManifestEntrypoint = components['schemas']['IManifestEntrypoint'];
export type ManifestCustom = components['schemas']['IManifestCustom'];
export type ManifestPackageView = components['schemas']['IManifestPackageView'];
export type PackageInstalled = components['schemas']['PackageInstalled'];
export type ConsentLevelSettings = components['schemas']['ConsentLevelSettings'];
// Property Editors
export type PropertyEditorsListResponse = components['schemas']['PropertyEditorsListResponse'];
export type PropertyEditorResponse = components['schemas']['PropertyEditorResponse'];
export type PropertyEditorConfigResponse = components['schemas']['PropertyEditorConfigResponse'];
export type PropertyEditorConfig = components['schemas']['PropertyEditorConfig'];
export type PropertyEditor = components['schemas']['PropertyEditor'];
export type PropertyEditorConfigProperty = components['schemas']['PropertyEditorConfigProperty'];
export type PropertyEditorConfigDefaultData = components['schemas']['PropertyEditorConfigDefaultData'];
export type ManifestElementType =
| ManifestSection
| ManifestSectionView
| ManifestTree
| ManifestTreeItemAction
| ManifestEditor
| ManifestPropertyAction
| ManifestPropertyEditorUI
| ManifestDashboard
| ManifestEditorView
| ManifestEditorAction
| ManifestPackageView;
// Extension Manifests
export * from '../extensions-registry/models';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export type HTMLElementConstructor<T = HTMLElement> = new (...args: any[]) => T;

View File

@@ -1,38 +0,0 @@
import { map, Observable } from 'rxjs';
import { getPropertyEditorConfig } from '../../backend-api/fetcher';
import type { PropertyEditorConfig } from '../../models';
import { UmbDataStoreBase } from '../store';
export interface PropertyEditorConfigRef {
propertyEditorAlias: string;
config: PropertyEditorConfig;
}
/**
* @export
* @class UmbPropertyEditorConfigStore
* @extends {UmbDataStoreBase<PropertyEditorConfigRef>}
* @description - Data Store for Property Editor Configs
*/
export class UmbPropertyEditorConfigStore extends UmbDataStoreBase<PropertyEditorConfigRef> {
/**
*
* @description - Request a Property Editor Config by alias. The Property Editor Config is added to the store and is returned as an Observable.
* @param {string} alias
* @return {*} {(Observable<PropertyEditorConfigRef | undefined>)}
* @memberof UmbPropertyEditorConfigStore
*/
getByAlias(alias: string): Observable<PropertyEditorConfigRef | undefined> {
// TODO: only fetch if the data type is not in the store?
getPropertyEditorConfig({ propertyEditorAlias: alias })
.then((res) => {
const propertyEditorConfigRef: PropertyEditorConfigRef = { propertyEditorAlias: alias, config: res.data };
this.update([propertyEditorConfigRef], 'propertyEditorAlias');
})
.catch((err) => {
console.log(err);
});
return this.items.pipe(map((items) => items.find((item) => item.propertyEditorAlias === alias)));
}
}

View File

@@ -1,49 +0,0 @@
import { map, Observable } from 'rxjs';
import type { PropertyEditor } from '../../models';
import { getPropertyEditorsList, getPropertyEditor } from '../../backend-api/fetcher';
import { UmbDataStoreBase } from '../store';
/**
* @export
* @class UmbPropertyEditorStore
* @extends {UmbDataStoreBase<PropertyEditor>}
* @description - Data Store for Property Editors
*/
export class UmbPropertyEditorStore extends UmbDataStoreBase<PropertyEditor> {
/**
* @description - Request all Property Editors. The Property Editors are added to the store and are returned as an Observable.
* @return {*} {(Observable<Array<PropertyEditor> | []>)}
* @memberof UmbPropertyEditorStore
*/
getAll(): Observable<Array<PropertyEditor> | []> {
// TODO: only fetch if the data type is not in the store?
getPropertyEditorsList({})
.then((res) => {
this.update(res.data.propertyEditors, 'alias');
})
.catch((err) => {
console.log(err);
});
return this.items;
}
/**
* Request a Property Editor by alias. The Property Editor is added to the store and is returned as an Observable.
* @param {string} alias
* @return {*} {(Observable<PropertyEditor | undefined>)}
* @memberof UmbPropertyEditorStore
*/
getByAlias(alias: string): Observable<PropertyEditor | undefined> {
// TODO: only fetch if the data type is not in the store?
getPropertyEditor({ propertyEditorAlias: alias })
.then((res) => {
this.update([res.data], 'alias');
})
.catch((err) => {
console.log(err);
});
return this.items.pipe(map((items) => items.find((item) => item.alias === alias)));
}
}

View File

@@ -5,7 +5,6 @@ import './server';
import './upgrader';
import './user';
import './telemetry';
import './property-editors';
import { api } from '@airtasker/spot';

View File

@@ -1,7 +1,5 @@
import { body, defaultResponse, endpoint, response } from '@airtasker/spot';
import { ProblemDetails } from './models';
import { PropertyEditorConfig } from './property-editors';
@endpoint({ method: 'GET', path: '/manifests' })
export class Manifests {
@@ -30,37 +28,8 @@ export class ManifestsPackagesInstalled {
default(@body body: ProblemDetails) {}
}
export type Manifest =
| IManifestSection
| IManifestSectionView
| IManifestTree
| IManifestEditor
| IManifestEditorAction
| IManifestEditorView
| IManifestTreeItemAction
| IManifestPropertyEditorUI
| IManifestDashboard
| IManifestPropertyAction
| IManifestPackageView
| IManifestEntrypoint
| IManifestCustom;
export type ManifestStandardTypes =
| 'section'
| 'sectionView'
| 'tree'
| 'editor'
| 'editorView'
| 'editorAction'
| 'treeItemAction'
| 'propertyEditorUI'
| 'dashboard'
| 'propertyAction'
| 'packageView'
| 'entrypoint';
export interface ManifestsResponse {
manifests: Manifest[];
manifests: {}[];
}
export interface ManifestsPackagesInstalledResponse {
@@ -76,141 +45,3 @@ export interface PackageInstalled {
hasPendingMigrations: boolean;
plans: {}[];
}
export interface IManifest {
type: string;
alias: string;
name: string;
weight?: number;
}
export interface MetaSection {
label: string;
pathname: string;
}
export interface MetaSectionView {
sections: Array<string>;
label: string;
pathname: string;
weight: number;
icon: string;
}
export interface MetaTree {
sections: Array<string>;
}
export interface MetaEditor {
entityType: string;
}
export interface MetaTreeItemAction {
trees: Array<string>;
label: string;
icon: string;
}
export interface MetaPropertyEditorUI {
label: string;
propertyEditor: string;
icon: string;
group: string;
config?: PropertyEditorConfig;
}
export interface MetaDashboard {
sections: string[];
pathname: string;
label?: string;
}
export interface MetaEditorView {
editors: string[];
pathname: string;
label: string;
icon: string;
}
export interface MetaPropertyAction {
propertyEditors: string[];
}
export interface MetaPackageView {
packageAlias: string;
}
export interface IManifestCustom extends IManifest {
type: 'custom';
meta?: {};
}
export interface IManifestElement extends IManifest {
type: ManifestStandardTypes;
js?: string;
elementName?: string;
meta?: {};
}
export interface IManifestSection extends IManifestElement {
type: 'section';
meta: MetaSection;
}
export interface IManifestSectionView extends IManifestElement {
type: 'sectionView';
meta: MetaSectionView;
}
export interface IManifestEditorAction extends IManifestElement {
type: 'editorAction';
meta: MetaEditorAction;
}
export interface MetaEditorAction {
editors: Array<string>;
}
export interface IManifestTree extends IManifestElement {
type: 'tree';
meta: MetaTree;
}
export interface IManifestEditor extends IManifestElement {
type: 'editor';
meta: MetaEditor;
}
export interface IManifestTreeItemAction extends IManifestElement {
type: 'treeItemAction';
meta: MetaTreeItemAction;
}
export interface IManifestPropertyEditorUI extends IManifestElement {
type: 'propertyEditorUI';
meta: MetaPropertyEditorUI;
}
export interface IManifestDashboard extends IManifestElement {
type: 'dashboard';
meta: MetaDashboard;
}
export interface IManifestEditorView extends IManifestElement {
type: 'editorView';
meta: MetaEditorView;
}
export interface IManifestPropertyAction extends IManifestElement {
type: 'propertyAction';
meta: MetaPropertyAction;
}
export interface IManifestPackageView extends IManifestElement {
type: 'packageView';
meta: MetaPackageView;
}
export interface IManifestEntrypoint extends IManifest {
type: 'entrypoint';
js: string;
}

View File

@@ -1,80 +0,0 @@
import { body, defaultResponse, endpoint, response, request, pathParams, String } from '@airtasker/spot';
import { ProblemDetails } from './models';
@endpoint({ method: 'GET', path: '/property-editors/list' })
export class PropertyEditorsListEndpoint {
@response({ status: 200 })
response(@body body: PropertyEditorsListResponse) {}
@defaultResponse
default(@body body: ProblemDetails) {}
}
@endpoint({ method: 'GET', path: '/property-editors/property-editor/:propertyEditorAlias' })
export class PropertyEditorEndpoint {
@request
request(
@pathParams
pathParams: {
propertyEditorAlias: String;
}
) {}
@response({ status: 200 })
response(@body body: PropertyEditorResponse) {}
@defaultResponse
default(@body body: ProblemDetails) {}
}
@endpoint({ method: 'GET', path: '/property-editors/property-editor/config/:propertyEditorAlias' })
export class PropertyEditorConfigEndpoint {
@request
request(
@pathParams
pathParams: {
propertyEditorAlias: String;
}
) {}
@response({ status: 200 })
response(@body body: PropertyEditorConfigResponse) {}
@defaultResponse
default(@body body: ProblemDetails) {}
}
export interface PropertyEditorsListResponse {
propertyEditors: PropertyEditor[];
}
export interface PropertyEditorResponse extends PropertyEditor {}
export interface PropertyEditorConfigResponse extends PropertyEditorConfig {}
export interface PropertyEditor {
alias: string;
name: string;
icon: string;
group?: string;
isSystem: boolean;
hasConfig: boolean;
config?: PropertyEditorConfig;
}
export interface PropertyEditorConfig {
properties: PropertyEditorConfigProperty[];
defaultData?: PropertyEditorConfigDefaultData[];
}
export interface PropertyEditorConfigProperty {
label: string;
description?: string;
alias: string;
propertyEditorUI: string;
}
export interface PropertyEditorConfigDefaultData {
alias: string;
value: string | number | boolean | {} | string[] | number[] | boolean[] | {}[] | null;
}