diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 5c0b38ed03..2fc2a6eea5 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -308,6 +308,9 @@ dependencies: '@rush-temp/model-server-telegram': specifier: file:./projects/model-server-telegram.tgz version: file:projects/model-server-telegram.tgz(svelte@4.2.5)(typescript@5.2.2) + '@rush-temp/model-server-templates': + specifier: file:./projects/model-server-templates.tgz + version: file:projects/model-server-templates.tgz(svelte@4.2.5)(typescript@5.2.2) '@rush-temp/model-server-tracker': specifier: file:./projects/model-server-tracker.tgz version: file:projects/model-server-tracker.tgz(svelte@4.2.5)(typescript@5.2.2) @@ -533,6 +536,9 @@ dependencies: '@rush-temp/server-telegram-resources': specifier: file:./projects/server-telegram-resources.tgz version: file:projects/server-telegram-resources.tgz(@types/node@16.11.68)(esbuild@0.16.17)(svelte@4.2.5)(ts-node@10.9.1) + '@rush-temp/server-templates': + specifier: file:./projects/server-templates.tgz + version: file:projects/server-templates.tgz(esbuild@0.16.17)(svelte@4.2.5)(ts-node@10.9.1) '@rush-temp/server-token': specifier: file:./projects/server-token.tgz version: file:projects/server-token.tgz(esbuild@0.16.17)(svelte@4.2.5)(ts-node@10.9.1) @@ -18562,7 +18568,7 @@ packages: dev: false file:projects/model-all.tgz(svelte@4.2.5)(typescript@5.2.2): - resolution: {integrity: sha512-PEl4zAGjvSsQ5stSRUuj2PYcZ0BdWTkxyaJNP63dbX4U6QA5sf7BuXamJRgETTD74jA40pGRXUAMnprS6t9z4w==, tarball: file:projects/model-all.tgz} + resolution: {integrity: sha512-rRoP0AGubenpWEnLgCxmsp24ap6T59CCi32i2svNsX3v3DqcSLMCD/m921cLLDtoLvrp7FEXEFzvA5G3sInS4w==, tarball: file:projects/model-all.tgz} id: file:projects/model-all.tgz name: '@rush-temp/model-all' version: 0.0.0 @@ -19010,7 +19016,7 @@ packages: dev: false file:projects/model-server-contact.tgz(svelte@4.2.5)(typescript@5.2.2): - resolution: {integrity: sha512-d8ktsQb+9GnNT/Oc4b1KZxR0zxWhJcTzngYoD5R2396PyGo1WlPWSDyg7/ZwfW3VPuRUmFK4kQN9rvx5shqr1A==, tarball: file:projects/model-server-contact.tgz} + resolution: {integrity: sha512-vlsuafmQmf1ZBTgFnJs9jL2awlyHh/ErdTV2P2bUXXsYkBdA9XWHVAYZn+oi0Rd3id5j3DDGrDwN5NiR0U6+tQ==, tarball: file:projects/model-server-contact.tgz} id: file:projects/model-server-contact.tgz name: '@rush-temp/model-server-contact' version: 0.0.0 @@ -19220,7 +19226,7 @@ packages: dev: false file:projects/model-server-setting.tgz(svelte@4.2.5)(typescript@5.2.2): - resolution: {integrity: sha512-yVGC8ZWVTm3yOqKVta+BEaIkp42ZSpNbiUtjNJKUbn+3ExMzBt5BoCNxFnuZbcYpbgBGtVQ+ZJF0rflo+92ZEg==, tarball: file:projects/model-server-setting.tgz} + resolution: {integrity: sha512-sGvikiJYi3Q+I7SjeOSNmNnQALpeEMW338oLYIHWPqsdC5yK+mNBl3G62qx4RE5YCnQiT04QpGABEgUhoUK5ug==, tarball: file:projects/model-server-setting.tgz} id: file:projects/model-server-setting.tgz name: '@rush-temp/model-server-setting' version: 0.0.0 @@ -19283,7 +19289,7 @@ packages: dev: false file:projects/model-server-telegram.tgz(svelte@4.2.5)(typescript@5.2.2): - resolution: {integrity: sha512-0SFtpXukJznjjaLURWNNb3OUK8cLTYAGeFgUWte5oijmuDHcyPiFqvaCFPwyX8BTn+PL284jVnCy56HQGVv/lw==, tarball: file:projects/model-server-telegram.tgz} + resolution: {integrity: sha512-vsMfQWsKyRmKNuWnrTGt7XazrucPqAnK9lug4EqYvHeNht1p0ghjmypsTI1bZU72wJnnfGmuE24kHFqG7/Jumw==, tarball: file:projects/model-server-telegram.tgz} id: file:projects/model-server-telegram.tgz name: '@rush-temp/model-server-telegram' version: 0.0.0 @@ -19303,6 +19309,27 @@ packages: - typescript dev: false + file:projects/model-server-templates.tgz(svelte@4.2.5)(typescript@5.2.2): + resolution: {integrity: sha512-OSVMWQCabgesTAbFc/TTbs9dzlu5ZqXRbm682xc1C0C0Z2rXDmonFYV7RYELMc5Jf39Kctnne4edqHZWcj3BtQ==, tarball: file:projects/model-server-templates.tgz} + id: file:projects/model-server-templates.tgz + name: '@rush-temp/model-server-templates' + version: 0.0.0 + dependencies: + '@typescript-eslint/eslint-plugin': 6.11.0(@typescript-eslint/parser@6.11.0)(eslint@8.54.0)(typescript@5.2.2) + '@typescript-eslint/parser': 6.11.0(eslint@8.54.0)(typescript@5.2.2) + eslint: 8.54.0 + eslint-config-standard-with-typescript: 40.0.0(@typescript-eslint/eslint-plugin@6.11.0)(eslint-plugin-import@2.28.1)(eslint-plugin-n@15.7.0)(eslint-plugin-promise@6.1.1)(eslint@8.54.0)(typescript@5.2.2) + eslint-plugin-import: 2.28.1(eslint@8.54.0) + eslint-plugin-n: 15.7.0(eslint@8.54.0) + eslint-plugin-promise: 6.1.1(eslint@8.54.0) + prettier: 3.1.0 + prettier-plugin-svelte: 3.1.0(prettier@3.1.0)(svelte@4.2.5) + transitivePeerDependencies: + - supports-color + - svelte + - typescript + dev: false + file:projects/model-server-tracker.tgz(svelte@4.2.5)(typescript@5.2.2): resolution: {integrity: sha512-R7x6XRRSUS6b/pi3Xh01bA5iNCSAOYBy4l0E8/J6SrAG0K0v2565iEEc5FjZll3RWe+vVsA5GFeoIvJkgg+rpQ==, tarball: file:projects/model-server-tracker.tgz} id: file:projects/model-server-tracker.tgz @@ -20928,7 +20955,7 @@ packages: dev: false file:projects/server-contact.tgz(esbuild@0.16.17)(svelte@4.2.5)(ts-node@10.9.1): - resolution: {integrity: sha512-9uEmb9dproJeJoIM9tEknpiF6SmB3mUuYJSjJZBPsqVvckSPSiWhntDUEk2P6rVk1VDKr02Sxo8Ao9BBoHjBrA==, tarball: file:projects/server-contact.tgz} + resolution: {integrity: sha512-tFf4IQRLfSksCwdSdgf/UqHqUHEueA2Umyru2R1UB39sxiDA4tgzkYJg6NiJ9FYYQaGZfkkg1iHiNww4raIasw==, tarball: file:projects/server-contact.tgz} id: file:projects/server-contact.tgz name: '@rush-temp/server-contact' version: 0.0.0 @@ -21507,7 +21534,7 @@ packages: dev: false file:projects/server-setting.tgz(esbuild@0.16.17)(svelte@4.2.5)(ts-node@10.9.1): - resolution: {integrity: sha512-B1xZXUDrJjE6nRBumLMBkG0EGa7MSTSspMKcFNn1RUYeSQVj9K5EMQbuGHVdUyHDPoWy5h+BgYHdT7k/pkw87A==, tarball: file:projects/server-setting.tgz} + resolution: {integrity: sha512-BhdjSgGhI6B3T3YrKwfbHkn7wBc25CexZhqYAyo+yOPudt3BgKjaYsaEpWq0amLm82i4i0lzPB3YTh6Um/1yPA==, tarball: file:projects/server-setting.tgz} id: file:projects/server-setting.tgz name: '@rush-temp/server-setting' version: 0.0.0 @@ -21667,7 +21694,7 @@ packages: dev: false file:projects/server-telegram-resources.tgz(@types/node@16.11.68)(esbuild@0.16.17)(svelte@4.2.5)(ts-node@10.9.1): - resolution: {integrity: sha512-VhNEvKhlJ+YLFb/sQZcpq2wbO2MIy9rjAupK3a1UVtNSLjxQQdGG28/sBtzolxfqewS+iRFPdV5R5LxO31ocdg==, tarball: file:projects/server-telegram-resources.tgz} + resolution: {integrity: sha512-0xrMPAORRu6sTt0VKvmvv2I+6fy7kdMd4eU9LVKZZiNySzl9ar+9dLvVofzdP9pAZzndqeH89EjbIdi0WsIIeg==, tarball: file:projects/server-telegram-resources.tgz} id: file:projects/server-telegram-resources.tgz name: '@rush-temp/server-telegram-resources' version: 0.0.0 @@ -21699,7 +21726,7 @@ packages: dev: false file:projects/server-telegram.tgz(esbuild@0.16.17)(svelte@4.2.5)(ts-node@10.9.1): - resolution: {integrity: sha512-BA7dhLmV5p7UwD5wNpJD4Lfog13uVZy9cF6GDCsjGqodLUutP38zwFOEjLMmdC6bruxnS0PpH4N62VTxqGY8Ig==, tarball: file:projects/server-telegram.tgz} + resolution: {integrity: sha512-q7nsFwdvFCQw4bXA/Lb3bi2w5xtpJAzOZSra+pWwY+ZJMX1i2Dvo8LqevRwR/1vHALDFhQPsud/dipoJMnBFZw==, tarball: file:projects/server-telegram.tgz} id: file:projects/server-telegram.tgz name: '@rush-temp/server-telegram' version: 0.0.0 @@ -21730,6 +21757,38 @@ packages: - ts-node dev: false + file:projects/server-templates.tgz(esbuild@0.16.17)(svelte@4.2.5)(ts-node@10.9.1): + resolution: {integrity: sha512-wFkwKZjd1eEPQ0sdZdZQnrAZxzUH0f3B5Ml/hVMtI8f5jqYJlGGZNMt0ivQuKDEA5cLQosGVs1kVUxenDHG88w==, tarball: file:projects/server-templates.tgz} + id: file:projects/server-templates.tgz + name: '@rush-temp/server-templates' + version: 0.0.0 + dependencies: + '@types/jest': 29.5.5 + '@types/node': 16.11.68 + '@typescript-eslint/eslint-plugin': 6.11.0(@typescript-eslint/parser@6.11.0)(eslint@8.54.0)(typescript@5.2.2) + '@typescript-eslint/parser': 6.11.0(eslint@8.54.0)(typescript@5.2.2) + eslint: 8.54.0 + eslint-config-standard-with-typescript: 40.0.0(@typescript-eslint/eslint-plugin@6.11.0)(eslint-plugin-import@2.28.1)(eslint-plugin-n@15.7.0)(eslint-plugin-promise@6.1.1)(eslint@8.54.0)(typescript@5.2.2) + eslint-plugin-import: 2.28.1(eslint@8.54.0) + eslint-plugin-n: 15.7.0(eslint@8.54.0) + eslint-plugin-promise: 6.1.1(eslint@8.54.0) + jest: 29.7.0(@types/node@16.11.68)(ts-node@10.9.1) + prettier: 3.1.0 + prettier-plugin-svelte: 3.1.0(prettier@3.1.0)(svelte@4.2.5) + ts-jest: 29.1.1(esbuild@0.16.17)(jest@29.7.0)(typescript@5.2.2) + typescript: 5.2.2 + transitivePeerDependencies: + - '@babel/core' + - '@jest/types' + - babel-jest + - babel-plugin-macros + - esbuild + - node-notifier + - supports-color + - svelte + - ts-node + dev: false + file:projects/server-token.tgz(esbuild@0.16.17)(svelte@4.2.5)(ts-node@10.9.1): resolution: {integrity: sha512-VMRRUJ7aTTj5u0lL05bAJQ05MiAoP6uljsDeaR+rMNV0JkR21W0IWNgJznLh50da74Zwwcx9tfrRhBvhFuejIA==, tarball: file:projects/server-token.tgz} id: file:projects/server-token.tgz diff --git a/models/all/package.json b/models/all/package.json index 22db08a13f..69fb84a3ca 100644 --- a/models/all/package.json +++ b/models/all/package.json @@ -50,6 +50,7 @@ "@hcengineering/model-server-recruit": "^0.6.0", "@hcengineering/model-server-lead": "^0.6.0", "@hcengineering/model-server-inventory": "^0.6.0", + "@hcengineering/model-server-templates": "^0.6.0", "@hcengineering/model-activity": "^0.6.0", "@hcengineering/model-attachment": "^0.6.0", "@hcengineering/model-gmail": "^0.6.0", diff --git a/models/all/src/index.ts b/models/all/src/index.ts index 078307efc2..d947fc4760 100644 --- a/models/all/src/index.ts +++ b/models/all/src/index.ts @@ -46,10 +46,11 @@ import { serverLeadId, createModel as serverLeadModel } from '@hcengineering/mod import { serverNotificationId, createModel as serverNotificationModel } from '@hcengineering/model-server-notification' import { serverRecruitId, createModel as serverRecruitModel } from '@hcengineering/model-server-recruit' import { serverRequestId, createModel as serverRequestModel } from '@hcengineering/model-server-request' -import { createModel as serveSettingModel, serverSettingId } from '@hcengineering/model-server-setting' +import { serverSettingId, createModel as serveSettingModel } from '@hcengineering/model-server-setting' import { serverTagsId, createModel as serverTagsModel } from '@hcengineering/model-server-tags' import { serverTaskId, createModel as serverTaskModel } from '@hcengineering/model-server-task' import { serverTelegramId, createModel as serverTelegramModel } from '@hcengineering/model-server-telegram' +import { serverTemplatesId, createModel as serverTemplatesModel } from '@hcengineering/model-server-templates' import { serverTrackerId, createModel as serverTrackerModel } from '@hcengineering/model-server-tracker' import { serverViewId, createModel as serverViewModel } from '@hcengineering/model-server-view' import setting, { settingId, createModel as settingModel } from '@hcengineering/model-setting' @@ -284,6 +285,7 @@ export default function buildModel (enabled: string[] = ['*'], disabled: string[ [serverCalendarModel, serverCalendarId], [serverRecruitModel, serverRecruitId], [serverGmailModel, serverGmailId], + [serverTemplatesModel, serverTemplatesId], [serverTelegramModel, serverTelegramId], [serverHrModel, serverHrId], [serverNotificationModel, serverNotificationId], diff --git a/models/server-contact/package.json b/models/server-contact/package.json index 5e56cc44bc..92776bf3e7 100644 --- a/models/server-contact/package.json +++ b/models/server-contact/package.json @@ -30,6 +30,8 @@ "@hcengineering/platform": "^0.6.9", "@hcengineering/server-contact": "^0.6.1", "@hcengineering/server-core": "^0.6.1", + "@hcengineering/templates": "^0.6.7", + "@hcengineering/server-templates": "^0.6.0", "@hcengineering/contact": "^0.6.20", "@hcengineering/server-notification": "^0.6.1" } diff --git a/models/server-contact/src/index.ts b/models/server-contact/src/index.ts index eb1df4ba0d..f860ac0e1b 100644 --- a/models/server-contact/src/index.ts +++ b/models/server-contact/src/index.ts @@ -21,6 +21,8 @@ import core from '@hcengineering/core' import serverContact from '@hcengineering/server-contact' import serverCore from '@hcengineering/server-core' import serverNotification from '@hcengineering/server-notification' +import serverTemplates from '@hcengineering/server-templates' +import templates from '@hcengineering/templates' export { serverContactId } from '@hcengineering/server-contact' export function createModel (builder: Builder): void { @@ -75,4 +77,58 @@ export function createModel (builder: Builder): void { _class: core.class.TxUpdateDoc } }) + + builder.mixin( + contact.templateField.CurrentEmployeeName, + templates.class.TemplateField, + serverTemplates.mixin.ServerTemplateField, + { + serverFunc: serverContact.function.GetCurrentEmployeeName + } + ) + + builder.mixin( + contact.templateField.CurrentEmployeeEmail, + templates.class.TemplateField, + serverTemplates.mixin.ServerTemplateField, + { + serverFunc: serverContact.function.GetCurrentEmployeeEmail + } + ) + + builder.mixin( + contact.templateField.ContactName, + templates.class.TemplateField, + serverTemplates.mixin.ServerTemplateField, + { + serverFunc: serverContact.function.GetContactName + } + ) + + builder.mixin( + contact.templateField.CurrentEmployeePosition, + templates.class.TemplateField, + serverTemplates.mixin.ServerTemplateField, + { + serverFunc: serverContact.function.GetCurrentEmployeePosition + } + ) + + builder.mixin( + contact.templateField.ContactFirstName, + templates.class.TemplateField, + serverTemplates.mixin.ServerTemplateField, + { + serverFunc: serverContact.function.GetContactFirstName + } + ) + + builder.mixin( + contact.templateField.ContactLastName, + templates.class.TemplateField, + serverTemplates.mixin.ServerTemplateField, + { + serverFunc: serverContact.function.GetContactLastName + } + ) } diff --git a/models/server-setting/package.json b/models/server-setting/package.json index 8e4134dee6..76ed288476 100644 --- a/models/server-setting/package.json +++ b/models/server-setting/package.json @@ -30,6 +30,8 @@ "@hcengineering/platform": "^0.6.9", "@hcengineering/setting": "^0.6.11", "@hcengineering/server-notification": "^0.6.1", + "@hcengineering/templates": "^0.6.7", + "@hcengineering/server-templates": "^0.6.0", "@hcengineering/server-setting": "^0.6.0", "@hcengineering/server-core": "^0.6.1" } diff --git a/models/server-setting/src/index.ts b/models/server-setting/src/index.ts index fccd484e68..0273c070ec 100644 --- a/models/server-setting/src/index.ts +++ b/models/server-setting/src/index.ts @@ -20,6 +20,8 @@ import core from '@hcengineering/core' import serverNotification from '@hcengineering/server-notification' import serverSetting from '@hcengineering/server-setting' import setting from '@hcengineering/setting' +import serverTemplates from '@hcengineering/server-templates' +import templates from '@hcengineering/templates' export { serverSettingId } from '@hcengineering/server-setting' @@ -31,4 +33,35 @@ export function createModel (builder: Builder): void { builder.mixin(setting.class.Integration, core.class.Class, serverNotification.mixin.TextPresenter, { presenter: serverSetting.function.IntegrationTextPresenter }) + + builder.mixin(setting.templateField.Value, templates.class.TemplateField, serverTemplates.mixin.ServerTemplateField, { + serverFunc: serverSetting.function.GetValue + }) + + builder.mixin( + setting.templateField.OwnerFirstName, + templates.class.TemplateField, + serverTemplates.mixin.ServerTemplateField, + { + serverFunc: serverSetting.function.GetFirstName + } + ) + + builder.mixin( + setting.templateField.OwnerLastName, + templates.class.TemplateField, + serverTemplates.mixin.ServerTemplateField, + { + serverFunc: serverSetting.function.GetLastName + } + ) + + builder.mixin( + setting.templateField.OwnerPosition, + templates.class.TemplateField, + serverTemplates.mixin.ServerTemplateField, + { + serverFunc: serverSetting.function.GetOwnerPosition + } + ) } diff --git a/models/server-telegram/package.json b/models/server-telegram/package.json index 7cbd9613d6..26e7bbc04a 100644 --- a/models/server-telegram/package.json +++ b/models/server-telegram/package.json @@ -33,6 +33,8 @@ "@hcengineering/server-core": "^0.6.1", "@hcengineering/telegram": "^0.6.14", "@hcengineering/notification": "^0.6.16", + "@hcengineering/templates": "^0.6.7", + "@hcengineering/server-templates": "^0.6.0", "@hcengineering/server-notification": "^0.6.1" } } diff --git a/models/server-telegram/src/index.ts b/models/server-telegram/src/index.ts index 0ecc8f0185..5a38fc38ba 100644 --- a/models/server-telegram/src/index.ts +++ b/models/server-telegram/src/index.ts @@ -22,6 +22,8 @@ import serverTelegram from '@hcengineering/server-telegram' import telegram from '@hcengineering/telegram' import notification from '@hcengineering/notification' import serverNotification from '@hcengineering/server-notification' +import serverTemplates from '@hcengineering/server-templates' +import templates from '@hcengineering/templates' export { serverTelegramId } from '@hcengineering/server-telegram' @@ -52,4 +54,22 @@ export function createModel (builder: Builder): void { func: serverTelegram.function.IsIncomingMessage } ) + + builder.mixin( + telegram.templateField.CurrentEmployeeTelegram, + templates.class.TemplateField, + serverTemplates.mixin.ServerTemplateField, + { + serverFunc: serverTelegram.function.GetCurrentEmployeeTG + } + ) + + builder.mixin( + telegram.templateField.IntegrationOwnerTG, + templates.class.TemplateField, + serverTemplates.mixin.ServerTemplateField, + { + serverFunc: serverTelegram.function.GetIntegrationOwnerTG + } + ) } diff --git a/models/server-templates/.eslintrc.js b/models/server-templates/.eslintrc.js new file mode 100644 index 0000000000..c1cf82cba0 --- /dev/null +++ b/models/server-templates/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + extends: ['./node_modules/@hcengineering/platform-rig/profiles/model/eslint.config.json'], + parserOptions: { + tsconfigRootDir: __dirname, + project: './tsconfig.json' + } +} diff --git a/models/server-templates/.npmignore b/models/server-templates/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/models/server-templates/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/models/server-templates/config/rig.json b/models/server-templates/config/rig.json new file mode 100644 index 0000000000..2f6be36605 --- /dev/null +++ b/models/server-templates/config/rig.json @@ -0,0 +1,5 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json", + "rigPackageName": "@hcengineering/platform-rig", + "rigProfile": "model" +} diff --git a/models/server-templates/package.json b/models/server-templates/package.json new file mode 100644 index 0000000000..6c58ffe23b --- /dev/null +++ b/models/server-templates/package.json @@ -0,0 +1,36 @@ +{ + "name": "@hcengineering/model-server-templates", + "version": "0.6.0", + "main": "lib/index.js", + "author": "Anticrm Platform Contributors", + "license": "EPL-2.0", + "scripts": { + "build": "tsc", + "build:watch": "tsc", + "lint:fix": "eslint --fix src", + "lint": "eslint src", + "format": "format src" + }, + "template": "@hcengineering/model-package", + "devDependencies": { + "@hcengineering/platform-rig": "^0.6.0", + "@typescript-eslint/eslint-plugin": "^6.11.0", + "eslint-plugin-import": "^2.26.0", + "eslint-plugin-promise": "^6.1.1", + "eslint-plugin-n": "^15.4.0", + "eslint": "^8.54.0", + "@typescript-eslint/parser": "^6.11.0", + "eslint-config-standard-with-typescript": "^40.0.0", + "prettier": "^3.1.0", + "prettier-plugin-svelte": "^3.1.0" + }, + "dependencies": { + "@hcengineering/core": "^0.6.28", + "@hcengineering/model": "^0.6.7", + "@hcengineering/platform": "^0.6.9", + "@hcengineering/templates": "^0.6.7", + "@hcengineering/model-templates": "^0.6.0", + "@hcengineering/server-templates": "^0.6.0", + "@hcengineering/server-core": "^0.6.1" + } +} diff --git a/models/server-templates/src/index.ts b/models/server-templates/src/index.ts new file mode 100644 index 0000000000..798a0f4c24 --- /dev/null +++ b/models/server-templates/src/index.ts @@ -0,0 +1,31 @@ +// +// Copyright © 2024 Hardcore Engineering Inc. +// +// 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 { Mixin, type Builder } from '@hcengineering/model' +import { TTemplateField } from '@hcengineering/model-templates' +import { type Resource } from '@hcengineering/platform' +import serverTemplates, { type TemplateFieldServerFunc } from '@hcengineering/server-templates' +import templates, { type TemplateField } from '@hcengineering/templates' + +@Mixin(serverTemplates.mixin.ServerTemplateField, templates.class.TemplateField) +export class TServerTemplateField extends TTemplateField implements TemplateField { + serverFunc!: Resource +} + +export { serverTemplatesId } from '@hcengineering/server-templates' + +export function createModel (builder: Builder): void { + builder.createModel(TServerTemplateField) +} diff --git a/models/server-templates/tsconfig.json b/models/server-templates/tsconfig.json new file mode 100644 index 0000000000..cce8988c63 --- /dev/null +++ b/models/server-templates/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "./node_modules/@hcengineering/platform-rig/profiles/model/tsconfig.json", + + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib", + "tsBuildInfoFile": ".build/build.tsbuildinfo" + } +} \ No newline at end of file diff --git a/packages/theme/styles/_lumia-colors.scss b/packages/theme/styles/_lumia-colors.scss index 5335e00f2c..fade394cad 100644 --- a/packages/theme/styles/_lumia-colors.scss +++ b/packages/theme/styles/_lumia-colors.scss @@ -90,7 +90,7 @@ --global-ui-hover-highlight-BackgroundColor: #A5BDFF40; --global-surface-01-BackgroundColor: #F8F9FA; --global-surface-01-BorderColor: #DDE1E9; - --global-surface-02-BackgroundColor: #19202E; + --global-surface-02-BackgroundColor: #FFFFFF; --global-surface-02-BorderColor: #EBEEF2; --global-surface-03-hover-BackgroundColor: #F8F9FA; --global-subtle-ui-BorderColor: #1530720D; diff --git a/packages/ui/lang/en.json b/packages/ui/lang/en.json index f295bd9982..83ba2b97ae 100644 --- a/packages/ui/lang/en.json +++ b/packages/ui/lang/en.json @@ -6,11 +6,19 @@ "Save": "Save", "Publish": "Publish", "SaveDraft": "Save draft", - "Minutes": "{minutes, plural, =0 {less than a minute ago} =1 {a minute ago} other {# minutes ago}}", - "Hours": "{hours, plural, =0 {less than an hour ago} =1 {an hour ago} other {# hours ago}}", - "Days": "{days, plural, =0 {today} =1 {yesterday} other {# days ago}}", - "Months": "{months, plural, =0 {this month} =1 {a month ago} other {# months ago}}", - "Years": "{years, plural, =0 {this year} =1 {a year ago} other {# years ago}}", + "MinutesAgo": "{minutes, plural, =0 {less than a minute ago} =1 {a minute ago} other {# minutes ago}}", + "HoursAgo": "{hours, plural, =0 {less than an hour ago} =1 {an hour ago} other {# hours ago}}", + "DaysAgo": "{days, plural, =0 {today} =1 {yesterday} other {# days ago}}", + "MonthsAgo": "{months, plural, =0 {this month} =1 {a month ago} other {# months ago}}", + "YearsAgo": "{years, plural, =0 {this year} =1 {a year ago} other {# years ago}}", + "Minutes": "{minutes, plural, =0 {less than a minute} =1 {a minute} other {# minutes}}", + "Hours": "{hours, plural, =0 {less than an hour} =1 {an hour} other {# hours}}", + "Days": "{days, plural, =0 {today} =1 {1 day} other {# days }}", + "Weeks": "{weeks, plural, =0 {this week} =1 {1 week} other {# weeks}}", + "Months": "{months, plural, =0 {this month} =1 {1 month} other {# months}}", + "Years": "{years, plural, =0 {this year} =1 {a year} other {# years}}", + "Before": "Before", + "After": "After", "MinutesShort": "{value}m", "HoursShort": "{value}h", "DaysShort": "{value}d", @@ -43,9 +51,13 @@ "MinutesBefore": "{minutes, plural, =1 {a minute before} other {# minutes before}}", "HoursBefore": "{hours, plural, =1 {an hour before} other {# hours before}}", "DaysBefore": "{days, plural, =1 {a day before} other {# days before}}", + "WeeksBefore": "{weeks, plural, =1 {a week before} other {# weeks before}}", + "MonthsBefore": "{months, plural, =1 {a months before} other {# months before}}", "MinutesAfter": "{minutes, plural, =1 {in a minute} other {in # minutes}}", "HoursAfter": "{hours, plural, =1 {in an hour} other {in # hours}}", "DaysAfter": "{days, plural, =1 {in a day} other {in # days}}", + "WeeksAfter": "{weeks, plural, =1 {in a day} other {in # weeks}}", + "MonthsAfter": "{months, plural, =1 {in a month} other {in # months}}", "NoActionsDefined": "No actions applicable", "Incoming": "Incoming", "HoursLabel": "Hours", diff --git a/packages/ui/lang/ru.json b/packages/ui/lang/ru.json index 293dcfbbec..ccc019adc8 100644 --- a/packages/ui/lang/ru.json +++ b/packages/ui/lang/ru.json @@ -6,11 +6,19 @@ "Save": "Сохранить", "Publish": "Опубликовать", "SaveDraft": "Сохранить черновик", - "Minutes": "{minutes, plural, =0 {меньше минуты назад} =1 {минуту назад} one {# минуту назад} few {# минуты назад} other {# минут назад}}", - "Hours": "{hours, plural, =0 {меньше часа назад} =1 {час назад} one {# час назад} few {# часа назад} other {# часов назад}}", - "Days": "{days, plural, =0 {сегодня} =1 {вчера} one {# день назад} few {# дня назад} other {# дней назад}}", - "Months": "{months, plural, =0 {в этом месяце} =1 {месяц назад} one {# месяц назад} few {# месяца назад} other {# месяцев назад}}", - "Years": "{years, plural, =0 {в этом году} =1 {год назад} one {# год назад} few {# год назад} other {# лет назад}}", + "MinutesAgo": "{minutes, plural, =0 {меньше минуты назад} =1 {минуту назад} one {# минуту назад} few {# минуты назад} other {# минут назад}}", + "HoursAgo": "{hours, plural, =0 {меньше часа назад} =1 {час назад} one {# час назад} few {# часа назад} other {# часов назад}}", + "DaysAgo": "{days, plural, =0 {сегодня} =1 {вчера} one {# день назад} few {# дня назад} other {# дней назад}}", + "MonthsAgo": "{months, plural, =0 {в этом месяце} =1 {месяц назад} one {# месяц назад} few {# месяца назад} other {# месяцев назад}}", + "YearsAgo": "{years, plural, =0 {в этом году} =1 {год назад} one {# год назад} few {# год назад} other {# лет назад}}", + "Minutes": "{minutes, plural, =0 {меньше минуты} one {# минуту} few {# минуты} other {# минут}}", + "Hours": "{hours, plural, =0 {меньше часа} one {# час} few {# часа} other {# часов}}", + "Days": "{days, plural, =0 {сегодня} one {# день} few {# дня} other {# дней}}", + "Weeks": "{weeks, plural, =0 {меньше недели} one {# неделя} few {# недели} other {# недель}}", + "Months": "{months, plural, =0 {меньше месяца} one {# месяц} few {# месяца} other {# месяцев}}", + "Years": "{years, plural, =0 {меньше года} one {# год} few {# года} other {# лет}}", + "Before": "За", + "After": "Через", "MinutesShort": "{value}м", "HoursShort": "{value}ч", "DaysShort": "{value}д", @@ -43,9 +51,13 @@ "MinutesBefore": "{minutes, plural, =1 {за минуту} one {за # минуту} few {за # минуты} other {за # минут}}", "HoursBefore": "{hours, plural, =1 {за час} one {за # час} few {за # часа} other {за # часов}}", "DaysBefore": "{days, plural, =1 {за день} one {за # день} few {за # дня} other {за # дней}}", + "WeeksBefore": "{weeks, plural, =1 {за неделю} one {за # неделю} few {за # недели} other {за # недель}}", + "MonthsBefore": "{months, plural, =1 {за месяц} one {за # месяц} few {за # месяца} other {за # месяцев}}", "MinutesAfter": "{minutes, plural, =1 {через минуту} one {через # минуту} few {через # минуты} other {через # минут}}", "HoursAfter": "{hours, plural, =1 {через час} one {через # час} few {через # часа} other {через # часов}}", "DaysAfter": "{days, plural, =1 {через день} one {через # день} few {через # дня} other {через # дней}}", + "WeeksAfter": "{weeks, plural, =1 {через неделю} one {через # неделю} few {через # недели} other {через # недель}}", + "MonthsAfter": "{months, plural, =1 {через месяц} one {через # месяц} few {через # месяца} other {через # месяцев}}", "NoActionsDefined": "Нет доступных действий", "Incoming": "Входящие", "HoursLabel": "Часы", diff --git a/packages/ui/src/components/TimeSince.svelte b/packages/ui/src/components/TimeSince.svelte index 8a703f300f..2e8b8a0f57 100644 --- a/packages/ui/src/components/TimeSince.svelte +++ b/packages/ui/src/components/TimeSince.svelte @@ -41,15 +41,15 @@ let passed = now - value if (passed < 0) passed = 0 if (passed < HOUR) { - time = await translate(ui.string.Minutes, { minutes: Math.floor(passed / MINUTE) }, $themeStore.language) + time = await translate(ui.string.MinutesAgo, { minutes: Math.floor(passed / MINUTE) }, $themeStore.language) } else if (passed < DAY) { - time = await translate(ui.string.Hours, { hours: Math.floor(passed / HOUR) }, $themeStore.language) + time = await translate(ui.string.HoursAgo, { hours: Math.floor(passed / HOUR) }, $themeStore.language) } else if (passed < MONTH) { - time = await translate(ui.string.Days, { days: Math.floor(passed / DAY) }, $themeStore.language) + time = await translate(ui.string.DaysAgo, { days: Math.floor(passed / DAY) }, $themeStore.language) } else if (passed < YEAR) { - time = await translate(ui.string.Months, { months: calculateMonthsPassed(now, value) }, $themeStore.language) + time = await translate(ui.string.MonthsAgo, { months: calculateMonthsPassed(now, value) }, $themeStore.language) } else { - time = await translate(ui.string.Years, { years: Math.floor(passed / YEAR) }, $themeStore.language) + time = await translate(ui.string.YearsAgo, { years: Math.floor(passed / YEAR) }, $themeStore.language) } } diff --git a/packages/ui/src/plugin.ts b/packages/ui/src/plugin.ts index 40df5fed74..70e59a8740 100644 --- a/packages/ui/src/plugin.ts +++ b/packages/ui/src/plugin.ts @@ -31,11 +31,19 @@ export const uis = plugin(uiId, { Save: '' as IntlString, Publish: '' as IntlString, SaveDraft: '' as IntlString, + MinutesAgo: '' as IntlString, + HoursAgo: '' as IntlString, + DaysAgo: '' as IntlString, + MonthsAgo: '' as IntlString, + YearsAgo: '' as IntlString, Minutes: '' as IntlString, Hours: '' as IntlString, Days: '' as IntlString, + Weeks: '' as IntlString, Months: '' as IntlString, Years: '' as IntlString, + Before: '' as IntlString, + After: '' as IntlString, MinutesShort: '' as IntlString, HoursShort: '' as IntlString, DaysShort: '' as IntlString, @@ -64,9 +72,13 @@ export const uis = plugin(uiId, { MinutesBefore: '' as IntlString, HoursBefore: '' as IntlString, DaysBefore: '' as IntlString, + WeeksBefore: '' as IntlString, + MonthsBefore: '' as IntlString, MinutesAfter: '' as IntlString, HoursAfter: '' as IntlString, DaysAfter: '' as IntlString, + WeeksAfter: '' as IntlString, + MonthsAfter: '' as IntlString, NoActionsDefined: '' as IntlString, Incoming: '' as IntlString, HoursLabel: '' as IntlString, diff --git a/plugins/contact-resources/src/components/PersonContent.svelte b/plugins/contact-resources/src/components/PersonContent.svelte index d2d702cd74..2426b4dc68 100644 --- a/plugins/contact-resources/src/components/PersonContent.svelte +++ b/plugins/contact-resources/src/components/PersonContent.svelte @@ -71,7 +71,7 @@ {#if value} {#if statusLabel} -
+
}, diff --git a/plugins/task-resources/src/components/projectTypes/ProjectEditor.svelte b/plugins/task-resources/src/components/projectTypes/ProjectEditor.svelte index b6a7d7591b..96044c69f1 100644 --- a/plugins/task-resources/src/components/projectTypes/ProjectEditor.svelte +++ b/plugins/task-resources/src/components/projectTypes/ProjectEditor.svelte @@ -327,7 +327,7 @@ {/if}
-
+
@@ -346,3 +346,9 @@
{/if} + + diff --git a/plugins/templates-assets/lang/en.json b/plugins/templates-assets/lang/en.json index 0abb9dfe96..6c743c2a4a 100644 --- a/plugins/templates-assets/lang/en.json +++ b/plugins/templates-assets/lang/en.json @@ -15,6 +15,7 @@ "Field": "Field", "TemplateCategory": "Template group", "CreateTemplateCategory": "Create group", - "Copy": "Copy" + "Copy": "Copy", + "Template": "Template" } } \ No newline at end of file diff --git a/plugins/templates-assets/lang/ru.json b/plugins/templates-assets/lang/ru.json index cc545fa948..0d411e11e9 100644 --- a/plugins/templates-assets/lang/ru.json +++ b/plugins/templates-assets/lang/ru.json @@ -15,6 +15,7 @@ "Field": "Поле", "TemplateCategory": "Группа шаблонов", "CreateTemplateCategory": "Создать группу", - "Copy": "Копировать" + "Copy": "Копировать", + "Template": "Шаблон" } } \ No newline at end of file diff --git a/plugins/templates-resources/src/components/EditorTemplatePopup.svelte b/plugins/templates-resources/src/components/EditorTemplatePopup.svelte new file mode 100644 index 0000000000..65f0474fd7 --- /dev/null +++ b/plugins/templates-resources/src/components/EditorTemplatePopup.svelte @@ -0,0 +1,26 @@ + + + +a diff --git a/plugins/templates-resources/src/components/TemplatePopup.svelte b/plugins/templates-resources/src/components/TemplatePopup.svelte index 564843a38d..830d1e1090 100644 --- a/plugins/templates-resources/src/components/TemplatePopup.svelte +++ b/plugins/templates-resources/src/components/TemplatePopup.svelte @@ -16,13 +16,12 @@