diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 718f5b38bc..294dc69b4e 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -17,6 +17,7 @@ specifiers: '@rush-temp/model-core': file:./projects/model-core.tgz '@rush-temp/model-rig': file:./projects/model-rig.tgz '@rush-temp/model-view': file:./projects/model-view.tgz + '@rush-temp/model-workbench': file:./projects/model-workbench.tgz '@rush-temp/platform': file:./projects/platform.tgz '@rush-temp/platform-rig': file:./projects/platform-rig.tgz '@rush-temp/presentation': file:./projects/presentation.tgz @@ -87,6 +88,7 @@ dependencies: '@rush-temp/model-core': file:projects/model-core.tgz_6c259fadfeb3a4b20890aefe87070b8b '@rush-temp/model-rig': file:projects/model-rig.tgz_6ab28797e7a22071465f7d680ae81ae5 '@rush-temp/model-view': file:projects/model-view.tgz_6c259fadfeb3a4b20890aefe87070b8b + '@rush-temp/model-workbench': file:projects/model-workbench.tgz_6c259fadfeb3a4b20890aefe87070b8b '@rush-temp/platform': file:projects/platform.tgz_6c259fadfeb3a4b20890aefe87070b8b '@rush-temp/platform-rig': file:projects/platform-rig.tgz_6ab28797e7a22071465f7d680ae81ae5 '@rush-temp/presentation': file:projects/presentation.tgz_c38cf1a7a413db8918b0b4754c21e4c5 @@ -7892,7 +7894,7 @@ packages: dev: false file:projects/dev-client-resources.tgz_6c259fadfeb3a4b20890aefe87070b8b: - resolution: {integrity: sha512-EUDIrb3wXy6PHSbUnxEkKagNVsM5jKUBg0qSdd6/BriulwYZ5C1BlLqS58oDWxaySjHBSMGyaKN4Ath5QYrI8A==, tarball: file:projects/dev-client-resources.tgz} + resolution: {integrity: sha512-biw7Qe9DoDRjkgmEJ4Dl1MAxSzzm580Eb3cqU5ISPSrJ+1EIR+RqUf7W7fwN+PQQuZHy24/mR/tm6P2w8zJnwQ==, tarball: file:projects/dev-client-resources.tgz} id: file:projects/dev-client-resources.tgz name: '@rush-temp/dev-client-resources' version: 0.0.0 @@ -8073,6 +8075,23 @@ packages: - typescript dev: false + file:projects/model-workbench.tgz_6c259fadfeb3a4b20890aefe87070b8b: + resolution: {integrity: sha512-QV8gtCxPbFWNe3e2zV2XtK197RIGLFqpgP4KiN8Z6AieeAFP0HieLJgqovTLZT7lvDX2mtfnHuWGQxGg643taw==, tarball: file:projects/model-workbench.tgz} + id: file:projects/model-workbench.tgz + name: '@rush-temp/model-workbench' + version: 0.0.0 + dependencies: + '@typescript-eslint/eslint-plugin': 4.28.5_a8e83fcad666e1ba86be4b2e27a20aea + eslint: 7.32.0 + eslint-plugin-import: 2.23.4_eslint@7.32.0 + eslint-plugin-node: 11.1.0_eslint@7.32.0 + eslint-plugin-promise: 4.3.1 + transitivePeerDependencies: + - '@typescript-eslint/parser' + - supports-color + - typescript + dev: false + file:projects/model.tgz_6c259fadfeb3a4b20890aefe87070b8b: resolution: {integrity: sha512-+U81cS6gjuC42PMvI6lh/tICT4o4DpJQZDFCcfDsK0EZRHlhnndytVgRGCmD/KTDv1Nvs7FDSLzsAADGmeP0JA==, tarball: file:projects/model.tgz} id: file:projects/model.tgz @@ -8160,7 +8179,7 @@ packages: dev: false file:projects/prod.tgz_9242e79bee31c899aa4d2de67405a771: - resolution: {integrity: sha512-RKHRlPdnGvUzQoKQ0oFqyfykBDw4DGUGBMBukgx1TJu95/HRLuDVcX2PWxL3KMMHToqRVajpUkvQMYKT6fcWWQ==, tarball: file:projects/prod.tgz} + resolution: {integrity: sha512-TDq/BJPcrIJ5sD5OkabgEh2lLuhgqcWG3iJg+1dkRuBWbiclHiR8PgB4OOHK7wFVVaEr10vVyF3AKa1GNeHaYw==, tarball: file:projects/prod.tgz} id: file:projects/prod.tgz name: '@rush-temp/prod' version: 0.0.0 diff --git a/dev/storage/src/model.tx.json b/dev/storage/src/model.tx.json index daefb818bb..be6229e458 100644 --- a/dev/storage/src/model.tx.json +++ b/dev/storage/src/model.tx.json @@ -1,25 +1,25 @@ [ { - "_id": "610e735f946b3ebe7af501e1", + "_id": "610e75fa3685f8266ee31e0e", "_class": "core:class:TxCreateDoc", "space": "core:space:Tx", "objectId": "core:class:Obj", "objectClass": "core:class:Class", "objectSpace": "core:space:Model", - "modifiedOn": 1628336991083, + "modifiedOn": 1628337658501, "modifiedBy": "core:account:System", "attributes": { "kind": 0 } }, { - "_id": "610e735f946b3ebe7af501e2", + "_id": "610e75fa3685f8266ee31e0f", "_class": "core:class:TxCreateDoc", "space": "core:space:Tx", "objectId": "core:class:Doc", "objectClass": "core:class:Class", "objectSpace": "core:space:Model", - "modifiedOn": 1628336991083, + "modifiedOn": 1628337658501, "modifiedBy": "core:account:System", "attributes": { "kind": 0, @@ -27,13 +27,13 @@ } }, { - "_id": "610e735f946b3ebe7af501e3", + "_id": "610e75fa3685f8266ee31e10", "_class": "core:class:TxCreateDoc", "space": "core:space:Tx", "objectId": "core:class:Type", "objectClass": "core:class:Class", "objectSpace": "core:space:Model", - "modifiedOn": 1628336991083, + "modifiedOn": 1628337658501, "modifiedBy": "core:account:System", "attributes": { "kind": 0, @@ -41,13 +41,13 @@ } }, { - "_id": "610e735f946b3ebe7af501e4", + "_id": "610e75fa3685f8266ee31e11", "_class": "core:class:TxCreateDoc", "space": "core:space:Tx", "objectId": "core:class:TypeString", "objectClass": "core:class:Class", "objectSpace": "core:space:Model", - "modifiedOn": 1628336991083, + "modifiedOn": 1628337658501, "modifiedBy": "core:account:System", "attributes": { "kind": 0, @@ -55,13 +55,13 @@ } }, { - "_id": "610e735f946b3ebe7af501e5", + "_id": "610e75fa3685f8266ee31e12", "_class": "core:class:TxCreateDoc", "space": "core:space:Tx", "objectId": "core:class:Attribute", "objectClass": "core:class:Class", "objectSpace": "core:space:Model", - "modifiedOn": 1628336991083, + "modifiedOn": 1628337658501, "modifiedBy": "core:account:System", "attributes": { "kind": 0, @@ -69,13 +69,13 @@ } }, { - "_id": "610e735f946b3ebe7af501e6", + "_id": "610e75fa3685f8266ee31e13", "_class": "core:class:TxCreateDoc", "space": "core:space:Tx", "objectId": "core:class:Account", "objectClass": "core:class:Class", "objectSpace": "core:space:Model", - "modifiedOn": 1628336991083, + "modifiedOn": 1628337658501, "modifiedBy": "core:account:System", "attributes": { "domain": "model", @@ -84,13 +84,13 @@ } }, { - "_id": "610e735f946b3ebe7af501e7", + "_id": "610e75fa3685f8266ee31e14", "_class": "core:class:TxCreateDoc", "space": "core:space:Tx", "objectId": "core:class:Space", "objectClass": "core:class:Class", "objectSpace": "core:space:Model", - "modifiedOn": 1628336991083, + "modifiedOn": 1628337658501, "modifiedBy": "core:account:System", "attributes": { "domain": "model", @@ -99,13 +99,13 @@ } }, { - "_id": "610e735f946b3ebe7af501e8", + "_id": "610e75fa3685f8266ee31e15", "_class": "core:class:TxCreateDoc", "space": "core:space:Tx", "objectId": "core:class:Tx", "objectClass": "core:class:Class", "objectSpace": "core:space:Model", - "modifiedOn": 1628336991083, + "modifiedOn": 1628337658501, "modifiedBy": "core:account:System", "attributes": { "domain": "tx", @@ -114,13 +114,13 @@ } }, { - "_id": "610e735f946b3ebe7af501e9", + "_id": "610e75fa3685f8266ee31e16", "_class": "core:class:TxCreateDoc", "space": "core:space:Tx", "objectId": "core:class:TxCUD", "objectClass": "core:class:Class", "objectSpace": "core:space:Model", - "modifiedOn": 1628336991083, + "modifiedOn": 1628337658501, "modifiedBy": "core:account:System", "attributes": { "kind": 0, @@ -128,13 +128,13 @@ } }, { - "_id": "610e735f946b3ebe7af501ea", + "_id": "610e75fa3685f8266ee31e17", "_class": "core:class:TxCreateDoc", "space": "core:space:Tx", "objectId": "core:class:TxUpdateDoc", "objectClass": "core:class:Class", "objectSpace": "core:space:Model", - "modifiedOn": 1628336991083, + "modifiedOn": 1628337658501, "modifiedBy": "core:account:System", "attributes": { "kind": 0, @@ -142,13 +142,13 @@ } }, { - "_id": "610e735f946b3ebe7af501eb", + "_id": "610e75fa3685f8266ee31e18", "_class": "core:class:TxCreateDoc", "space": "core:space:Tx", "objectId": "core:class:TxMixin", "objectClass": "core:class:Class", "objectSpace": "core:space:Model", - "modifiedOn": 1628336991083, + "modifiedOn": 1628337658501, "modifiedBy": "core:account:System", "attributes": { "kind": 0, @@ -156,13 +156,13 @@ } }, { - "_id": "610e735f946b3ebe7af501ec", + "_id": "610e75fa3685f8266ee31e19", "_class": "core:class:TxCreateDoc", "space": "core:space:Tx", "objectId": "core:class:TxCreateDoc", "objectClass": "core:class:Class", "objectSpace": "core:space:Model", - "modifiedOn": 1628336991083, + "modifiedOn": 1628337658501, "modifiedBy": "core:account:System", "attributes": { "kind": 0, @@ -170,13 +170,13 @@ } }, { - "_id": "610e735f946b3ebe7af501ed", + "_id": "610e75fa3685f8266ee31e1a", "_class": "core:class:TxCreateDoc", "space": "core:space:Tx", "objectId": "core:class:Class", "objectClass": "core:class:Class", "objectSpace": "core:space:Model", - "modifiedOn": 1628336991083, + "modifiedOn": 1628337658501, "modifiedBy": "core:account:System", "attributes": { "domain": "model", @@ -185,17 +185,147 @@ } }, { - "_id": "610e735f946b3ebe7af501ee", + "_id": "610e75fa3685f8266ee31e1b", "_class": "core:class:TxCreateDoc", "space": "core:space:Tx", "objectId": "core:class:Mixin", "objectClass": "core:class:Class", "objectSpace": "core:space:Model", - "modifiedOn": 1628336991083, + "modifiedOn": 1628337658501, "modifiedBy": "core:account:System", "attributes": { "kind": 0, "extends": "core:class:Class" } + }, + { + "_id": "610e75fa3685f8266ee31e1c", + "_class": "core:class:TxCreateDoc", + "space": "core:space:Tx", + "objectId": "view:class:Viewlet", + "objectClass": "core:class:Class", + "objectSpace": "core:space:Model", + "modifiedOn": 1628337658501, + "modifiedBy": "core:account:System", + "attributes": { + "domain": "model", + "kind": 0, + "extends": "core:class:Doc" + } + }, + { + "_id": "610e75fa3685f8266ee31e1d", + "_class": "core:class:TxCreateDoc", + "space": "core:space:Tx", + "objectId": "view:class:ViewletDescriptor", + "objectClass": "core:class:Class", + "objectSpace": "core:space:Model", + "modifiedOn": 1628337658501, + "modifiedBy": "core:account:System", + "attributes": { + "domain": "model", + "kind": 0, + "extends": "core:class:Doc" + } + }, + { + "_id": "610e75fa3685f8266ee31e1e", + "_class": "core:class:TxCreateDoc", + "space": "core:space:Tx", + "objectId": "view:mixin:AttributePresenter", + "objectClass": "core:class:Class", + "objectSpace": "core:space:Model", + "modifiedOn": 1628337658501, + "modifiedBy": "core:account:System", + "attributes": { + "kind": 0, + "extends": "core:class:Class" + } + }, + { + "_id": "610e75fa3685f8266ee31e1f", + "_class": "core:class:TxCreateDoc", + "space": "core:space:Tx", + "objectId": "view:mixin:AttributeEditor", + "objectClass": "core:class:Class", + "objectSpace": "core:space:Model", + "modifiedOn": 1628337658502, + "modifiedBy": "core:account:System", + "attributes": { + "kind": 0, + "extends": "core:class:Class" + } + }, + { + "_id": "610e75fa3685f8266ee31e20", + "_class": "core:class:TxMixin", + "space": "core:space:Tx", + "modifiedBy": "core:account:System", + "modifiedOn": 1628337658502, + "objectId": "core:class:TypeString", + "objectClass": "core:class:Class", + "objectSpace": "core:space:Model", + "mixin": "view:mixin:AttributeEditor", + "attributes": { + "editor": "view:component:StringEditor" + } + }, + { + "_id": "610e75fa3685f8266ee31e21", + "_class": "core:class:TxMixin", + "space": "core:space:Tx", + "modifiedBy": "core:account:System", + "modifiedOn": 1628337658502, + "objectId": "core:class:TypeString", + "objectClass": "core:class:Class", + "objectSpace": "core:space:Model", + "mixin": "view:mixin:AttributePresenter", + "attributes": { + "presenter": "view:component:StringPresenter" + } + }, + { + "_id": "610e75fa3685f8266ee31e22", + "_class": "core:class:TxCreateDoc", + "space": "core:space:Tx", + "objectId": "view:viewlet:Table", + "objectClass": "view:class:ViewletDescriptor", + "objectSpace": "core:space:Model", + "modifiedOn": 1628337658502, + "modifiedBy": "core:account:System", + "attributes": { + "label": "Table", + "icon": "view:icon:Table", + "component": "view:component:TableView" + } + }, + { + "_id": "610e75fa3685f8266ee31e23", + "_class": "core:class:TxCreateDoc", + "space": "core:space:Tx", + "objectId": "workbench:mixin:SpaceView", + "objectClass": "core:class:Class", + "objectSpace": "core:space:Model", + "modifiedOn": 1628337658502, + "modifiedBy": "core:account:System", + "attributes": { + "kind": 0, + "extends": "core:class:Class" + } + }, + { + "_id": "610e75fa3685f8266ee31e24", + "_class": "core:class:TxCreateDoc", + "space": "core:space:Tx", + "objectId": "workbench:class:Application", + "objectClass": "core:class:Class", + "objectSpace": "core:space:Model", + "modifiedOn": 1628337658502, + "modifiedBy": "core:account:System", + "attributes": { + "domain": "model", + "kind": 0, + "extends": "core:class:Doc" + } } ] \ No newline at end of file diff --git a/models/all/package.json b/models/all/package.json index f97613e4ec..d838fd0d5e 100644 --- a/models/all/package.json +++ b/models/all/package.json @@ -21,6 +21,8 @@ }, "dependencies": { "@anticrm/model": "~0.6.0", - "@anticrm/model-core": "~0.6.0" + "@anticrm/model-core": "~0.6.0", + "@anticrm/model-view": "~0.6.0", + "@anticrm/model-workbench": "~0.6.0" } } diff --git a/models/all/src/index.ts b/models/all/src/index.ts index f842c210f6..6280c03956 100644 --- a/models/all/src/index.ts +++ b/models/all/src/index.ts @@ -16,11 +16,11 @@ import { Builder } from '@anticrm/model' import { createModel as coreModel } from '@anticrm/model-core' -// import { createModel as workbenchModel } from '@anticrm/model-workbench' +import { createModel as viewModel } from '@anticrm/model-view' +import { createModel as workbenchModel } from '@anticrm/model-workbench' // import { createModel as contactModel } from '@anticrm/model-contact' // import { createModel as chunterModel } from '@anticrm/model-chunter' // import { createModel as recruitModel } from '@anticrm/model-recruit' -// import { createModel as viewModel } from '@anticrm/model-view' // import { createModel as taskModel } from '@anticrm/model-task' // import { createDemo } from '@anticrm/model-demo' @@ -28,8 +28,8 @@ import { createModel as coreModel } from '@anticrm/model-core' const builder = new Builder() coreModel(builder) -// viewModel(builder) -// workbenchModel(builder) +viewModel(builder) +workbenchModel(builder) // contactModel(builder) // chunterModel(builder) // taskModel(builder) diff --git a/models/workbench/.eslintrc.js b/models/workbench/.eslintrc.js new file mode 100644 index 0000000000..1375671262 --- /dev/null +++ b/models/workbench/.eslintrc.js @@ -0,0 +1,6 @@ +module.exports = { + extends: ['./node_modules/@anticrm/model-rig/profiles/default/config/eslint.config.json'], + parserOptions: { + project: './tsconfig.json' + } +} \ No newline at end of file diff --git a/models/workbench/.npmignore b/models/workbench/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/models/workbench/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/models/workbench/config/rig.json b/models/workbench/config/rig.json new file mode 100644 index 0000000000..e9a9ee9add --- /dev/null +++ b/models/workbench/config/rig.json @@ -0,0 +1,18 @@ +// The "rig.json" file directs tools to look for their config files in an external package. +// Documentation for this system: https://www.npmjs.com/package/@rushstack/rig-package +{ + "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json", + + /** + * (Required) The name of the rig package to inherit from. + * It should be an NPM package name with the "-rig" suffix. + */ + "rigPackageName": "@anticrm/model-rig" + + /** + * (Optional) Selects a config profile from the rig package. The name must consist of + * lowercase alphanumeric words separated by hyphens, for example "sample-profile". + * If omitted, then the "default" profile will be used." + */ + // "rigProfile": "your-profile-name" +} diff --git a/models/workbench/package.json b/models/workbench/package.json new file mode 100644 index 0000000000..0648f5086a --- /dev/null +++ b/models/workbench/package.json @@ -0,0 +1,26 @@ +{ + "name": "@anticrm/model-workbench", + "version": "0.6.0", + "main": "lib/index.js", + "author": "Anticrm Platform Contributors", + "license": "EPL-2.0", + "scripts": { + "build": "heft build", + "lint:fix": "eslint --fix src" + }, + "devDependencies": { + "@anticrm/model-rig":"~0.6.0", + "@typescript-eslint/eslint-plugin":"4", + "eslint-plugin-import":"2", + "eslint-plugin-promise":"4", + "eslint-plugin-node":"11", + "eslint":"^7.32.0" + }, + "dependencies": { + "@anticrm/core": "~0.6.7", + "@anticrm/model": "~0.6.0", + "@anticrm/platform": "~0.6.3", + "@anticrm/model-core": "~0.6.0", + "@anticrm/workbench": "~0.6.0" + } +} diff --git a/models/workbench/src/index.ts b/models/workbench/src/index.ts new file mode 100644 index 0000000000..0b5907841a --- /dev/null +++ b/models/workbench/src/index.ts @@ -0,0 +1,39 @@ +// +// Copyright © 2020 Anticrm Platform Contributors. +// +// Licensed under the Eclipse Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. You may +// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import type { IntlString, Asset } from '@anticrm/platform' +import { DOMAIN_MODEL } from '@anticrm/core' +import { Model, Mixin, Builder } from '@anticrm/model' +import type { Application, SpaceView, ViewConfiguration } from '@anticrm/workbench' + +import core, { TDoc, TClass } from '@anticrm/model-core' +import workbench from './plugin' + +@Model(workbench.class.Application, core.class.Doc, DOMAIN_MODEL) +export class TApplication extends TDoc implements Application { + label!: IntlString + icon!: Asset +} + +@Mixin(workbench.mixin.SpaceView, core.class.Class) +export class TSpaceView extends TClass implements SpaceView { + view!: ViewConfiguration +} + +export function createModel (builder: Builder): void { + builder.createModel(TApplication, TSpaceView) +} + +export default workbench diff --git a/models/workbench/src/plugin.ts b/models/workbench/src/plugin.ts new file mode 100644 index 0000000000..cd68a45a73 --- /dev/null +++ b/models/workbench/src/plugin.ts @@ -0,0 +1,20 @@ +// +// Copyright © 2020 Anticrm Platform Contributors. +// +// Licensed under the Eclipse Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. You may +// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import { mergeIds } from '@anticrm/platform' +import workbench, { workbenchId } from '@anticrm/workbench' + +export default mergeIds(workbenchId, workbench, { +}) diff --git a/models/workbench/tsconfig.json b/models/workbench/tsconfig.json new file mode 100644 index 0000000000..1d60db76b4 --- /dev/null +++ b/models/workbench/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "./node_modules/@anticrm/model-rig/profiles/default/tsconfig.json", + + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib", + } +} \ No newline at end of file diff --git a/packages/platform/src/event.ts b/packages/platform/src/event.ts index 70034e56c6..1408e015d0 100644 --- a/packages/platform/src/event.ts +++ b/packages/platform/src/event.ts @@ -73,6 +73,7 @@ async function broadcastEvent (event: string, data: any): Promise { * @returns */ export async function setPlatformStatus (status: Status | Error): Promise { + console.log('platform status', status) if (status instanceof Error) { return await broadcastEvent(PlatformEvent, unknownError(status)) } else { diff --git a/plugins/workbench-resources/src/components/Applications.svelte b/plugins/workbench-resources/src/components/Applications.svelte index 49736284d0..3abe89afd2 100644 --- a/plugins/workbench-resources/src/components/Applications.svelte +++ b/plugins/workbench-resources/src/components/Applications.svelte @@ -15,11 +15,10 @@