diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 0c54fdeed3..655da37e6a 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -8,6 +8,9 @@ specifiers: '@rush-temp/activity': file:./projects/activity.tgz '@rush-temp/activity-assets': file:./projects/activity-assets.tgz '@rush-temp/activity-resources': file:./projects/activity-resources.tgz + '@rush-temp/attachment': file:./projects/attachment.tgz + '@rush-temp/attachment-assets': file:./projects/attachment-assets.tgz + '@rush-temp/attachment-resources': file:./projects/attachment-resources.tgz '@rush-temp/chunter': file:./projects/chunter.tgz '@rush-temp/chunter-assets': file:./projects/chunter-assets.tgz '@rush-temp/chunter-resources': file:./projects/chunter-resources.tgz @@ -33,6 +36,7 @@ specifiers: '@rush-temp/model': file:./projects/model.tgz '@rush-temp/model-activity': file:./projects/model-activity.tgz '@rush-temp/model-all': file:./projects/model-all.tgz + '@rush-temp/model-attachment': file:./projects/model-attachment.tgz '@rush-temp/model-chunter': file:./projects/model-chunter.tgz '@rush-temp/model-contact': file:./projects/model-contact.tgz '@rush-temp/model-core': file:./projects/model-core.tgz @@ -164,6 +168,9 @@ dependencies: '@rush-temp/activity': file:projects/activity.tgz '@rush-temp/activity-assets': file:projects/activity-assets.tgz '@rush-temp/activity-resources': file:projects/activity-resources.tgz_476f694f64637160ae71e12ff57815b9 + '@rush-temp/attachment': file:projects/attachment.tgz + '@rush-temp/attachment-assets': file:projects/attachment-assets.tgz + '@rush-temp/attachment-resources': file:projects/attachment-resources.tgz_476f694f64637160ae71e12ff57815b9 '@rush-temp/chunter': file:projects/chunter.tgz '@rush-temp/chunter-assets': file:projects/chunter-assets.tgz '@rush-temp/chunter-resources': file:projects/chunter-resources.tgz_476f694f64637160ae71e12ff57815b9 @@ -189,6 +196,7 @@ dependencies: '@rush-temp/model': file:projects/model.tgz '@rush-temp/model-activity': file:projects/model-activity.tgz_typescript@4.4.3 '@rush-temp/model-all': file:projects/model-all.tgz_typescript@4.4.3 + '@rush-temp/model-attachment': file:projects/model-attachment.tgz_typescript@4.4.3 '@rush-temp/model-chunter': file:projects/model-chunter.tgz_typescript@4.4.3 '@rush-temp/model-contact': file:projects/model-contact.tgz_typescript@4.4.3 '@rush-temp/model-core': file:projects/model-core.tgz_typescript@4.4.3 @@ -9620,6 +9628,68 @@ packages: - supports-color dev: false + file:projects/attachment-assets.tgz: + resolution: {integrity: sha512-FCyg6p/pZjhvZBTdfmGWisxtakixI3vRpGTNGQDRYb/BvSE+GDNYuvPpXmD6HrMh+5sGfcZDMyWhtyGV9/ZqUA==, tarball: file:projects/attachment-assets.tgz} + name: '@rush-temp/attachment-assets' + version: 0.0.0 + dev: false + + file:projects/attachment-resources.tgz_476f694f64637160ae71e12ff57815b9: + resolution: {integrity: sha512-MRImst0WyxQ5iFxrOLL2P6aD9s4GXYtxPdTbCFcUDsqut/jxCWmIfHYIcuNOq/m2M4EEvqjhq4W/jOOf9215Fw==, tarball: file:projects/attachment-resources.tgz} + id: file:projects/attachment-resources.tgz + name: '@rush-temp/attachment-resources' + version: 0.0.0 + dependencies: + '@typescript-eslint/eslint-plugin': 5.4.0_87dbf04088b125598d0271706532eaf3 + '@typescript-eslint/parser': 5.4.0_eslint@7.32.0+typescript@4.4.3 + eslint: 7.32.0 + eslint-config-standard-with-typescript: 21.0.1_05a8ea1454e6ca4c9f98b94b8f3abf9c + eslint-plugin-import: 2.25.3_eslint@7.32.0 + eslint-plugin-node: 11.1.0_eslint@7.32.0 + eslint-plugin-promise: 5.1.1_eslint@7.32.0 + eslint-plugin-svelte3: 3.2.1_eslint@7.32.0+svelte@3.43.1 + filesize: 8.0.3 + prettier: 2.4.1 + prettier-plugin-svelte: 2.5.0_prettier@2.4.1+svelte@3.43.1 + sass: 1.42.1 + svelte: 3.43.1 + svelte-check: 2.2.10_3708ed3db7329f2cbf76db19160094b1 + svelte-loader: 3.1.2_svelte@3.43.1 + svelte-preprocess: 4.9.8_b1ccfb371c7d68f75291f5a547be0b14 + typescript: 4.4.3 + transitivePeerDependencies: + - '@babel/core' + - coffeescript + - less + - node-sass + - postcss + - postcss-load-config + - pug + - stylus + - sugarss + - supports-color + dev: false + + file:projects/attachment.tgz: + resolution: {integrity: sha512-H3VFLgdb1nVXMPAjrqIhAD2Rtb56WTVDSXIIwAB2YoANkn4UIta8+SLtkqsUbFITiEpRu/qXA1S+LzenAoPCWg==, tarball: file:projects/attachment.tgz} + name: '@rush-temp/attachment' + version: 0.0.0 + dependencies: + '@rushstack/heft': 0.41.1 + '@types/heft-jest': 1.0.2 + '@typescript-eslint/eslint-plugin': 5.4.0_87dbf04088b125598d0271706532eaf3 + '@typescript-eslint/parser': 5.4.0_eslint@7.32.0+typescript@4.4.3 + eslint: 7.32.0 + eslint-config-standard-with-typescript: 21.0.1_05a8ea1454e6ca4c9f98b94b8f3abf9c + eslint-plugin-import: 2.25.3_eslint@7.32.0 + eslint-plugin-node: 11.1.0_eslint@7.32.0 + eslint-plugin-promise: 5.1.1_eslint@7.32.0 + prettier: 2.4.1 + typescript: 4.4.3 + transitivePeerDependencies: + - supports-color + dev: false + file:projects/chunter-assets.tgz: resolution: {integrity: sha512-kMTEO1cP8cmeoA2tImDBtT2SXfjo4AW0MWEbzFvzhZkLZaMmJGtl5ZHclKn/Wwg/LBA1zDc21fKlpeahmuNS4A==, tarball: file:projects/chunter-assets.tgz} name: '@rush-temp/chunter-assets' @@ -9627,7 +9697,7 @@ packages: dev: false file:projects/chunter-resources.tgz_476f694f64637160ae71e12ff57815b9: - resolution: {integrity: sha512-VeAPHIR/LZrUXIcd4AYBi4knK8+ZRnIGUd3ag30ILGm4kQ5b1hQXaHpBhSVwSqFktr4vlIoPACZudN7ChHKSqw==, tarball: file:projects/chunter-resources.tgz} + resolution: {integrity: sha512-f6XU3bEnmm8jO7FEfi+LjEhLu4p/f8Y4HzoRHA+p39bZCegxBevjz89RWVFhQ+lC9tWWyg2zK0Tt6E88llN2lw==, tarball: file:projects/chunter-resources.tgz} id: file:projects/chunter-resources.tgz name: '@rush-temp/chunter-resources' version: 0.0.0 @@ -9729,7 +9799,7 @@ packages: dev: false file:projects/contact-resources.tgz_476f694f64637160ae71e12ff57815b9: - resolution: {integrity: sha512-LIvMtKOFKmRTJCDkCpRIiUChzMX8x54RZAA0yVBbv8rt3HG7eKRxqAzeK5gbUp8vrcZLeNrpGy9/xqG5UHbkBQ==, tarball: file:projects/contact-resources.tgz} + resolution: {integrity: sha512-7wNt7czMMNeogqSzQY1zCG/iOrTKKY6R52gyFcBxxBGUJtRWj7b7s8JtJ137tP0jZTcLlzhd99utKewQ/BkxQQ==, tarball: file:projects/contact-resources.tgz} id: file:projects/contact-resources.tgz name: '@rush-temp/contact-resources' version: 0.0.0 @@ -10019,7 +10089,7 @@ packages: dev: false file:projects/front.tgz: - resolution: {integrity: sha512-N1wFWaSW9qYwHTtlnqNdVByzFVkRtE5kOIg+IAnHiCcOSeYBGdE+V+pt/DohnpmpzEzxTR8jKUyYHusazAO+Mg==, tarball: file:projects/front.tgz} + resolution: {integrity: sha512-iSBgFbScuEX0S/r4FJh/z02rKgeaMPKCe0Z7Unr/g2AzgeO65k1G6uaT/mtlr1ulaYixN+dMMmaxzkJT5psDeQ==, tarball: file:projects/front.tgz} name: '@rush-temp/front' version: 0.0.0 dependencies: @@ -10134,7 +10204,7 @@ packages: dev: false file:projects/model-all.tgz_typescript@4.4.3: - resolution: {integrity: sha512-CmX0IDsPS79BtfPfKmxiiV8RYuxi+tx7r0UWxqk5zhln5FHF6Fi+cuuUyDmGZ6lYWp8x2q6reBcUdU8WRyJBEg==, tarball: file:projects/model-all.tgz} + resolution: {integrity: sha512-76M/a9+Fy3fVPPgQDAPzjvn4b5KY2+VlRURicy5qStQDzRLmNHefnOdDDCxgO3eU/99TMnN6a+11Gjeu7NM/6w==, tarball: file:projects/model-all.tgz} id: file:projects/model-all.tgz name: '@rush-temp/model-all' version: 0.0.0 @@ -10158,6 +10228,27 @@ packages: - typescript dev: false + file:projects/model-attachment.tgz_typescript@4.4.3: + resolution: {integrity: sha512-EKpkJcrMm3iEran7CFmmNoYX9ANHWts0PClN+OeqFyY/LGbEfQ7iciwDWlIuo9Br3u3m79jy6jTCTI/c08X4KA==, tarball: file:projects/model-attachment.tgz} + id: file:projects/model-attachment.tgz + name: '@rush-temp/model-attachment' + version: 0.0.0 + dependencies: + '@rushstack/heft': 0.41.1 + '@types/heft-jest': 1.0.2 + '@typescript-eslint/eslint-plugin': 5.4.0_87dbf04088b125598d0271706532eaf3 + '@typescript-eslint/parser': 5.4.0_eslint@7.32.0+typescript@4.4.3 + eslint: 7.32.0 + eslint-config-standard-with-typescript: 21.0.1_05a8ea1454e6ca4c9f98b94b8f3abf9c + eslint-plugin-import: 2.25.3_eslint@7.32.0 + eslint-plugin-node: 11.1.0_eslint@7.32.0 + eslint-plugin-promise: 5.1.1_eslint@7.32.0 + prettier: 2.4.1 + transitivePeerDependencies: + - supports-color + - typescript + dev: false + file:projects/model-chunter.tgz_typescript@4.4.3: resolution: {integrity: sha512-iB/GGhZOSuGpbKDb2jrxcj5dvndn1Hy61BV3dSxrZf/lBCoaA4SZfd66gWsdBsv17AOMmaWUvFJxxR5S6J2yfg==, tarball: file:projects/model-chunter.tgz} id: file:projects/model-chunter.tgz @@ -10180,7 +10271,7 @@ packages: dev: false file:projects/model-contact.tgz_typescript@4.4.3: - resolution: {integrity: sha512-naHvZqwC/GQIqo8xgCUOhovUx/M0ZkyRo/2YZsENMfbDoxnrKvpP+viOJiTLVoMP2yTE1/EGqSviQClNvJWcqw==, tarball: file:projects/model-contact.tgz} + resolution: {integrity: sha512-85D68dBZHoPJbRnEythE2CGzp1qbwJ3ynLnBaf3TtNvlgukH1NT15fp2zD8W/4RK9QIscv65yO9gAjTeqjxHUw==, tarball: file:projects/model-contact.tgz} id: file:projects/model-contact.tgz name: '@rush-temp/model-contact' version: 0.0.0 @@ -10243,7 +10334,7 @@ packages: dev: false file:projects/model-recruit.tgz_typescript@4.4.3: - resolution: {integrity: sha512-tvZVIcVZxLJTwI6RVvuk1XXGOGcMji5VFeDQCzhJSif+2dPJIQHEe/HrxNKArqvOXhGyOaA6zbUpftdlAxjQ+A==, tarball: file:projects/model-recruit.tgz} + resolution: {integrity: sha512-Ja9/9aH8v2JSQzsEtuxG7DFOOB405EoASN2ex9S31NYhYqgIqM8ZaRi5McthYz1e4gkyWFWtOCTHbBccNNOvLg==, tarball: file:projects/model-recruit.tgz} id: file:projects/model-recruit.tgz name: '@rush-temp/model-recruit' version: 0.0.0 @@ -10388,7 +10479,7 @@ packages: dev: false file:projects/model-task.tgz_typescript@4.4.3: - resolution: {integrity: sha512-7NTZP389oZgueMDG5WTRhgRWuT3VehxnJ5BqV2uWd/M8Yq8SGyIvyqN1vYiRBSkbksGcc+AMxbenH9eGZESB0g==, tarball: file:projects/model-task.tgz} + resolution: {integrity: sha512-AjQvZTFE3GR6hQkU4jFA9M0bJhQhiiBIaZdW+2ALaj3xwAzolD6eSStCUWVWIZgj9uJTSfT8oGTiIw+iISB61Q==, tarball: file:projects/model-task.tgz} id: file:projects/model-task.tgz name: '@rush-temp/model-task' version: 0.0.0 @@ -10661,7 +10752,7 @@ packages: dev: false file:projects/prod.tgz_sass@1.42.1+typescript@4.4.3: - resolution: {integrity: sha512-YXR+9ndU1ibNRBgBG2s//HcelDIJmxvXqSPkrZ1A9z8qhjtnYGi7mwqIKpxS+mYVr5nS6JRCNLXcblAp7aDlXA==, tarball: file:projects/prod.tgz} + resolution: {integrity: sha512-BsM4OYUp0S0TI6LsvclxVQ0kG6U9Oj4gbGbD38jUPIy02pVP82bS2WrAWh7/s3H4j+sbUnmmrVRulaDAcw34rw==, tarball: file:projects/prod.tgz} id: file:projects/prod.tgz name: '@rush-temp/prod' version: 0.0.0 @@ -10735,7 +10826,7 @@ packages: dev: false file:projects/recruit-resources.tgz_476f694f64637160ae71e12ff57815b9: - resolution: {integrity: sha512-nYgz+aOKNZBwy/q+w0H+/YSchx4IUQZOsnQJka38VLb8V35Oa9HoHDH5GgF79P+af2fN/pkeaR7T0+zhLd8DFQ==, tarball: file:projects/recruit-resources.tgz} + resolution: {integrity: sha512-jJZMXXqVj+ovkyBhJrgToGioIbSmbf7otw3GrGcO/SuZ87j21EZHEY5vKaFAhuXDOriTz7UeajmGmUsx2H7okA==, tarball: file:projects/recruit-resources.tgz} id: file:projects/recruit-resources.tgz name: '@rush-temp/recruit-resources' version: 0.0.0 @@ -10995,7 +11086,7 @@ packages: dev: false file:projects/setting-resources.tgz_476f694f64637160ae71e12ff57815b9: - resolution: {integrity: sha512-e9o9HTlJB1bBfRUN5KLhi/nJVaQqV1iFxOvISqV4hCLdMvf0+Yl7LkFqymZj9Oj277JV1HhO+VpSyPORtJcWaA==, tarball: file:projects/setting-resources.tgz} + resolution: {integrity: sha512-I85L1AQz7schJl8/PKyTjw+/svzxhQ9xnlHSQQnMffB1cSQ265P1v7Zt+NERnsqLGD/l3c59nqXep8JrSDf/Tw==, tarball: file:projects/setting-resources.tgz} id: file:projects/setting-resources.tgz name: '@rush-temp/setting-resources' version: 0.0.0 @@ -11056,7 +11147,7 @@ packages: dev: false file:projects/task-resources.tgz_e1367da94684b005adf08f025c517b1a: - resolution: {integrity: sha512-ClICw/CPw4rPYLvKabxpF44rmJKWLI61xTB4FSA75L9FamuJKV73Ncoo0/c5qhxGNcsd2fe1gHTjg6CYGqP1Lg==, tarball: file:projects/task-resources.tgz} + resolution: {integrity: sha512-zueI7N0xsHL7n4RRTJzNqXaDvrdC/BgotXDMVEFz4TKTvJuwGZ/39TfLaLQM0b/AWvDJV3iG3WS0z9ZMbtHc2g==, tarball: file:projects/task-resources.tgz} id: file:projects/task-resources.tgz name: '@rush-temp/task-resources' version: 0.0.0 @@ -11091,7 +11182,7 @@ packages: dev: false file:projects/task.tgz: - resolution: {integrity: sha512-yDiMMdXUoCo8/NLkpVdY8exQeuOaf18h+ICzhIEgyYjgEYmPxGCWVZ2qcOgWxEFJkEi6K7Gz5Fbz5wLpfVTD4g==, tarball: file:projects/task.tgz} + resolution: {integrity: sha512-Yi88o15ExlXV9xqFXzpmi4I5OjnnY7l6SiQasIC7HqKc5/lG4KFvw/dlZHsFnEbRw3Zxa+laq9MejSMqLEzEVw==, tarball: file:projects/task.tgz} name: '@rush-temp/task' version: 0.0.0 dependencies: @@ -11111,7 +11202,7 @@ packages: dev: false file:projects/telegram-resources.tgz_476f694f64637160ae71e12ff57815b9: - resolution: {integrity: sha512-k/x0wCwvORFOunkF3rKo5EFEPe7nWrKS75N1NBdm8owykYAie8gLNjOYcmupxe5k237nE7gEeVt4ak9lopwh6w==, tarball: file:projects/telegram-resources.tgz} + resolution: {integrity: sha512-ZneaA8uvCmjuSf+zjIrPM1lzhi1At5Giud4UOzKwz2o0lrC4+npRTtCIZ52ZKjjNoOTmgf/hr9RYrqwCMH+z4g==, tarball: file:projects/telegram-resources.tgz} id: file:projects/telegram-resources.tgz name: '@rush-temp/telegram-resources' version: 0.0.0 @@ -11242,7 +11333,7 @@ packages: dev: false file:projects/tool.tgz: - resolution: {integrity: sha512-M+CDNILEFBM+3jv4zU/2ImCQ0wcl2VfMRwI2Ls7ZhXko/+WN5VP4efG2LqK3aer/i3rpCr6gm+nDko7nWtwCZw==, tarball: file:projects/tool.tgz} + resolution: {integrity: sha512-FFa7jbNSC9W0iRlRnNLYvlhWQUYLgCBbgIFsG9Bw0aWy6s8h1EGfJi5cC4b4z31MprdgXh9egR/cpi29fs7bHg==, tarball: file:projects/tool.tgz} name: '@rush-temp/tool' version: 0.0.0 dependencies: @@ -11307,7 +11398,7 @@ packages: dev: false file:projects/upload.tgz: - resolution: {integrity: sha512-26Vcba+jRWoWVXgJQaT6vaY7fDTSgtyWj46y947mGWuyS4RtRbP1x43fw1hGV0RHNbZ9M6gvtLfVNy08DuYeFQ==, tarball: file:projects/upload.tgz} + resolution: {integrity: sha512-WaGQUnqC0+TnVK024k91eTALA6ObkexINzJoxr5qZp5aPBJQ/UzP9Qyy2qcy5U7sFpUzUcADf25+r/LnYw1lfQ==, tarball: file:projects/upload.tgz} name: '@rush-temp/upload' version: 0.0.0 dependencies: diff --git a/dev/prod/package.json b/dev/prod/package.json index 31d48a4004..4d4bc78d31 100644 --- a/dev/prod/package.json +++ b/dev/prod/package.json @@ -80,6 +80,9 @@ "@anticrm/telegram-resources": "~0.6.0", "@anticrm/devmodel": "~0.6.0", "@anticrm/devmodel-resources": "~0.6.0", - "@anticrm/workbench-assets": "~0.6.0" + "@anticrm/workbench-assets": "~0.6.0", + "@anticrm/attachment": "~0.6.0", + "@anticrm/attachment-assets": "~0.6.0", + "@anticrm/attachment-resources": "~0.6.0" } } diff --git a/dev/prod/src/platform.ts b/dev/prod/src/platform.ts index e0af8c28f8..b628b25b60 100644 --- a/dev/prod/src/platform.ts +++ b/dev/prod/src/platform.ts @@ -25,12 +25,14 @@ import { recruitId } from '@anticrm/recruit' import { activityId } from '@anticrm/activity' import { settingId } from '@anticrm/setting' import { telegramId } from '@anticrm/telegram' +import { attachmentId } from '@anticrm/attachment' import { clientId } from '@anticrm/client' import '@anticrm/login-assets' import '@anticrm/task-assets' import '@anticrm/view-assets' import '@anticrm/chunter-assets' +import '@anticrm/attachment-assets' import '@anticrm/contact-assets' import '@anticrm/recruit-assets' import '@anticrm/activity-assets' @@ -60,4 +62,5 @@ export function configurePlatform() { addLocation(activityId, () => import(/*webpackChunkName: "activity" */ '@anticrm/activity-resources')) addLocation(settingId, () => import(/* webpackChunkName: "setting" */ '@anticrm/setting-resources')) addLocation(telegramId, () => import(/* webpackChunkName: "telegram" */ '@anticrm/telegram-resources')) + addLocation(attachmentId, () => import(/* webpackChunkName: "attachment" */ '@anticrm/attachment-resources')) } diff --git a/models/all/package.json b/models/all/package.json index d45d133f5e..deb8963e82 100644 --- a/models/all/package.json +++ b/models/all/package.json @@ -43,6 +43,8 @@ "@anticrm/model-server-chunter": "~0.6.0", "@anticrm/model-server-recruit": "~0.6.0", "@anticrm/model-server-view": "~0.6.0", - "@anticrm/model-activity": "~0.6.0" + "@anticrm/model-activity": "~0.6.0", + "@anticrm/model-attachment": "~0.6.0" + } } diff --git a/models/all/src/index.ts b/models/all/src/index.ts index 467241d3c6..ee50974c3e 100644 --- a/models/all/src/index.ts +++ b/models/all/src/index.ts @@ -24,6 +24,7 @@ import { createModel as chunterModel } from '@anticrm/model-chunter' import { createModel as recruitModel } from '@anticrm/model-recruit' import { createModel as settingModel } from '@anticrm/model-setting' import { createModel as telegramModel } from '@anticrm/model-telegram' +import { createModel as attachmentModel } from '@anticrm/model-attachment' import { createModel as serverCoreModel } from '@anticrm/model-server-core' import { createModel as serverChunterModel } from '@anticrm/model-server-chunter' @@ -37,6 +38,7 @@ const builder = new Builder() coreModel(builder) activityModel(builder) +attachmentModel(builder) viewModel(builder) workbenchModel(builder) contactModel(builder) diff --git a/models/attachment/.eslintrc.js b/models/attachment/.eslintrc.js new file mode 100644 index 0000000000..c3c2c49417 --- /dev/null +++ b/models/attachment/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + extends: ['./node_modules/@anticrm/model-rig/profiles/default/config/eslint.config.json'], + parserOptions: { + tsconfigRootDir: __dirname, + project: './tsconfig.json' + } +} diff --git a/models/attachment/.npmignore b/models/attachment/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/models/attachment/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/models/attachment/config/rig.json b/models/attachment/config/rig.json new file mode 100644 index 0000000000..e9a9ee9add --- /dev/null +++ b/models/attachment/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/attachment/package.json b/models/attachment/package.json new file mode 100644 index 0000000000..4588603311 --- /dev/null +++ b/models/attachment/package.json @@ -0,0 +1,38 @@ +{ + "name": "@anticrm/model-attachment", + "version": "0.6.0", + "main": "lib/index.js", + "author": "Anticrm Platform Contributors", + "license": "EPL-2.0", + "scripts": { + "build": "heft build", + "build:watch": "tsc", + "lint:fix": "eslint --fix src", + "lint": "eslint src", + "format": "prettier --write src && eslint --fix src" + }, + "devDependencies": { + "@anticrm/model-rig": "~0.6.0", + "@typescript-eslint/eslint-plugin": "^5.4.0", + "eslint-plugin-import": "^2.25.3", + "eslint-plugin-promise": "^5.1.1", + "eslint-plugin-node": "^11.1.0", + "eslint": "^7.32.0", + "@types/heft-jest": "^1.0.2", + "@typescript-eslint/parser": "^5.4.0", + "eslint-config-standard-with-typescript": "^21.0.1", + "prettier": "^2.4.1", + "@rushstack/heft": "^0.41.1" + }, + "dependencies": { + "@anticrm/core": "~0.6.11", + "@anticrm/model": "~0.6.0", + "@anticrm/ui": "~0.6.0", + "@anticrm/attachment": "~0.6.0", + "@anticrm/attachment-resources": "~0.6.0", + "@anticrm/platform": "~0.6.5", + "@anticrm/model-core": "~0.6.0", + "@anticrm/model-view": "~0.6.0", + "@anticrm/activity": "~0.6.0" + } +} diff --git a/models/attachment/src/index.ts b/models/attachment/src/index.ts new file mode 100644 index 0000000000..bb1050c4a7 --- /dev/null +++ b/models/attachment/src/index.ts @@ -0,0 +1,64 @@ +// +// Copyright © 2020, 2021 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 } from '@anticrm/platform' +import { Builder, Model, Prop, UX, TypeString, TypeTimestamp } from '@anticrm/model' +import type { Domain } from '@anticrm/core' +import core, { TAttachedDoc } from '@anticrm/model-core' +import type { Attachment } from '@anticrm/attachment' +import activity from '@anticrm/activity' + +import view from '@anticrm/model-view' +import attachment from './plugin' + +export const DOMAIN_ATTACHMENT = 'attachment' as Domain + +@Model(attachment.class.Attachment, core.class.AttachedDoc, DOMAIN_ATTACHMENT) +@UX('File' as IntlString) +export class TAttachment extends TAttachedDoc implements Attachment { + @Prop(TypeString(), 'Name' as IntlString) + name!: string + + @Prop(TypeString(), 'File' as IntlString) + file!: string + + @Prop(TypeString(), 'Size' as IntlString) + size!: number + + @Prop(TypeString(), 'Type' as IntlString) + type!: string + + @Prop(TypeTimestamp(), 'Date' as IntlString) + lastModified!: number +} + +export function createModel (builder: Builder): void { + builder.createModel(TAttachment) + + builder.mixin(attachment.class.Attachment, core.class.Class, view.mixin.AttributePresenter, { + presenter: attachment.component.AttachmentPresenter + }) + + builder.createDoc(activity.class.TxViewlet, core.space.Model, { + objectClass: attachment.class.Attachment, + icon: attachment.icon.Attachment, + txClass: core.class.TxCreateDoc, + component: attachment.activity.TxAttachmentCreate, + label: attachment.string.AddAttachment, + display: 'emphasized' + }, attachment.ids.TxAttachmentCreate) +} + +export default attachment diff --git a/models/attachment/src/plugin.ts b/models/attachment/src/plugin.ts new file mode 100644 index 0000000000..cf8a325ca0 --- /dev/null +++ b/models/attachment/src/plugin.ts @@ -0,0 +1,38 @@ +// +// 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 { attachmentId } from '@anticrm/attachment' +import attachment from '@anticrm/attachment-resources/src/plugin' +import type { IntlString } from '@anticrm/platform' +import { mergeIds } from '@anticrm/platform' +import type { Ref } from '@anticrm/core' +import type { AnyComponent } from '@anticrm/ui' +import type { TxViewlet } from '@anticrm/activity' + +export default mergeIds(attachmentId, attachment, { + component: { + AttachmentsPresenter: '' as AnyComponent, + AttachmentPresenter: '' as AnyComponent + }, + string: { + AddAttachment: '' as IntlString + }, + ids: { + TxAttachmentCreate: '' as Ref + }, + activity: { + TxAttachmentCreate: '' as AnyComponent + } +}) diff --git a/models/attachment/tsconfig.json b/models/attachment/tsconfig.json new file mode 100644 index 0000000000..1d60db76b4 --- /dev/null +++ b/models/attachment/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/models/chunter/package.json b/models/chunter/package.json index 511d759ed3..65eaccbe33 100644 --- a/models/chunter/package.json +++ b/models/chunter/package.json @@ -34,6 +34,8 @@ "@anticrm/platform": "~0.6.5", "@anticrm/model-core": "~0.6.0", "@anticrm/model-view": "~0.6.0", + "@anticrm/model-attachment": "~0.6.0", + "@anticrm/attachment": "~0.6.0", "@anticrm/model-workbench": "~0.6.1", "@anticrm/activity": "~0.6.0" } diff --git a/models/chunter/src/index.ts b/models/chunter/src/index.ts index 2b267e37aa..a645f4a7d8 100644 --- a/models/chunter/src/index.ts +++ b/models/chunter/src/index.ts @@ -14,13 +14,15 @@ // import type { IntlString } from '@anticrm/platform' -import { Builder, Model, Prop, UX, TypeString, Index, TypeTimestamp } from '@anticrm/model' +import { Builder, Model, Prop, UX, TypeString, Index } from '@anticrm/model' import type { Ref, Doc, Class, Domain } from '@anticrm/core' import { IndexKind } from '@anticrm/core' import core, { TSpace, TDoc, TAttachedDoc } from '@anticrm/model-core' import type { Backlink, Channel, Message, Comment, Attachment } from '@anticrm/chunter' import type { AnyComponent } from '@anticrm/ui' import activity from '@anticrm/activity' +import { TAttachment as TOriginAttachment } from '@anticrm/model-attachment' +import attachment from '@anticrm/attachment' import workbench from '@anticrm/model-workbench' @@ -29,7 +31,6 @@ import chunter from './plugin' export const DOMAIN_CHUNTER = 'chunter' as Domain export const DOMAIN_COMMENT = 'comment' as Domain -export const DOMAIN_ATTACHMENT = 'attachment' as Domain @Model(chunter.class.Channel, core.class.Space) @UX(chunter.string.Channel, chunter.icon.Hashtag) @@ -50,33 +51,19 @@ export class TComment extends TAttachedDoc implements Comment { message!: string } +@Model(chunter.class.Attachment, attachment.class.Attachment) +@UX('File' as IntlString) +export class TAttachment extends TOriginAttachment implements Attachment { +} + @Model(chunter.class.Backlink, chunter.class.Comment) export class TBacklink extends TComment implements Backlink { backlinkId!: Ref backlinkClass!: Ref> } -@Model(chunter.class.Attachment, core.class.AttachedDoc, DOMAIN_ATTACHMENT) -@UX('File' as IntlString) -export class TAttachment extends TAttachedDoc implements Attachment { - @Prop(TypeString(), 'Name' as IntlString) - name!: string - - @Prop(TypeString(), 'File' as IntlString) - file!: string - - @Prop(TypeString(), 'Size' as IntlString) - size!: number - - @Prop(TypeString(), 'Type' as IntlString) - type!: string - - @Prop(TypeTimestamp(), 'Date' as IntlString) - lastModified!: number -} - export function createModel (builder: Builder): void { - builder.createModel(TChannel, TMessage, TComment, TBacklink, TAttachment) + builder.createModel(TChannel, TMessage, TComment, TBacklink) builder.mixin(chunter.class.Channel, core.class.Class, workbench.mixin.SpaceView, { view: { class: chunter.class.Message @@ -124,10 +111,6 @@ export function createModel (builder: Builder): void { members: [] }) - builder.mixin(chunter.class.Attachment, core.class.Class, view.mixin.AttributePresenter, { - presenter: chunter.component.AttachmentPresenter - }) - builder.mixin(chunter.class.Comment, core.class.Class, view.mixin.AttributePresenter, { presenter: chunter.component.CommentPresenter }) @@ -151,15 +134,6 @@ export function createModel (builder: Builder): void { display: 'inline', hideOnRemove: true }, chunter.ids.TxCommentRemove) - - builder.createDoc(activity.class.TxViewlet, core.space.Model, { - objectClass: chunter.class.Attachment, - icon: chunter.icon.Attachment, - txClass: core.class.TxCreateDoc, - component: chunter.activity.TxAttachmentCreate, - label: chunter.string.AddAttachment, - display: 'emphasized' - }, chunter.ids.TxAttachmentCreate) } export default chunter diff --git a/models/chunter/src/plugin.ts b/models/chunter/src/plugin.ts index 4d6202b8d9..1226a95820 100644 --- a/models/chunter/src/plugin.ts +++ b/models/chunter/src/plugin.ts @@ -24,26 +24,21 @@ import type { TxViewlet } from '@anticrm/activity' export default mergeIds(chunterId, chunter, { component: { - AttachmentsPresenter: '' as AnyComponent, - AttachmentPresenter: '' as AnyComponent, CommentsPresenter: '' as AnyComponent, CommentPresenter: '' as AnyComponent }, string: { ApplicationLabelChunter: '' as IntlString, - LeftComment: '' as IntlString, - AddAttachment: '' as IntlString + LeftComment: '' as IntlString }, viewlet: { Chat: '' as Ref }, ids: { TxCommentCreate: '' as Ref, - TxCommentRemove: '' as Ref, - TxAttachmentCreate: '' as Ref + TxCommentRemove: '' as Ref }, activity: { - TxCommentCreate: '' as AnyComponent, - TxAttachmentCreate: '' as AnyComponent + TxCommentCreate: '' as AnyComponent } }) diff --git a/models/contact/package.json b/models/contact/package.json index 2e4ce4b832..d95d4a1963 100644 --- a/models/contact/package.json +++ b/models/contact/package.json @@ -26,6 +26,8 @@ }, "dependencies": { "@anticrm/model-core": "~0.6.0", + "@anticrm/model-workbench": "~0.6.0", + "@anticrm/model-attachment": "~0.6.0", "@anticrm/model-view": "~0.6.0", "@anticrm/model": "~0.6.0", "@anticrm/core": "~0.6.11", diff --git a/models/contact/src/index.ts b/models/contact/src/index.ts index 51b99ac0dd..93a7b68cc4 100644 --- a/models/contact/src/index.ts +++ b/models/contact/src/index.ts @@ -18,10 +18,11 @@ import { DOMAIN_MODEL, IndexKind } from '@anticrm/core' import { Builder, Model, Prop, TypeString, UX, Index } from '@anticrm/model' import type { IntlString, Asset } from '@anticrm/platform' -import core, { TAccount, TDoc, TType } from '@anticrm/model-core' -import type { Contact, Person, Organization, Employee, Channel, ChannelProvider, EmployeeAccount } from '@anticrm/contact' - +import core, { TAccount, TDoc, TSpace, TType } from '@anticrm/model-core' +import type { Contact, Person, Persons, Organization, Organizations, Employee, Channel, ChannelProvider, EmployeeAccount } from '@anticrm/contact' +import workbench from '@anticrm/model-workbench' import view from '@anticrm/model-view' +import attachment from '@anticrm/model-attachment' import { ids as contact } from './plugin' export const DOMAIN_CONTACT = 'contact' as Domain @@ -53,6 +54,12 @@ export class TContact extends TDoc implements Contact { @Prop(TypeChannels(), 'Contact Info' as IntlString) channels!: Channel[] + + @Prop(TypeString(), 'Attachments' as IntlString) + attachments?: number + + @Prop(TypeString(), 'Comments' as IntlString) + comments?: number } @Model(contact.class.Person, contact.class.Contact) @@ -63,6 +70,7 @@ export class TPerson extends TContact implements Person { } @Model(contact.class.Organization, contact.class.Contact) +@UX('Organization' as IntlString) export class TOrganization extends TContact implements Organization { } @@ -76,8 +84,89 @@ export class TEmployeeAccount extends TAccount implements EmployeeAccount { name!: string } +@Model(contact.class.Organizations, core.class.Space) +@UX(contact.string.Organizations, contact.icon.Company) +export class TOrganizations extends TSpace implements Organizations {} + +@Model(contact.class.Persons, core.class.Space) +@UX(contact.string.Persons, contact.icon.Person) +export class TPersons extends TSpace implements Persons {} + export function createModel (builder: Builder): void { - builder.createModel(TChannelProvider, TTypeChannels, TContact, TPerson, TOrganization, TEmployee, TEmployeeAccount) + builder.createModel(TChannelProvider, TTypeChannels, TContact, TPerson, TPersons, TOrganization, TOrganizations, TEmployee, TEmployeeAccount) + + builder.mixin(contact.class.Persons, core.class.Class, workbench.mixin.SpaceView, { + view: { + class: contact.class.Person, + createItemDialog: contact.component.CreatePerson + } + }) + + builder.mixin(contact.class.Organizations, core.class.Class, workbench.mixin.SpaceView, { + view: { + class: contact.class.Organization, + createItemDialog: contact.component.CreateOrganization + } + }) + + builder.createDoc(workbench.class.Application, core.space.Model, { + label: contact.string.Contacts, + icon: contact.icon.Person, + hidden: false, + navigatorModel: { + spaces: [ + { + label: contact.string.Persons, + spaceClass: contact.class.Persons, + addSpaceLabel: contact.string.CreatePersons, + createComponent: contact.component.CreatePersons + }, + { + label: contact.string.Organizations, + spaceClass: contact.class.Organizations, + addSpaceLabel: contact.string.CreateOrganizations, + createComponent: contact.component.CreateOrganizations + } + ] + } + }) + + builder.createDoc(view.class.Viewlet, core.space.Model, { + attachTo: contact.class.Person, + descriptor: view.viewlet.Table, + open: contact.component.EditPerson, + // eslint-disable-next-line @typescript-eslint/consistent-type-assertions + options: { }, + config: [ + '', + 'city', + { presenter: attachment.component.AttachmentsPresenter, label: 'Files' }, + 'modifiedOn', + 'channels' + ] + }) + + builder.createDoc(view.class.Viewlet, core.space.Model, { + attachTo: contact.class.Organization, + descriptor: view.viewlet.Table, + open: contact.component.EditOrganization, + // eslint-disable-next-line @typescript-eslint/consistent-type-assertions + options: { }, + config: [ + '', + { presenter: attachment.component.AttachmentsPresenter, label: 'Files' }, + 'modifiedOn', + 'channels' + ] + }) + + builder.mixin(contact.class.Person, core.class.Class, view.mixin.ObjectEditor, { + editor: contact.component.EditPerson + }) + + builder.mixin(contact.class.Organization, core.class.Class, view.mixin.ObjectEditor, { + editor: contact.component.EditOrganization + }) builder.mixin(contact.class.TypeChannels, core.class.Class, view.mixin.AttributePresenter, { presenter: contact.component.ChannelsPresenter @@ -123,6 +212,10 @@ export function createModel (builder: Builder): void { builder.mixin(contact.class.Person, core.class.Class, view.mixin.AttributePresenter, { presenter: contact.component.PersonPresenter }) + + builder.mixin(contact.class.Organization, core.class.Class, view.mixin.AttributePresenter, { + presenter: contact.component.OrganizationPresenter + }) } export { contact as default } diff --git a/models/contact/src/plugin.ts b/models/contact/src/plugin.ts index 19b7a54ba0..d7dd8cd2d4 100644 --- a/models/contact/src/plugin.ts +++ b/models/contact/src/plugin.ts @@ -13,7 +13,7 @@ // limitations under the License. // -import { mergeIds } from '@anticrm/platform' +import { IntlString, mergeIds } from '@anticrm/platform' import type { Ref, Class, Type } from '@anticrm/core' import contact, { contactId } from '@anticrm/contact' import type { Channel } from '@anticrm/contact' @@ -23,7 +23,21 @@ import {} from '@anticrm/core' export const ids = mergeIds(contactId, contact, { component: { PersonPresenter: '' as AnyComponent, - ChannelsPresenter: '' as AnyComponent + ChannelsPresenter: '' as AnyComponent, + CreatePerson: '' as AnyComponent, + EditPerson: '' as AnyComponent, + EditOrganization: '' as AnyComponent, + CreateOrganization: '' as AnyComponent, + CreatePersons: '' as AnyComponent, + CreateOrganizations: '' as AnyComponent, + OrganizationPresenter: '' as AnyComponent + }, + string: { + Organizations: '' as IntlString, + Persons: '' as IntlString, + Contacts: '' as IntlString, + CreatePersons: '' as IntlString, + CreateOrganizations: '' as IntlString }, class: { TypeChannels: '' as Ref>> diff --git a/models/recruit/package.json b/models/recruit/package.json index 12c3445a6d..8ec0746e36 100644 --- a/models/recruit/package.json +++ b/models/recruit/package.json @@ -37,6 +37,7 @@ "@anticrm/recruit": "~0.6.0", "@anticrm/recruit-resources": "~0.6.0", "@anticrm/chunter": "~0.6.0", + "@anticrm/model-attachment": "~0.6.0", "@anticrm/model-chunter": "~0.6.0", "@anticrm/view": "~0.6.0" } diff --git a/models/recruit/src/index.ts b/models/recruit/src/index.ts index 48380665ef..ffa0f60d6a 100644 --- a/models/recruit/src/index.ts +++ b/models/recruit/src/index.ts @@ -24,6 +24,7 @@ import workbench from '@anticrm/model-workbench' import type { IntlString } from '@anticrm/platform' import type { Applicant, Candidate, Candidates, Vacancy } from '@anticrm/recruit' import recruit from './plugin' +import attachment from '@anticrm/model-attachment' export const DOMAIN_RECRUIT = 'recruit' as Domain @@ -42,7 +43,7 @@ export class TVacancy extends TSpaceWithStates implements Vacancy { @Prop(TypeString(), 'Location' as IntlString, recruit.icon.Location) location?: string - @Prop(TypeString(), 'Company' as IntlString, recruit.icon.Company) + @Prop(TypeString(), 'Company' as IntlString, contact.icon.Company) company?: string } @@ -157,7 +158,7 @@ export function createModel (builder: Builder): void { 'title', 'city', { presenter: recruit.component.ApplicationsPresenter, label: 'Apps' }, - { presenter: chunter.component.AttachmentsPresenter, label: 'Files' }, + { presenter: attachment.component.AttachmentsPresenter, label: 'Files' }, { presenter: chunter.component.CommentsPresenter, label: 'Comments' }, 'modifiedOn', 'channels' @@ -180,7 +181,7 @@ export function createModel (builder: Builder): void { '$lookup.attachedTo', '$lookup.state', '$lookup.attachedTo.city', - { presenter: chunter.component.AttachmentsPresenter, label: 'Files' }, + { presenter: attachment.component.AttachmentsPresenter, label: 'Files' }, { presenter: chunter.component.CommentsPresenter, label: 'Comments' }, 'modifiedOn', '$lookup.attachedTo.channels'] diff --git a/models/task/package.json b/models/task/package.json index 9fcefd250f..d579a0401c 100644 --- a/models/task/package.json +++ b/models/task/package.json @@ -34,6 +34,7 @@ "@anticrm/model-view": "~0.6.0", "@anticrm/model-workbench": "~0.6.1", "@anticrm/model-contact": "~0.6.1", + "@anticrm/model-attachment": "~0.6.0", "@anticrm/task": "~0.6.0", "@anticrm/model-chunter": "~0.6.0", "@anticrm/workbench": "~0.6.1" diff --git a/models/task/src/index.ts b/models/task/src/index.ts index 335f20e684..6e47bed590 100644 --- a/models/task/src/index.ts +++ b/models/task/src/index.ts @@ -13,6 +13,7 @@ // limitations under the License. // +import attachment from '@anticrm/model-attachment' import type { Employee } from '@anticrm/contact' import contact from '@anticrm/contact' import type { Doc, DocWithState, Domain, FindOptions, Ref } from '@anticrm/core' @@ -94,7 +95,7 @@ export function createModel (builder: Builder): void { '', 'name', '$lookup.assignee', - { presenter: chunter.component.AttachmentsPresenter, label: 'Files' }, + { presenter: attachment.component.AttachmentsPresenter, label: 'Files' }, { presenter: chunter.component.CommentsPresenter, label: 'Comments' }, 'modifiedOn' ] diff --git a/plugins/recruit-resources/src/components/AttributesBar.svelte b/packages/presentation/src/components/AttributesBar.svelte similarity index 83% rename from plugins/recruit-resources/src/components/AttributesBar.svelte rename to packages/presentation/src/components/AttributesBar.svelte index dc8e0456e0..27771c9c39 100644 --- a/plugins/recruit-resources/src/components/AttributesBar.svelte +++ b/packages/presentation/src/components/AttributesBar.svelte @@ -1,5 +1,6 @@ - - {#if value.attachments && value.attachments > 0}
diff --git a/plugins/chunter-resources/src/components/activity/TxAttachmentCreate.svelte b/plugins/attachment-resources/src/components/activity/TxAttachmentCreate.svelte similarity index 84% rename from plugins/chunter-resources/src/components/activity/TxAttachmentCreate.svelte rename to plugins/attachment-resources/src/components/activity/TxAttachmentCreate.svelte index 48ee772526..5c806f8a83 100644 --- a/plugins/chunter-resources/src/components/activity/TxAttachmentCreate.svelte +++ b/plugins/attachment-resources/src/components/activity/TxAttachmentCreate.svelte @@ -14,10 +14,10 @@ --> diff --git a/plugins/task-resources/src/components/icons/UploadDuo.svelte b/plugins/attachment-resources/src/components/icons/UploadDuo.svelte similarity index 100% rename from plugins/task-resources/src/components/icons/UploadDuo.svelte rename to plugins/attachment-resources/src/components/icons/UploadDuo.svelte diff --git a/plugins/attachment-resources/src/index.ts b/plugins/attachment-resources/src/index.ts new file mode 100644 index 0000000000..d40afb3e1a --- /dev/null +++ b/plugins/attachment-resources/src/index.ts @@ -0,0 +1,32 @@ +// +// 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 AttachmentsPresenter from './components/AttachmentsPresenter.svelte' +import AttachmentPresenter from './components/AttachmentPresenter.svelte' +import TxAttachmentCreate from './components/activity/TxAttachmentCreate.svelte' +import Attachments from './components/Attachments.svelte' + +export { AttachmentsPresenter } + +export default async () => ({ + component: { + AttachmentsPresenter, + AttachmentPresenter, + Attachments + }, + activity: { + TxAttachmentCreate + } +}) diff --git a/plugins/attachment-resources/src/plugin.ts b/plugins/attachment-resources/src/plugin.ts new file mode 100644 index 0000000000..1d9e1e585c --- /dev/null +++ b/plugins/attachment-resources/src/plugin.ts @@ -0,0 +1,26 @@ +// +// 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 type { IntlString } from '@anticrm/platform' + +import attachment, { attachmentId } from '@anticrm/attachment' + +export default mergeIds(attachmentId, attachment, { + string: { + NoAttachments: '' as IntlString, + UploadDropFilesHere: '' as IntlString + } +}) diff --git a/plugins/task-resources/src/utils.ts b/plugins/attachment-resources/src/utils.ts similarity index 88% rename from plugins/task-resources/src/utils.ts rename to plugins/attachment-resources/src/utils.ts index c45e32a2ed..f61a3d32d9 100644 --- a/plugins/task-resources/src/utils.ts +++ b/plugins/attachment-resources/src/utils.ts @@ -14,12 +14,9 @@ // limitations under the License. // -import type { Class, Data, Doc, Ref, Space, State } from '@anticrm/core' +import type { Doc, Ref, Space } from '@anticrm/core' import login from '@anticrm/login' import { getMetadata } from '@anticrm/platform' -import { Project } from '@anticrm/task' -import core from '@anticrm/core' -import view, { Kanban } from '@anticrm/view' export async function uploadFile (space: Ref, file: File, attachedTo: Ref): Promise { console.log(file) diff --git a/plugins/attachment-resources/svelte.config.js b/plugins/attachment-resources/svelte.config.js new file mode 100644 index 0000000000..944a06f73e --- /dev/null +++ b/plugins/attachment-resources/svelte.config.js @@ -0,0 +1,5 @@ +const sveltePreprocess = require('svelte-preprocess') + +module.exports = { + preprocess: sveltePreprocess() +}; \ No newline at end of file diff --git a/plugins/attachment-resources/tsconfig.json b/plugins/attachment-resources/tsconfig.json new file mode 100644 index 0000000000..cabe5aefad --- /dev/null +++ b/plugins/attachment-resources/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "moduleResolution": "node", + "target": "esnext", + "module": "esnext", + "declaration": true, + "outDir": "./lib", + "strict": true, + "esModuleInterop": true, + "lib": [ + "esnext", + "dom" + ] + } +} \ No newline at end of file diff --git a/plugins/attachment/.eslintrc.js b/plugins/attachment/.eslintrc.js new file mode 100644 index 0000000000..5da5872d4a --- /dev/null +++ b/plugins/attachment/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + extends: ['./node_modules/@anticrm/platform-rig/profiles/default/config/eslint.config.json'], + parserOptions: { + tsconfigRootDir: __dirname, + project: './tsconfig.json' + } +} diff --git a/plugins/attachment/.npmignore b/plugins/attachment/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/plugins/attachment/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/plugins/attachment/config/rig.json b/plugins/attachment/config/rig.json new file mode 100644 index 0000000000..af1257a896 --- /dev/null +++ b/plugins/attachment/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/platform-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/plugins/attachment/package.json b/plugins/attachment/package.json new file mode 100644 index 0000000000..5916a0e684 --- /dev/null +++ b/plugins/attachment/package.json @@ -0,0 +1,33 @@ +{ + "name": "@anticrm/attachment", + "version": "0.6.0", + "main": "lib/index.js", + "author": "Anticrm Platform Contributors", + "license": "EPL-2.0", + "scripts": { + "build": "heft build", + "build:watch": "tsc", + "lint:fix": "eslint --fix src", + "lint": "eslint src", + "format": "prettier --write src && eslint --fix src" + }, + "devDependencies": { + "@anticrm/platform-rig": "~0.6.0", + "@types/heft-jest": "^1.0.2", + "@typescript-eslint/eslint-plugin": "^5.4.0", + "eslint-plugin-import": "^2.25.3", + "eslint-plugin-promise": "^5.1.1", + "eslint-plugin-node": "^11.1.0", + "eslint": "^7.32.0", + "@typescript-eslint/parser": "^5.4.0", + "eslint-config-standard-with-typescript": "^21.0.1", + "prettier": "^2.4.1", + "@rushstack/heft": "^0.41.1", + "typescript": "^4.3.5" + }, + "dependencies": { + "@anticrm/platform": "~0.6.5", + "@anticrm/ui": "~0.6.0", + "@anticrm/core": "~0.6.11" + } +} diff --git a/plugins/recruit-resources/src/components/icons/Mail.svelte b/plugins/attachment/src/index.ts similarity index 50% rename from plugins/recruit-resources/src/components/icons/Mail.svelte rename to plugins/attachment/src/index.ts index 1431ce6b47..3e41f1953d 100644 --- a/plugins/recruit-resources/src/components/icons/Mail.svelte +++ b/plugins/attachment/src/index.ts @@ -1,24 +1,48 @@ - +// - +import type { Ref, Class, AttachedDoc } from '@anticrm/core' +import { plugin } from '@anticrm/platform' +import type { Asset, Plugin } from '@anticrm/platform' +import { AnyComponent } from '@anticrm/ui' - - - +/** + * @public + */ +export interface Attachment extends AttachedDoc { + name: string + file: string + size: number + type: string + lastModified: number +} + +/** + * @public + */ +export const attachmentId = 'attachment' as Plugin + +export default plugin(attachmentId, { + component: { + Attachments: '' as AnyComponent + }, + icon: { + Attachment: '' as Asset + }, + class: { + Attachment: '' as Ref> + } +}) diff --git a/plugins/attachment/tsconfig.json b/plugins/attachment/tsconfig.json new file mode 100644 index 0000000000..32045300ce --- /dev/null +++ b/plugins/attachment/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "./node_modules/@anticrm/platform-rig/profiles/default/tsconfig.json", + + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib", + "lib": ["esnext", "dom"] + } +} \ No newline at end of file diff --git a/plugins/chunter-assets/src/index.ts b/plugins/chunter-assets/src/index.ts index b53a66cb29..02ba6579f9 100644 --- a/plugins/chunter-assets/src/index.ts +++ b/plugins/chunter-assets/src/index.ts @@ -20,8 +20,7 @@ const icons = require('../assets/icons.svg') loadMetadata(chunter.icon, { Chunter: `${icons}#chunter`, Hashtag: `${icons}#hashtag`, - Lock: `${icons}#lock`, - Attachment: `${icons}#chunter` + Lock: `${icons}#lock` }) addStringsLoader(chunterId, async (lang: string) => await import(`../lang/${lang}.json`)) diff --git a/plugins/chunter-resources/package.json b/plugins/chunter-resources/package.json index 1701f1625c..bd3f52f073 100644 --- a/plugins/chunter-resources/package.json +++ b/plugins/chunter-resources/package.json @@ -38,7 +38,6 @@ "svelte": "^3.37.0", "@anticrm/text-editor": "~0.6.0", "@anticrm/contact": "~0.6.2", - "@anticrm/view-resources": "~0.6.0", - "filesize": "^8.0.3" + "@anticrm/view-resources": "~0.6.0" } } diff --git a/plugins/chunter-resources/src/components/FileGroup.svelte b/plugins/chunter-resources/src/components/FileGroup.svelte deleted file mode 100644 index ea2b12231e..0000000000 --- a/plugins/chunter-resources/src/components/FileGroup.svelte +++ /dev/null @@ -1,84 +0,0 @@ - - - - -
- - {Object.values(files).length} files -
- {#each Object.values(files) as file} -
- { showPopup(PDFViewer, { file: file.file }, 'right') } }/> -
- {/each} -
-
- - diff --git a/plugins/chunter-resources/src/index.ts b/plugins/chunter-resources/src/index.ts index 7d0c22269f..df3e75ea15 100644 --- a/plugins/chunter-resources/src/index.ts +++ b/plugins/chunter-resources/src/index.ts @@ -15,26 +15,20 @@ import CreateChannel from './components/CreateChannel.svelte' import ChannelView from './components/ChannelView.svelte' -import AttachmentsPresenter from './components/AttachmentsPresenter.svelte' -import AttachmentPresenter from './components/AttachmentPresenter.svelte' import CommentPresenter from './components/CommentPresenter.svelte' import CommentsPresenter from './components/CommentsPresenter.svelte' import TxCommentCreate from './components/activity/TxCommentCreate.svelte' -import TxAttachmentCreate from './components/activity/TxAttachmentCreate.svelte' -export { AttachmentsPresenter, CommentsPresenter } +export { CommentsPresenter } export default async () => ({ component: { CreateChannel, ChannelView, - AttachmentsPresenter, - AttachmentPresenter, CommentPresenter, CommentsPresenter }, activity: { - TxCommentCreate, - TxAttachmentCreate + TxCommentCreate } }) diff --git a/plugins/chunter/package.json b/plugins/chunter/package.json index 1aa9175182..1386eade50 100644 --- a/plugins/chunter/package.json +++ b/plugins/chunter/package.json @@ -26,6 +26,7 @@ "typescript": "^4.3.5" }, "dependencies": { + "@anticrm/attachment": "~0.6.0", "@anticrm/platform": "~0.6.5", "@anticrm/core": "~0.6.11" } diff --git a/plugins/chunter/src/index.ts b/plugins/chunter/src/index.ts index 6ad1baebc4..e78f72e6c4 100644 --- a/plugins/chunter/src/index.ts +++ b/plugins/chunter/src/index.ts @@ -16,6 +16,7 @@ import { IntlString, plugin } from '@anticrm/platform' import type { Asset, Plugin } from '@anticrm/platform' import type { Space, Doc, Ref, Class, AttachedDoc } from '@anticrm/core' +import type { Attachment as OriginAttachment } from '@anticrm/attachment' /** * @public @@ -47,13 +48,7 @@ export interface Backlink extends Comment { /** * @public */ -export interface Attachment extends AttachedDoc { - name: string - file: string - size: number - type: string - lastModified: number -} +export interface Attachment extends OriginAttachment {} /** * @public @@ -64,8 +59,7 @@ export default plugin(chunterId, { icon: { Chunter: '' as Asset, Hashtag: '' as Asset, - Lock: '' as Asset, - Attachment: '' as Asset + Lock: '' as Asset }, class: { Message: '' as Ref>, diff --git a/plugins/contact-assets/assets/icons.svg b/plugins/contact-assets/assets/icons.svg index 6abfc11b47..f7d5d79316 100644 --- a/plugins/contact-assets/assets/icons.svg +++ b/plugins/contact-assets/assets/icons.svg @@ -40,4 +40,12 @@ + + + + + + + + diff --git a/plugins/contact-assets/lang/en.json b/plugins/contact-assets/lang/en.json new file mode 100644 index 0000000000..ece561a169 --- /dev/null +++ b/plugins/contact-assets/lang/en.json @@ -0,0 +1,18 @@ +{ + "string": { + "Apply": "Apply", + "Contacts": "Contacts", + "Persons": "Persons", + "Organizations": "Organizations", + "CreatePerson": "Create person", + "CreatePersons": "Create persons folder", + "CreateOrganizations": "Create organizations folder", + "Name": "Name", + "SelectFolder": "Select folder", + "OrganizationsFolder": "Organizations folder", + "PersonsFolder": "Persons folder", + "AddSocialLinks": "Add social links", + "MakePrivate": "Make private", + "MakePrivateDescription": "Only members can see it" + } +} \ No newline at end of file diff --git a/plugins/contact-assets/src/index.ts b/plugins/contact-assets/src/index.ts index 5064de3db4..67bd473387 100644 --- a/plugins/contact-assets/src/index.ts +++ b/plugins/contact-assets/src/index.ts @@ -13,11 +13,11 @@ // limitations under the License. // -import { loadMetadata } from '@anticrm/platform' -import chunter from '@anticrm/contact' +import { addStringsLoader, loadMetadata } from '@anticrm/platform' +import contact, { contactId } from '@anticrm/contact' const icons = require('../assets/icons.svg') -loadMetadata(chunter.icon, { +loadMetadata(contact.icon, { Phone: `${icons}#phone`, Email: `${icons}#email`, Discord: `${icons}#discord`, @@ -29,5 +29,9 @@ loadMetadata(chunter.icon, { VK: `${icons}#vk`, WhatsApp: `${icons}#whatsapp`, Youtube: `${icons}#youtube`, - GitHub: `${icons}#github` + GitHub: `${icons}#github`, + Person: `${icons}#person`, + Company: `${icons}#company` }) +addStringsLoader(contactId, async (lang: string) => await import(`../lang/${lang}.json`)) + diff --git a/plugins/contact-resources/package.json b/plugins/contact-resources/package.json index fae01b4862..a6ff5546d5 100644 --- a/plugins/contact-resources/package.json +++ b/plugins/contact-resources/package.json @@ -36,6 +36,8 @@ "@anticrm/ui": "~0.6.0", "@anticrm/presentation": "~0.6.2", "@anticrm/core": "~0.6.11", - "@anticrm/view": "~0.6.0" + "@anticrm/view": "~0.6.0", + "@anticrm/attachment": "~0.6.0", + "@anticrm/panel": "~0.6.0" } } diff --git a/plugins/contact-resources/src/components/CreateOrganization.svelte b/plugins/contact-resources/src/components/CreateOrganization.svelte new file mode 100644 index 0000000000..092a325618 --- /dev/null +++ b/plugins/contact-resources/src/components/CreateOrganization.svelte @@ -0,0 +1,95 @@ + + + + + 0} + spaceClass={contact.class.Organizations} + spaceLabel={contact.string.OrganizationsFolder} + spacePlaceholder={contact.string.SelectFolder} + bind:space={_space} + on:close={() => { dispatch('close') }}> + +
+ +
+
+
+
+ +
+ {#if !object.channels || object.channels.length === 0} + showPopup(SocialEditor, { values: object.channels ?? [] }, ev.target, (result) => { object.channels = result })} /> + + {:else} + +
+ showPopup(SocialEditor, { values: object.channels ?? [] }, ev.target, (result) => { object.channels = result })} /> +
+ {/if} +
+
+ + diff --git a/plugins/contact-resources/src/components/CreateOrganizations.svelte b/plugins/contact-resources/src/components/CreateOrganizations.svelte new file mode 100644 index 0000000000..449ecf1b37 --- /dev/null +++ b/plugins/contact-resources/src/components/CreateOrganizations.svelte @@ -0,0 +1,55 @@ + + + + + { dispatch('close') }} +> + + + + + diff --git a/plugins/contact-resources/src/components/CreatePerson.svelte b/plugins/contact-resources/src/components/CreatePerson.svelte new file mode 100644 index 0000000000..bbf3bd21dd --- /dev/null +++ b/plugins/contact-resources/src/components/CreatePerson.svelte @@ -0,0 +1,96 @@ + + + + + 0 && lastName.length > 0} + spaceClass={contact.class.Persons} + spaceLabel={contact.string.PersonsFolder} + spacePlaceholder={contact.string.SelectFolder} + bind:space={_space} + on:close={() => { dispatch('close') }}> + +
+
+ +
+
+
+
+
+
+
+ +
+ {#if !object.channels || object.channels.length === 0} + showPopup(SocialEditor, { values: object.channels ?? [] }, ev.target, (result) => { object.channels = result })} /> + + {:else} + +
+ showPopup(SocialEditor, { values: object.channels ?? [] }, ev.target, (result) => { object.channels = result })} /> +
+ {/if} +
+
+ + diff --git a/plugins/contact-resources/src/components/CreatePersons.svelte b/plugins/contact-resources/src/components/CreatePersons.svelte new file mode 100644 index 0000000000..2b3782a38f --- /dev/null +++ b/plugins/contact-resources/src/components/CreatePersons.svelte @@ -0,0 +1,55 @@ + + + + + { dispatch('close') }} +> + + + + + diff --git a/plugins/contact-resources/src/components/EditOrganization.svelte b/plugins/contact-resources/src/components/EditOrganization.svelte new file mode 100644 index 0000000000..6ed7769fbe --- /dev/null +++ b/plugins/contact-resources/src/components/EditOrganization.svelte @@ -0,0 +1,103 @@ + + + + +{#if object !== undefined} + { dispatch('close') }}> +
+ +
+
+
+ {#if !object.channels || object.channels.length === 0} + showPopup(contact.component.SocialEditor, { values: object.channels ?? [] }, ev.target, (result) => { saveChannels(result) })} /> + + {:else} + { + if (ev.detail.presenter) { + fullSize = true + rightSection = ev.detail.presenter + } + }} /> +
+ showPopup(contact.component.SocialEditor, { values: object.channels ?? [] }, ev.target, (result) => { saveChannels(result) })} /> +
+ {/if} +
+
+
+ +
+ +
+
+{/if} + + diff --git a/plugins/contact-resources/src/components/EditPerson.svelte b/plugins/contact-resources/src/components/EditPerson.svelte new file mode 100644 index 0000000000..e3438bc70b --- /dev/null +++ b/plugins/contact-resources/src/components/EditPerson.svelte @@ -0,0 +1,105 @@ + + + + +{#if object !== undefined} + { dispatch('close') }}> + + +
+
+ +
+
+
+
+
+ {#if !object.channels || object.channels.length === 0} + showPopup(contact.component.SocialEditor, { values: object.channels ?? [] }, ev.target, (result) => { saveChannels(result) })} /> + + {:else} + { + if (ev.detail.presenter) { + fullSize = true + rightSection = ev.detail.presenter + } + }} /> +
+ showPopup(contact.component.SocialEditor, { values: object.channels ?? [] }, ev.target, (result) => { saveChannels(result) })} /> +
+ {/if} +
+
+
+ +
+ +
+
+{/if} + + diff --git a/plugins/contact-resources/src/components/OrganizationPresenter.svelte b/plugins/contact-resources/src/components/OrganizationPresenter.svelte new file mode 100644 index 0000000000..225d2d2ad4 --- /dev/null +++ b/plugins/contact-resources/src/components/OrganizationPresenter.svelte @@ -0,0 +1,62 @@ + + + + +
+
+
{value.name}
+
+ + diff --git a/plugins/contact-resources/src/components/PersonPresenter.svelte b/plugins/contact-resources/src/components/PersonPresenter.svelte index 8de962ce6f..1455fae4a8 100644 --- a/plugins/contact-resources/src/components/PersonPresenter.svelte +++ b/plugins/contact-resources/src/components/PersonPresenter.svelte @@ -41,7 +41,7 @@ async function onClick() { diff --git a/plugins/recruit-resources/src/components/icons/Twitter.svelte b/plugins/contact-resources/src/components/icons/Company.svelte similarity index 65% rename from plugins/recruit-resources/src/components/icons/Twitter.svelte rename to plugins/contact-resources/src/components/icons/Company.svelte index 61625b252b..a125c553dd 100644 --- a/plugins/recruit-resources/src/components/icons/Twitter.svelte +++ b/plugins/contact-resources/src/components/icons/Company.svelte @@ -16,9 +16,9 @@ - + diff --git a/plugins/contact-resources/src/index.ts b/plugins/contact-resources/src/index.ts index f104d52c4e..118b9da57e 100644 --- a/plugins/contact-resources/src/index.ts +++ b/plugins/contact-resources/src/index.ts @@ -15,11 +15,27 @@ // import PersonPresenter from './components/PersonPresenter.svelte' +import OrganizationPresenter from './components/OrganizationPresenter.svelte' import ChannelsPresenter from './components/ChannelsPresenter.svelte' +import CreatePerson from './components/CreatePerson.svelte' +import CreateOrganization from './components/CreateOrganization.svelte' +import EditPerson from './components/EditPerson.svelte' +import EditOrganization from './components/EditOrganization.svelte' +import CreatePersons from './components/CreatePersons.svelte' +import CreateOrganizations from './components/CreateOrganizations.svelte' +import SocialEditor from './components/SocialEditor.svelte' export default async () => ({ component: { PersonPresenter, - ChannelsPresenter + OrganizationPresenter, + ChannelsPresenter, + CreatePerson, + CreateOrganization, + EditPerson, + EditOrganization, + CreatePersons, + CreateOrganizations, + SocialEditor }, }) diff --git a/plugins/contact-resources/src/plugin.ts b/plugins/contact-resources/src/plugin.ts index 395dc25e31..cfbe377310 100644 --- a/plugins/contact-resources/src/plugin.ts +++ b/plugins/contact-resources/src/plugin.ts @@ -13,9 +13,24 @@ // limitations under the License. // -import { mergeIds } from '@anticrm/platform' +import { IntlString, mergeIds } from '@anticrm/platform' import contact, { contactId } from '@anticrm/contact' export default mergeIds(contactId, contact, { + string: { + Apply: '' as IntlString, + Contacts: '' as IntlString, + CreatePerson: '' as IntlString, + CreatePersons: '' as IntlString, + CreateOrganizations: '' as IntlString, + Organizations: '' as IntlString, + SelectFolder: '' as IntlString, + OrganizationsFolder: '' as IntlString, + PersonsFolder: '' as IntlString, + AddSocialLinks: '' as IntlString, + Name: '' as IntlString, + MakePrivate: '' as IntlString, + MakePrivateDescription: '' as IntlString + } }) diff --git a/plugins/contact/src/index.ts b/plugins/contact/src/index.ts index 444349a9e1..0c222970ed 100644 --- a/plugins/contact/src/index.ts +++ b/plugins/contact/src/index.ts @@ -18,6 +18,16 @@ import type { Plugin, Asset } from '@anticrm/platform' import type { Doc, Ref, Class, UXObject, Space, Account } from '@anticrm/core' import type { AnyComponent } from '@anticrm/ui' +/** + * @public + */ +export interface Organizations extends Space {} + +/** + * @public + */ +export interface Persons extends Space {} + /** * @public */ @@ -40,6 +50,8 @@ export interface Channel { export interface Contact extends Doc { name: string avatar?: string + attachments?: number + comments?: number channels: Channel[] } @@ -47,8 +59,6 @@ export interface Contact extends Doc { * @public */ export interface Person extends Contact { - // email: string - // phone: string city: string } @@ -112,10 +122,15 @@ export default plugin(contactId, { ChannelProvider: '' as Ref>, Contact: '' as Ref>, Person: '' as Ref>, + Persons: '' as Ref>, Organization: '' as Ref>, + Organizations: '' as Ref>, Employee: '' as Ref>, EmployeeAccount: '' as Ref> }, + component: { + SocialEditor: '' as AnyComponent + }, channelProvider: { Email: '' as Ref, Phone: '' as Ref, @@ -136,7 +151,9 @@ export default plugin(contactId, { VK: '' as Asset, WhatsApp: '' as Asset, Youtube: '' as Asset, - GitHub: '' as Asset + GitHub: '' as Asset, + Person: '' as Asset, + Company: '' as Asset }, space: { Employee: '' as Ref diff --git a/plugins/recruit-assets/assets/icons.svg b/plugins/recruit-assets/assets/icons.svg index aec1f58169..5f5925612b 100644 --- a/plugins/recruit-assets/assets/icons.svg +++ b/plugins/recruit-assets/assets/icons.svg @@ -3,12 +3,6 @@ - - - - - - @@ -33,9 +27,6 @@ /> - - - diff --git a/plugins/recruit-assets/lang/en.json b/plugins/recruit-assets/lang/en.json index 1b0353f508..f33e5d2da2 100644 --- a/plugins/recruit-assets/lang/en.json +++ b/plugins/recruit-assets/lang/en.json @@ -14,7 +14,6 @@ "MakePrivateDescription": "Only members can see it", "CreateAnApplication": "Create an application", "NoApplicationsForCandidate": "There are no applications for this candidate.", - "UploadDropFilesHere": "Upload or drop files here", "NoAttachmentsForCandidate": "There are no attachments for this candidate." }, "status": { diff --git a/plugins/recruit-assets/src/index.ts b/plugins/recruit-assets/src/index.ts index 47e975004d..6f86b94cdd 100644 --- a/plugins/recruit-assets/src/index.ts +++ b/plugins/recruit-assets/src/index.ts @@ -21,7 +21,6 @@ loadMetadata(recruit.icon, { RecruitApplication: `${icons}#recruitment`, Vacancy: `${icons}#vacancy`, Location: `${icons}#location`, - Company: `${icons}#company`, Calendar: `${icons}#calendar`, Create: `${icons}#create` }) diff --git a/plugins/recruit-resources/package.json b/plugins/recruit-resources/package.json index 645f99691b..54cb20568c 100644 --- a/plugins/recruit-resources/package.json +++ b/plugins/recruit-resources/package.json @@ -43,7 +43,8 @@ "@anticrm/login": "~0.6.0", "deep-equal": "^2.0.5", "@anticrm/panel": "~0.6.0", - "@anticrm/activity": "~0.6.0", + "@anticrm/activity":"~0.6.0", + "@anticrm/attachment": "~0.6.0", "@anticrm/chunter-resources": "~0.6.0", "@anticrm/view": "~0.6.0", "@anticrm/view-resources": "~0.6.0" diff --git a/plugins/recruit-resources/src/components/Attachments.svelte b/plugins/recruit-resources/src/components/Attachments.svelte deleted file mode 100644 index 0b37b6475a..0000000000 --- a/plugins/recruit-resources/src/components/Attachments.svelte +++ /dev/null @@ -1,142 +0,0 @@ - - - - -
-
- Attachments - {#if loading} - - {:else} - { inputFile.click() } } /> - {/if} - -
- - {#if attachments.length === 0 && !loading} -
{ dragover = true } } - on:dragleave={ () => { dragover = false } } - on:drop|preventDefault|stopPropagation={fileDrop} - > - -
-
- -
- {:else} -
- {/if} - - - \ No newline at end of file diff --git a/plugins/recruit-resources/src/components/CreateCandidate.svelte b/plugins/recruit-resources/src/components/CreateCandidate.svelte index f148315600..7bca3ec0b8 100644 --- a/plugins/recruit-resources/src/components/CreateCandidate.svelte +++ b/plugins/recruit-resources/src/components/CreateCandidate.svelte @@ -26,15 +26,15 @@ import recruit from '../plugin' import chunter from '@anticrm/chunter' import type { Candidate } from '@anticrm/recruit' - import type { Attachment } from '@anticrm/chunter' + import attachment from '@anticrm/attachment' + import type { Attachment } from '@anticrm/attachment' import { EditBox, Link, showPopup, Component, CircleButton, IconFile as FileIcon, IconAdd, Spinner, Label, Status as StatusComponent } from '@anticrm/ui' import FileUpload from './icons/FileUpload.svelte' import Edit from './icons/Edit.svelte' - import SocialEditor from './SocialEditor.svelte' import YesNo from './YesNo.svelte' - import { combineName } from '@anticrm/contact'; + import contact, { combineName } from '@anticrm/contact' export let space: Ref @@ -75,7 +75,7 @@ console.log('resume name', resume.name) if (resume.uuid !== undefined) { - client.addCollection(chunter.class.Attachment, space, id, recruit.class.Candidate, 'attachments', { + client.addCollection(attachment.class.Attachment, space, id, recruit.class.Candidate, 'attachments', { name: resume.name, file: resume.uuid, size: resume.size, @@ -147,12 +147,12 @@
{#if !object.channels || object.channels.length === 0} - showPopup(SocialEditor, { values: object.channels ?? [] }, ev.target, (result) => { object.channels = result })} /> + showPopup(contact.component.SocialEditor, { values: object.channels ?? [] }, ev.target, (result) => { object.channels = result })} /> {:else}
- showPopup(SocialEditor, { values: object.channels ?? [] }, ev.target, (result) => { object.channels = result })} /> + showPopup(contact.component.SocialEditor, { values: object.channels ?? [] }, ev.target, (result) => { object.channels = result })} />
{/if}
@@ -179,10 +179,6 @@
-