diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 177cb10060..c65515cd40 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -152,6 +152,15 @@ dependencies: '@rush-temp/gmail-resources': specifier: file:./projects/gmail-resources.tgz version: file:projects/gmail-resources.tgz(@types/node@20.11.19)(esbuild@0.20.1)(postcss-load-config@4.0.2)(postcss@8.4.35)(ts-node@10.9.2) + '@rush-temp/guest': + specifier: file:./projects/guest.tgz + version: file:projects/guest.tgz(@types/node@20.11.19)(esbuild@0.20.1)(svelte@4.2.11)(ts-node@10.9.2) + '@rush-temp/guest-assets': + specifier: file:./projects/guest-assets.tgz + version: file:projects/guest-assets.tgz(esbuild@0.20.1)(svelte@4.2.11)(ts-node@10.9.2) + '@rush-temp/guest-resources': + specifier: file:./projects/guest-resources.tgz + version: file:projects/guest-resources.tgz(@types/node@20.11.19)(esbuild@0.20.1)(postcss-load-config@4.0.2)(postcss@8.4.35)(ts-node@10.9.2) '@rush-temp/hr': specifier: file:./projects/hr.tgz version: file:projects/hr.tgz(@types/node@20.11.19)(esbuild@0.20.1)(svelte@4.2.11)(ts-node@10.9.2) @@ -236,6 +245,9 @@ dependencies: '@rush-temp/model-gmail': specifier: file:./projects/model-gmail.tgz version: file:projects/model-gmail.tgz(svelte@4.2.11) + '@rush-temp/model-guest': + specifier: file:./projects/model-guest.tgz + version: file:projects/model-guest.tgz(svelte@4.2.11) '@rush-temp/model-hr': specifier: file:./projects/model-hr.tgz version: file:projects/model-hr.tgz(svelte@4.2.11) @@ -284,6 +296,9 @@ dependencies: '@rush-temp/model-server-gmail': specifier: file:./projects/model-server-gmail.tgz version: file:projects/model-server-gmail.tgz(svelte@4.2.11) + '@rush-temp/model-server-guest': + specifier: file:./projects/model-server-guest.tgz + version: file:projects/model-server-guest.tgz(svelte@4.2.11) '@rush-temp/model-server-hr': specifier: file:./projects/model-server-hr.tgz version: file:projects/model-server-hr.tgz(svelte@4.2.11) @@ -488,6 +503,12 @@ dependencies: '@rush-temp/server-gmail-resources': specifier: file:./projects/server-gmail-resources.tgz version: file:projects/server-gmail-resources.tgz(@types/node@20.11.19)(esbuild@0.20.1)(svelte@4.2.11)(ts-node@10.9.2) + '@rush-temp/server-guest': + specifier: file:./projects/server-guest.tgz + version: file:projects/server-guest.tgz(esbuild@0.20.1)(svelte@4.2.11)(ts-node@10.9.2) + '@rush-temp/server-guest-resources': + specifier: file:./projects/server-guest-resources.tgz + version: file:projects/server-guest-resources.tgz(@types/node@20.11.19)(esbuild@0.20.1)(svelte@4.2.11)(ts-node@10.9.2) '@rush-temp/server-hr': specifier: file:./projects/server-hr.tgz version: file:projects/server-hr.tgz(esbuild@0.20.1)(svelte@4.2.11)(ts-node@10.9.2) @@ -18111,6 +18132,116 @@ packages: - ts-node dev: false + file:projects/guest-assets.tgz(esbuild@0.20.1)(svelte@4.2.11)(ts-node@10.9.2): + resolution: {integrity: sha512-RwM1NfgdyK2g9TTlQfMS4vTkMrwVzDCB7dtCuQDugHQLgLGb/Ea+Z9srtAHwY8ERKFZx6T/pKwNfODyacB1AzQ==, tarball: file:projects/guest-assets.tgz} + id: file:projects/guest-assets.tgz + name: '@rush-temp/guest-assets' + version: 0.0.0 + dependencies: + '@types/jest': 29.5.12 + '@types/node': 20.11.19 + '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0)(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.21.0(eslint@8.56.0)(typescript@5.3.3) + eslint: 8.56.0 + eslint-config-standard-with-typescript: 40.0.0(@typescript-eslint/eslint-plugin@6.21.0)(eslint-plugin-import@2.29.1)(eslint-plugin-n@15.7.0)(eslint-plugin-promise@6.1.1)(eslint@8.56.0)(typescript@5.3.3) + eslint-plugin-import: 2.29.1(eslint@8.56.0) + eslint-plugin-n: 15.7.0(eslint@8.56.0) + eslint-plugin-promise: 6.1.1(eslint@8.56.0) + jest: 29.7.0(@types/node@20.11.19)(ts-node@10.9.2) + prettier: 3.2.5 + prettier-plugin-svelte: 3.2.1(prettier@3.2.5)(svelte@4.2.11) + ts-jest: 29.1.2(esbuild@0.20.1)(jest@29.7.0)(typescript@5.3.3) + typescript: 5.3.3 + transitivePeerDependencies: + - '@babel/core' + - '@jest/types' + - babel-jest + - babel-plugin-macros + - esbuild + - node-notifier + - supports-color + - svelte + - ts-node + dev: false + + file:projects/guest-resources.tgz(@types/node@20.11.19)(esbuild@0.20.1)(postcss-load-config@4.0.2)(postcss@8.4.35)(ts-node@10.9.2): + resolution: {integrity: sha512-7+lTvSCKLVvKBseFEtIJLuBf98DhhcXdu1bp7YxtmjO1nvZuPgWfw8aVdnuKLiZANpKhWxoYOS+yvpwYumML0Q==, tarball: file:projects/guest-resources.tgz} + id: file:projects/guest-resources.tgz + name: '@rush-temp/guest-resources' + version: 0.0.0 + dependencies: + '@types/jest': 29.5.12 + '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0)(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.21.0(eslint@8.56.0)(typescript@5.3.3) + eslint: 8.56.0 + eslint-config-standard-with-typescript: 40.0.0(@typescript-eslint/eslint-plugin@6.21.0)(eslint-plugin-import@2.29.1)(eslint-plugin-n@15.7.0)(eslint-plugin-promise@6.1.1)(eslint@8.56.0)(typescript@5.3.3) + eslint-plugin-import: 2.29.1(eslint@8.56.0) + eslint-plugin-n: 15.7.0(eslint@8.56.0) + eslint-plugin-promise: 6.1.1(eslint@8.56.0) + eslint-plugin-svelte: 2.35.1(eslint@8.56.0)(svelte@4.2.11)(ts-node@10.9.2) + fast-copy: 3.0.1 + jest: 29.7.0(@types/node@20.11.19)(ts-node@10.9.2) + prettier: 3.2.5 + prettier-plugin-svelte: 3.2.1(prettier@3.2.5)(svelte@4.2.11) + sass: 1.71.1 + svelte: 4.2.11 + svelte-check: 3.6.4(postcss-load-config@4.0.2)(postcss@8.4.35)(sass@1.71.1)(svelte@4.2.11) + svelte-eslint-parser: 0.33.1(svelte@4.2.11) + svelte-loader: 3.1.9(svelte@4.2.11) + svelte-preprocess: 5.1.3(postcss-load-config@4.0.2)(postcss@8.4.35)(sass@1.71.1)(svelte@4.2.11)(typescript@5.3.3) + ts-jest: 29.1.2(esbuild@0.20.1)(jest@29.7.0)(typescript@5.3.3) + typescript: 5.3.3 + transitivePeerDependencies: + - '@babel/core' + - '@jest/types' + - '@types/node' + - babel-jest + - babel-plugin-macros + - coffeescript + - esbuild + - less + - node-notifier + - postcss + - postcss-load-config + - pug + - stylus + - sugarss + - supports-color + - ts-node + dev: false + + file:projects/guest.tgz(@types/node@20.11.19)(esbuild@0.20.1)(svelte@4.2.11)(ts-node@10.9.2): + resolution: {integrity: sha512-4i+LNJNUK+8o49FVZYIQZSG6nxSPni42hV4fLWFhOhz6KHcDsWcKY7n8I3Mc87ZJ8e1YteSZn95ZFLPEkJYaIQ==, tarball: file:projects/guest.tgz} + id: file:projects/guest.tgz + name: '@rush-temp/guest' + version: 0.0.0 + dependencies: + '@types/jest': 29.5.12 + '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0)(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.21.0(eslint@8.56.0)(typescript@5.3.3) + eslint: 8.56.0 + eslint-config-standard-with-typescript: 40.0.0(@typescript-eslint/eslint-plugin@6.21.0)(eslint-plugin-import@2.29.1)(eslint-plugin-n@15.7.0)(eslint-plugin-promise@6.1.1)(eslint@8.56.0)(typescript@5.3.3) + eslint-plugin-import: 2.29.1(eslint@8.56.0) + eslint-plugin-n: 15.7.0(eslint@8.56.0) + eslint-plugin-promise: 6.1.1(eslint@8.56.0) + jest: 29.7.0(@types/node@20.11.19)(ts-node@10.9.2) + prettier: 3.2.5 + prettier-plugin-svelte: 3.2.1(prettier@3.2.5)(svelte@4.2.11) + ts-jest: 29.1.2(esbuild@0.20.1)(jest@29.7.0)(typescript@5.3.3) + typescript: 5.3.3 + transitivePeerDependencies: + - '@babel/core' + - '@jest/types' + - '@types/node' + - babel-jest + - babel-plugin-macros + - esbuild + - node-notifier + - supports-color + - svelte + - ts-node + dev: false + file:projects/hr-assets.tgz(esbuild@0.20.1)(svelte@4.2.11)(ts-node@10.9.2): resolution: {integrity: sha512-iySEToC2UKeQtUhHx21qbzPRz1G4UvCNhUuQtHS4uuzLVJ8CJkLv/l4EHkdXZr7y35lNiLqfkeeb+XO+3n0+Xg==, tarball: file:projects/hr-assets.tgz} id: file:projects/hr-assets.tgz @@ -18764,7 +18895,7 @@ packages: dev: false file:projects/model-all.tgz(svelte@4.2.11): - resolution: {integrity: sha512-oRRJx0V+rtUYxrRRDBQwb0ttCzClI/SVBXS57BFT2Qx1xYZ6fPSjZQWlca0KFztUqbg4qLnoib7Tq26otiPYEw==, tarball: file:projects/model-all.tgz} + resolution: {integrity: sha512-dHsSkXsC7WkS9h8RlqjpSVF9TlqTA2UTiK5ehmxM3gJxpPFtrHrH8qD48u08TSh/nZJ2GlzinE5z6AvEuIHVsQ==, tarball: file:projects/model-all.tgz} id: file:projects/model-all.tgz name: '@rush-temp/model-all' version: 0.0.0 @@ -18894,7 +19025,7 @@ packages: dev: false file:projects/model-contact.tgz(svelte@4.2.11): - resolution: {integrity: sha512-1KCFugNTofKCnrBf9i+b5/XOflGD7esyG7mzy8YkX1n4AyI9YlFOLUuURGucEol5uKKU797NGRa2BO6iECAWbw==, tarball: file:projects/model-contact.tgz} + resolution: {integrity: sha512-Rv8gLCvBayo+s//ldMnTatYDhJX6vXj46H9nE3L88EJK1m+9Y7dkYKNE7j6tmRNrfPIy+jHdLgumwXX313Ts/g==, tarball: file:projects/model-contact.tgz} id: file:projects/model-contact.tgz name: '@rush-temp/model-contact' version: 0.0.0 @@ -18958,6 +19089,27 @@ packages: - svelte dev: false + file:projects/model-guest.tgz(svelte@4.2.11): + resolution: {integrity: sha512-AT15/UZNrG5UB+SntcmV9cyza8Fh/u50uw7xijag/O0J4cwzvdBO1fWAOhstQ0FmIVY+FUnttelz2cZNf1wYjg==, tarball: file:projects/model-guest.tgz} + id: file:projects/model-guest.tgz + name: '@rush-temp/model-guest' + version: 0.0.0 + dependencies: + '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0)(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.21.0(eslint@8.56.0)(typescript@5.3.3) + eslint: 8.56.0 + eslint-config-standard-with-typescript: 40.0.0(@typescript-eslint/eslint-plugin@6.21.0)(eslint-plugin-import@2.29.1)(eslint-plugin-n@15.7.0)(eslint-plugin-promise@6.1.1)(eslint@8.56.0)(typescript@5.3.3) + eslint-plugin-import: 2.29.1(eslint@8.56.0) + eslint-plugin-n: 15.7.0(eslint@8.56.0) + eslint-plugin-promise: 6.1.1(eslint@8.56.0) + prettier: 3.2.5 + prettier-plugin-svelte: 3.2.1(prettier@3.2.5)(svelte@4.2.11) + typescript: 5.3.3 + transitivePeerDependencies: + - supports-color + - svelte + dev: false + file:projects/model-hr.tgz(svelte@4.2.11): resolution: {integrity: sha512-m1fNr1rzBg+FqCPoeWyo1GE0BmA1TRTTgNe3s48jF0b16O0EVtlW6c24vaex1Xaf7rPyrFAYyoVd4XLMGr1Row==, tarball: file:projects/model-hr.tgz} id: file:projects/model-hr.tgz @@ -19295,6 +19447,27 @@ packages: - svelte dev: false + file:projects/model-server-guest.tgz(svelte@4.2.11): + resolution: {integrity: sha512-akEz5ZppVM2lB6j5w2nZUoGsmluulr/MwMPlyNsxYNYC1tgqC+u14khPAOWkoRyjdsPGGHFdbyMRDEQNBE/OKg==, tarball: file:projects/model-server-guest.tgz} + id: file:projects/model-server-guest.tgz + name: '@rush-temp/model-server-guest' + version: 0.0.0 + dependencies: + '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0)(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.21.0(eslint@8.56.0)(typescript@5.3.3) + eslint: 8.56.0 + eslint-config-standard-with-typescript: 40.0.0(@typescript-eslint/eslint-plugin@6.21.0)(eslint-plugin-import@2.29.1)(eslint-plugin-n@15.7.0)(eslint-plugin-promise@6.1.1)(eslint@8.56.0)(typescript@5.3.3) + eslint-plugin-import: 2.29.1(eslint@8.56.0) + eslint-plugin-n: 15.7.0(eslint@8.56.0) + eslint-plugin-promise: 6.1.1(eslint@8.56.0) + prettier: 3.2.5 + prettier-plugin-svelte: 3.2.1(prettier@3.2.5)(svelte@4.2.11) + typescript: 5.3.3 + transitivePeerDependencies: + - supports-color + - svelte + dev: false + file:projects/model-server-hr.tgz(svelte@4.2.11): resolution: {integrity: sha512-M4L3fW3gYeKBdXk3PaHy4u1tuCq0AAFIe6F/SWSeZioefq0f6GW+nerxFmAO3l/leySffba+rdXNmmOAzXleNw==, tarball: file:projects/model-server-hr.tgz} id: file:projects/model-server-hr.tgz @@ -19674,7 +19847,7 @@ packages: dev: false file:projects/model-task.tgz(svelte@4.2.11): - resolution: {integrity: sha512-x9V62r2Vhq0crzWctRsKFFXj7hWW01o82UGgFYZMWDKmOK9rH+Ab4EBwjkxJRg1IDJdTlCOh6BaXP50FZ8KUhg==, tarball: file:projects/model-task.tgz} + resolution: {integrity: sha512-dwcT+Z5GRNUUHfngIuBccTtt1yKE5ju1uOdAM2CcUAMWPRxtoh/ahFIYTPQMbIUIDkGqKA5F62c6C1+NTL1FhQ==, tarball: file:projects/model-task.tgz} id: file:projects/model-task.tgz name: '@rush-temp/model-task' version: 0.0.0 @@ -20335,7 +20508,7 @@ packages: dev: false file:projects/pod-server.tgz(svelte@4.2.11): - resolution: {integrity: sha512-Vu7R/lyLRjCyqDTofzOdVCFk67PxBM5neEHd82HBLrNniUjVrmCfEFt4IBQOgpoTy1cM73swFSsl7UEyLA0VOQ==, tarball: file:projects/pod-server.tgz} + resolution: {integrity: sha512-t0dTTvzR0GNGvvEi8f/KAk65SeP43eYlOH5Bh1ObHU0zb7NAH8idybiYypKKkpRrZHydTDL/C1iFrjXTrqqVKQ==, tarball: file:projects/pod-server.tgz} id: file:projects/pod-server.tgz name: '@rush-temp/pod-server' version: 0.0.0 @@ -20482,7 +20655,7 @@ packages: dev: false file:projects/prod.tgz(bufferutil@4.0.8)(sass@1.71.1)(ts-node@10.9.2): - resolution: {integrity: sha512-wxoPP5P+qy7KnUurqydjBwLhbA7sDZ2DKpp0IZeHAUM1XVUyGG7+lmtH4D5s3iCVCwzvZ8qZks66ncp3ejqeFQ==, tarball: file:projects/prod.tgz} + resolution: {integrity: sha512-sz8Xw/l82dtTDjeUD5fIOHpy9rjyTrbw1H7gh31h8nZxztMjPRZw9kRs9bzs9KidAPLnWEA/jL5T9j8QfaU01w==, tarball: file:projects/prod.tgz} id: file:projects/prod.tgz name: '@rush-temp/prod' version: 0.0.0 @@ -21367,6 +21540,70 @@ packages: - ts-node dev: false + file:projects/server-guest-resources.tgz(@types/node@20.11.19)(esbuild@0.20.1)(svelte@4.2.11)(ts-node@10.9.2): + resolution: {integrity: sha512-oxxjV/UtqYFgmLBSfc+vkVFUgLsaMFU/x77GCv8dEHlLlXJTUx5uqkhVB/xh6r3G3j0pT+XaUwhedEWqOWVb/A==, tarball: file:projects/server-guest-resources.tgz} + id: file:projects/server-guest-resources.tgz + name: '@rush-temp/server-guest-resources' + version: 0.0.0 + dependencies: + '@types/jest': 29.5.12 + '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0)(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.21.0(eslint@8.56.0)(typescript@5.3.3) + eslint: 8.56.0 + eslint-config-standard-with-typescript: 40.0.0(@typescript-eslint/eslint-plugin@6.21.0)(eslint-plugin-import@2.29.1)(eslint-plugin-n@15.7.0)(eslint-plugin-promise@6.1.1)(eslint@8.56.0)(typescript@5.3.3) + eslint-plugin-import: 2.29.1(eslint@8.56.0) + eslint-plugin-n: 15.7.0(eslint@8.56.0) + eslint-plugin-promise: 6.1.1(eslint@8.56.0) + jest: 29.7.0(@types/node@20.11.19)(ts-node@10.9.2) + prettier: 3.2.5 + prettier-plugin-svelte: 3.2.1(prettier@3.2.5)(svelte@4.2.11) + ts-jest: 29.1.2(esbuild@0.20.1)(jest@29.7.0)(typescript@5.3.3) + typescript: 5.3.3 + transitivePeerDependencies: + - '@babel/core' + - '@jest/types' + - '@types/node' + - babel-jest + - babel-plugin-macros + - esbuild + - node-notifier + - supports-color + - svelte + - ts-node + dev: false + + file:projects/server-guest.tgz(esbuild@0.20.1)(svelte@4.2.11)(ts-node@10.9.2): + resolution: {integrity: sha512-M1JF30TVm4MhIwj+KQme/VjmeoGGjUwhsntBcABceM+IewzJigjYhmVR4XTKURx9IbdHv1ibqqZhxjxkW/aFZg==, tarball: file:projects/server-guest.tgz} + id: file:projects/server-guest.tgz + name: '@rush-temp/server-guest' + version: 0.0.0 + dependencies: + '@types/jest': 29.5.12 + '@types/node': 20.11.19 + '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0)(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.21.0(eslint@8.56.0)(typescript@5.3.3) + eslint: 8.56.0 + eslint-config-standard-with-typescript: 40.0.0(@typescript-eslint/eslint-plugin@6.21.0)(eslint-plugin-import@2.29.1)(eslint-plugin-n@15.7.0)(eslint-plugin-promise@6.1.1)(eslint@8.56.0)(typescript@5.3.3) + eslint-plugin-import: 2.29.1(eslint@8.56.0) + eslint-plugin-n: 15.7.0(eslint@8.56.0) + eslint-plugin-promise: 6.1.1(eslint@8.56.0) + jest: 29.7.0(@types/node@20.11.19)(ts-node@10.9.2) + prettier: 3.2.5 + prettier-plugin-svelte: 3.2.1(prettier@3.2.5)(svelte@4.2.11) + ts-jest: 29.1.2(esbuild@0.20.1)(jest@29.7.0)(typescript@5.3.3) + typescript: 5.3.3 + transitivePeerDependencies: + - '@babel/core' + - '@jest/types' + - babel-jest + - babel-plugin-macros + - esbuild + - node-notifier + - supports-color + - svelte + - ts-node + dev: false + file:projects/server-hr-resources.tgz(@types/node@20.11.19)(esbuild@0.20.1)(svelte@4.2.11)(ts-node@10.9.2): resolution: {integrity: sha512-9ynW2uOReTvLE+Io8c0xqxZNaVh+BbgbRJdAV/Y3GptWFzoyizvF7tfpwJaa/KWz53rDcVRlrXtHg/izZS6g9A==, tarball: file:projects/server-hr-resources.tgz} id: file:projects/server-hr-resources.tgz @@ -23281,7 +23518,7 @@ packages: dev: false file:projects/tool.tgz(bufferutil@4.0.8)(svelte@4.2.11): - resolution: {integrity: sha512-7SvydeuLUJiHLfgw7qRAuhTOopzoN6XU4XlWoQoDi+YYE4fj+c6PCZPP3GVotIOXCC3uNZe4wrFyrGClRhU0IA==, tarball: file:projects/tool.tgz} + resolution: {integrity: sha512-OrzOa2Flf5T2Yto4XM6PVEb19EWtTh3ektrC/qUedc4e4Fc/0Ihqqe7gyvD09KKfrczfagnn2061YZy9xFRh5w==, tarball: file:projects/tool.tgz} id: file:projects/tool.tgz name: '@rush-temp/tool' version: 0.0.0 @@ -23568,7 +23805,7 @@ packages: dev: false file:projects/view-resources.tgz(@types/node@20.11.19)(esbuild@0.20.1)(postcss-load-config@4.0.2)(postcss@8.4.35)(ts-node@10.9.2): - resolution: {integrity: sha512-+A80Ph9sdIfb1nBd6Th+OmqDik7Ky4ImRa+b9i1XPkBQEAM4Fv9m6A+Ebq9lIi6pjJmiF8f4v4S+mVaZr0o3Hg==, tarball: file:projects/view-resources.tgz} + resolution: {integrity: sha512-SMUz1ewMVxZdhnE79sVLeW8cf5uNr+e1QtZDELM/JTTPLBy9IthoGoHCXf9NaWWHTVp2uEPDF4r74/dJw8Vmhg==, tarball: file:projects/view-resources.tgz} id: file:projects/view-resources.tgz name: '@rush-temp/view-resources' version: 0.0.0 diff --git a/dev/prod/package.json b/dev/prod/package.json index a927b17ab5..e80750f252 100644 --- a/dev/prod/package.json +++ b/dev/prod/package.json @@ -175,6 +175,9 @@ "@hcengineering/server-view": "^0.6.0", "@hcengineering/server-view-resources": "^0.6.0", "@hcengineering/server-activity": "^0.6.0", - "@hcengineering/server-activity-resources": "^0.6.0" + "@hcengineering/server-activity-resources": "^0.6.0", + "@hcengineering/guest": "^0.6.0", + "@hcengineering/guest-assets": "^0.6.0", + "@hcengineering/guest-resources": "^0.6.0" } } diff --git a/dev/prod/src/platform.ts b/dev/prod/src/platform.ts index c0da00fe79..879a5e610d 100644 --- a/dev/prod/src/platform.ts +++ b/dev/prod/src/platform.ts @@ -23,6 +23,7 @@ import { chunterId } from '@hcengineering/chunter' import client, { clientId } from '@hcengineering/client' import contactPlugin, { contactId } from '@hcengineering/contact' import gmail, { gmailId } from '@hcengineering/gmail' +import guest, { guestId } from '@hcengineering/guest' import { hrId } from '@hcengineering/hr' import { imageCropperId } from '@hcengineering/image-cropper' import { inventoryId } from '@hcengineering/inventory' @@ -53,6 +54,7 @@ import '@hcengineering/calendar-assets' import '@hcengineering/chunter-assets' import '@hcengineering/contact-assets' import '@hcengineering/gmail-assets' +import '@hcengineering/guest-assets' import '@hcengineering/hr-assets' import '@hcengineering/inventory-assets' import '@hcengineering/lead-assets' @@ -76,9 +78,9 @@ import presentation, { presentationId } from '@hcengineering/presentation' import textEditor, { textEditorId } from '@hcengineering/text-editor' import { setMetadata } from '@hcengineering/platform' +import { preferenceId } from '@hcengineering/preference' import { setDefaultLanguage } from '@hcengineering/theme' import { uiId } from '@hcengineering/ui/src/plugin' -import { preferenceId } from '@hcengineering/preference' interface Config { ACCOUNTS_URL: string @@ -130,6 +132,7 @@ function configureI18n(): void { addStringsLoader(trackerId, async (lang: string) => await import(`@hcengineering/tracker-assets/lang/${lang}.json`)) addStringsLoader(viewId, async (lang: string) => await import(`@hcengineering/view-assets/lang/${lang}.json`)) addStringsLoader(workbenchId, async (lang: string) => await import(`@hcengineering/workbench-assets/lang/${lang}.json`)) + addStringsLoader(guestId, async (lang: string) => await import(`@hcengineering/guest-assets/lang/${lang}.json`)) } export async function configurePlatform() { @@ -169,7 +172,8 @@ export async function configurePlatform() { new Map([ [workbenchId, workbench.component.WorkbenchApp], [loginId, login.component.LoginApp], - [calendarId, calendar.component.ConnectApp] + [calendarId, calendar.component.ConnectApp], + [guestId, guest.component.GuestApp] ]) ) @@ -204,6 +208,7 @@ export async function configurePlatform() { addLocation(bitrixId, () => import(/* webpackChunkName: "bitrix" */ '@hcengineering/bitrix-resources')) addLocation(requestId, () => import(/* webpackChunkName: "request" */ '@hcengineering/request-resources')) addLocation(supportId, () => import(/* webpackChunkName: "support" */ '@hcengineering/support-resources')) + addLocation(guestId, () => import(/* webpackChunkName: "guest" */ '@hcengineering/guest-resources')) setMetadata(client.metadata.FilterModel, true) setMetadata(client.metadata.ExtraPlugins, ['preference' as Plugin]) diff --git a/dev/tool/package.json b/dev/tool/package.json index ca76bff994..42db1a9c3c 100644 --- a/dev/tool/package.json +++ b/dev/tool/package.json @@ -119,6 +119,8 @@ "@hcengineering/server-view-resources": "^0.6.0", "@hcengineering/server-activity": "^0.6.0", "@hcengineering/server-activity-resources": "^0.6.0", + "@hcengineering/server-guest": "^0.6.0", + "@hcengineering/server-guest-resources": "^0.6.0", "@hcengineering/setting": "^0.6.11", "@hcengineering/tags": "^0.6.12", "@hcengineering/task": "^0.6.13", diff --git a/dev/tool/src/__start.ts b/dev/tool/src/__start.ts index 10785ddb16..db386dd5ec 100644 --- a/dev/tool/src/__start.ts +++ b/dev/tool/src/__start.ts @@ -41,6 +41,7 @@ import { serverTaskId } from '@hcengineering/server-task' import { serverTelegramId } from '@hcengineering/server-telegram' import { serverTrackerId } from '@hcengineering/server-tracker' import { serverViewId } from '@hcengineering/server-view' +import { serverGuestId } from '@hcengineering/server-guest' addLocation(serverActivityId, () => import('@hcengineering/server-activity-resources')) addLocation(serverAttachmentId, () => import('@hcengineering/server-attachment-resources')) @@ -61,6 +62,7 @@ addLocation(serverTelegramId, () => import('@hcengineering/server-telegram-resou addLocation(serverHrId, () => import('@hcengineering/server-hr-resources')) addLocation(serverRequestId, () => import('@hcengineering/server-request-resources')) addLocation(serverViewId, () => import('@hcengineering/server-view-resources')) +addLocation(serverGuestId, () => import('@hcengineering/server-guest-resources')) function prepareTools (): { mongodbUri: string diff --git a/dev/tool/src/index.ts b/dev/tool/src/index.ts index cac9b21f19..5383207b19 100644 --- a/dev/tool/src/index.ts +++ b/dev/tool/src/index.ts @@ -48,7 +48,7 @@ import { type Db, MongoClient } from 'mongodb' import { clearTelegramHistory } from './telegram' import { diffWorkspace, updateField } from './workspace' -import { type Data, getWorkspaceId, RateLimiter, type Tx, type Version } from '@hcengineering/core' +import { type Data, getWorkspaceId, RateLimiter, type Tx, type Version, type AccountRole } from '@hcengineering/core' import { type MinioService } from '@hcengineering/minio' import { consoleModelLogger, type MigrateOperation } from '@hcengineering/model' import { openAIConfigDefaults } from '@hcengineering/openai' @@ -228,7 +228,7 @@ export function devTool ( program .command('set-user-role ') .description('set user role') - .action(async (email: string, workspace: string, role: number, cmd) => { + .action(async (email: string, workspace: string, role: AccountRole, cmd) => { console.log(`set user ${email} role for ${workspace}...`) await setRole(email, workspace, productId, role) }) diff --git a/models/all/package.json b/models/all/package.json index c21ee97e2e..88e30dcb98 100644 --- a/models/all/package.json +++ b/models/all/package.json @@ -83,6 +83,8 @@ "@hcengineering/model-server-activity": "^0.6.0", "@hcengineering/model-server-openai": "^0.6.0", "@hcengineering/model-server-translate": "^0.6.0", - "@hcengineering/model-support": "^0.6.0" + "@hcengineering/model-support": "^0.6.0", + "@hcengineering/model-guest": "^0.6.0", + "@hcengineering/model-server-guest": "^0.6.0" } } diff --git a/models/all/src/index.ts b/models/all/src/index.ts index c8cc054956..48207fdf60 100644 --- a/models/all/src/index.ts +++ b/models/all/src/index.ts @@ -67,6 +67,8 @@ import { textEditorId, createModel as textEditorModel } from '@hcengineering/mod import tracker, { trackerId, createModel as trackerModel } from '@hcengineering/model-tracker' import view, { viewId, createModel as viewModel } from '@hcengineering/model-view' import workbench, { workbenchId, createModel as workbenchModel } from '@hcengineering/model-workbench' +import { guestId, createModel as guestModel } from '@hcengineering/model-guest' +import { serverGuestId, createModel as serverGuestModel } from '@hcengineering/model-server-guest' import { openAIId, createModel as serverOpenAI } from '@hcengineering/model-server-openai' import { createModel as serverTranslate, translateId } from '@hcengineering/model-server-translate' @@ -111,6 +113,7 @@ export default function buildModel (enabled: string[] = ['*'], disabled: string[ [coreModel, coreId], [activityModel, activityId], [attachmentModel, attachmentId], + [guestModel, guestId], [tagsModel, tagsId], [viewModel, viewId], [workbenchModel, workbenchId], @@ -298,7 +301,8 @@ export default function buildModel (enabled: string[] = ['*'], disabled: string[ [serverViewModel, serverViewId], [serverActivityModel, serverActivityId], [serverTranslate, translateId], - [serverOpenAI, openAIId] + [serverOpenAI, openAIId], + [serverGuestModel, serverGuestId] ] for (const [b, id, config] of builders) { diff --git a/models/all/src/migration.ts b/models/all/src/migration.ts index 201737373a..2968496ccb 100644 --- a/models/all/src/migration.ts +++ b/models/all/src/migration.ts @@ -18,6 +18,7 @@ import { type MigrateOperation } from '@hcengineering/model' import { attachmentOperation } from '@hcengineering/model-attachment' import { chunterOperation } from '@hcengineering/model-chunter' import { contactOperation } from '@hcengineering/model-contact' +import { guestOperation } from '@hcengineering/model-guest' import { coreOperation } from '@hcengineering/model-core' import { gmailOperation } from '@hcengineering/model-gmail' import { leadOperation } from '@hcengineering/model-lead' @@ -54,6 +55,7 @@ export const migrateOperations: [string, MigrateOperation][] = [ ['recruit', recruitOperation], ['view', viewOperation], ['contact', contactOperation], + ['guest', guestOperation], ['tags', tagsOperation], ['setting', settingOperation], ['tracker', trackerOperation], diff --git a/models/contact/package.json b/models/contact/package.json index ec41226575..27ee1e2de8 100644 --- a/models/contact/package.json +++ b/models/contact/package.json @@ -48,6 +48,7 @@ "@hcengineering/templates": "^0.6.7", "@hcengineering/ui": "^0.6.11", "@hcengineering/view": "^0.6.9", + "@hcengineering/model-guest": "^0.6.0", "cross-fetch": "^3.1.5" } } diff --git a/models/contact/src/index.ts b/models/contact/src/index.ts index 17964cd8d5..9ccd46a98f 100644 --- a/models/contact/src/index.ts +++ b/models/contact/src/index.ts @@ -73,6 +73,7 @@ import templates from '@hcengineering/templates' import { type AnyComponent } from '@hcengineering/ui/src/types' import { type Action } from '@hcengineering/view' import contact from './plugin' +import { createPublicLinkAction } from '@hcengineering/model-guest' export { contactId } from '@hcengineering/contact' export { contactOperation } from './migration' @@ -1088,4 +1089,6 @@ export function createModel (builder: Builder): void { [], ['comments', 'attachments'] ) + + createPublicLinkAction(builder, contact.class.Contact, contact.action.PublicLink) } diff --git a/models/contact/src/plugin.ts b/models/contact/src/plugin.ts index e9b217012f..b04a4195ea 100644 --- a/models/contact/src/plugin.ts +++ b/models/contact/src/plugin.ts @@ -123,7 +123,8 @@ export default mergeIds(contactId, contact, { KickEmployee: '' as Ref, DeleteEmployee: '' as Ref, MergePersons: '' as Ref>, - OpenChannel: '' as Ref + OpenChannel: '' as Ref, + PublicLink: '' as Ref> }, actionImpl: { KickEmployee: '' as ViewAction, diff --git a/models/guest/.eslintrc.js b/models/guest/.eslintrc.js new file mode 100644 index 0000000000..c1cf82cba0 --- /dev/null +++ b/models/guest/.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/guest/.npmignore b/models/guest/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/models/guest/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/models/guest/config/rig.json b/models/guest/config/rig.json new file mode 100644 index 0000000000..2f6be36605 --- /dev/null +++ b/models/guest/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/guest/package.json b/models/guest/package.json new file mode 100644 index 0000000000..855fa12078 --- /dev/null +++ b/models/guest/package.json @@ -0,0 +1,42 @@ +{ + "name": "@hcengineering/model-guest", + "version": "0.6.0", + "main": "lib/index.js", + "author": "Anticrm Platform Contributors", + "svelte": "src/index.ts", + "types": "types/index.d.ts", + "template": "@hcengineering/model-package", + "license": "EPL-2.0", + "scripts": { + "build": "compile", + "build:watch": "compile", + "format": "format src", + "_phase:build": "compile transpile src", + "_phase:format": "format src", + "_phase:validate": "compile validate" + }, + "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", + "typescript": "^5.3.3" + }, + "dependencies": { + "@hcengineering/core": "^0.6.28", + "@hcengineering/model": "^0.6.7", + "@hcengineering/model-core": "^0.6.0", + "@hcengineering/model-view": "^0.6.0", + "@hcengineering/guest": "^0.6.0", + "@hcengineering/guest-resources": "^0.6.0", + "@hcengineering/platform": "^0.6.9", + "@hcengineering/ui": "^0.6.11", + "@hcengineering/view": "^0.6.9" + } +} diff --git a/models/guest/src/index.ts b/models/guest/src/index.ts new file mode 100644 index 0000000000..9a846cf2f6 --- /dev/null +++ b/models/guest/src/index.ts @@ -0,0 +1,35 @@ +import { AccountRole, type Doc, type Domain, type Ref } from '@hcengineering/core' +import { type PublicLink, type Restrictions, guestAccountEmail } from '@hcengineering/guest' +import { type Builder, Model } from '@hcengineering/model' +import core, { TDoc } from '@hcengineering/model-core' +import { type Location } from '@hcengineering/ui' +import guest from './plugin' + +const GUEST_DOMAIN = 'guest' as Domain + +@Model(guest.class.PublicLink, core.class.Doc, GUEST_DOMAIN) +export class TPublicLink extends TDoc implements PublicLink { + url!: string + location!: Location + restrictions!: Restrictions + revokable!: boolean + attachedTo!: Ref +} + +export function createModel (builder: Builder): void { + builder.createModel(TPublicLink) + + builder.createDoc( + core.class.Account, + core.space.Model, + { + email: guestAccountEmail, + role: AccountRole.Guest + }, + guest.account.Guest + ) +} + +export { guestId } from '@hcengineering/guest' +export * from './migration' +export * from './utils' diff --git a/models/guest/src/migration.ts b/models/guest/src/migration.ts new file mode 100644 index 0000000000..5acc4765e0 --- /dev/null +++ b/models/guest/src/migration.ts @@ -0,0 +1,97 @@ +import { + type Account, + AccountRole, + DOMAIN_TX, + type TxCreateDoc, + TxOperations, + type TxUpdateDoc +} from '@hcengineering/core' +import { guestId } from '@hcengineering/guest' +import { + type MigrateOperation, + type MigrationClient, + type MigrationUpgradeClient, + type ModelLogger, + tryMigrate +} from '@hcengineering/model' +import core from '@hcengineering/model-core' +import guest from './plugin' + +async function createSpace (tx: TxOperations): Promise { + const current = await tx.findOne(core.class.Space, { + _id: guest.space.Links + }) + if (current === undefined) { + await tx.createDoc( + core.class.Space, + core.space.Space, + { + name: 'Links', + description: 'Space for all guest links', + private: false, + archived: false, + members: [] + }, + guest.space.Links + ) + } +} + +async function createDefaults (client: MigrationUpgradeClient): Promise { + const txOp = new TxOperations(client, core.account.System) + await createSpace(txOp) +} + +export const guestOperation: MigrateOperation = { + async migrate (client: MigrationClient, logger: ModelLogger): Promise { + await tryMigrate(client, guestId, [ + { + state: 'migrateRoles', + func: async (client) => { + const stateMap = { + 0: AccountRole.User, + 1: AccountRole.Maintainer, + 2: AccountRole.Owner + } + const createTxes = await client.find>(DOMAIN_TX, { + _class: core.class.TxCreateDoc, + 'attributes.role': { $in: [0, 1, 2] } + }) + for (const tx of createTxes) { + await client.update( + DOMAIN_TX, + { + _id: tx._id + }, + { + $set: { + 'attributes.role': (stateMap as any)[tx.attributes.role] + } + } + ) + } + const updateTxes = await client.find>(DOMAIN_TX, { + _class: core.class.TxUpdateDoc, + 'operations.role': { $in: [0, 1, 2] } + }) + for (const tx of updateTxes) { + await client.update( + DOMAIN_TX, + { + _id: tx._id + }, + { + $set: { + 'operations.role': (stateMap as any)[(tx.operations as any).role] + } + } + ) + } + } + } + ]) + }, + async upgrade (client: MigrationUpgradeClient): Promise { + await createDefaults(client) + } +} diff --git a/models/guest/src/plugin.ts b/models/guest/src/plugin.ts new file mode 100644 index 0000000000..deff851c67 --- /dev/null +++ b/models/guest/src/plugin.ts @@ -0,0 +1,21 @@ +import { type Account, type Doc, type Ref } from '@hcengineering/core' +import { guestId } from '@hcengineering/guest' +import guest from '@hcengineering/guest-resources/src/plugin' +import { mergeIds } from '@hcengineering/platform' +import { type AnyComponent } from '@hcengineering/ui' +import { type Action, type ActionCategory } from '@hcengineering/view' + +export default mergeIds(guestId, guest, { + account: { + Guest: '' as Ref + }, + action: { + CreatePublicLink: '' as Ref> + }, + category: { + Guest: '' as Ref + }, + component: { + CreatePublicLink: '' as AnyComponent + } +}) diff --git a/models/guest/src/utils.ts b/models/guest/src/utils.ts new file mode 100644 index 0000000000..828f35bb5e --- /dev/null +++ b/models/guest/src/utils.ts @@ -0,0 +1,31 @@ +import { type Class, type Doc, type Ref } from '@hcengineering/core' +import { type Builder } from '@hcengineering/model' +import view, { createAction } from '@hcengineering/model-view' +import { type Action } from '@hcengineering/view' +import guest from './plugin' + +export function createPublicLinkAction (builder: Builder, _class: Ref>, _id: Ref>): void { + createAction( + builder, + { + action: view.actionImpl.ShowPopup, + actionProps: { + component: guest.component.CreatePublicLink, + element: 'top', + fillProps: { + _objects: 'value' + } + }, + label: guest.string.PublicLink, + icon: guest.icon.Link, + keyBinding: [], + input: 'any', + category: guest.category.Guest, + target: _class, + context: { + mode: ['context', 'browser'] + } + }, + _id + ) +} diff --git a/models/guest/tsconfig.json b/models/guest/tsconfig.json new file mode 100644 index 0000000000..cce8988c63 --- /dev/null +++ b/models/guest/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/models/server-guest/.eslintrc.js b/models/server-guest/.eslintrc.js new file mode 100644 index 0000000000..c1cf82cba0 --- /dev/null +++ b/models/server-guest/.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-guest/.npmignore b/models/server-guest/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/models/server-guest/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/models/server-guest/config/rig.json b/models/server-guest/config/rig.json new file mode 100644 index 0000000000..2f6be36605 --- /dev/null +++ b/models/server-guest/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-guest/package.json b/models/server-guest/package.json new file mode 100644 index 0000000000..929f6d33a9 --- /dev/null +++ b/models/server-guest/package.json @@ -0,0 +1,39 @@ +{ + "name": "@hcengineering/model-server-guest", + "version": "0.6.0", + "main": "lib/index.js", + "svelte": "src/index.ts", + "types": "types/index.d.ts", + "author": "Anticrm Platform Contributors", + "template": "@hcengineering/model-package", + "license": "EPL-2.0", + "scripts": { + "build": "compile", + "build:watch": "compile", + "format": "format src", + "_phase:build": "compile transpile src", + "_phase:format": "format src", + "_phase:validate": "compile validate" + }, + "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", + "typescript": "^5.3.3" + }, + "dependencies": { + "@hcengineering/core": "^0.6.28", + "@hcengineering/model": "^0.6.7", + "@hcengineering/platform": "^0.6.9", + "@hcengineering/guest": "^0.6.0", + "@hcengineering/server-guest": "^0.6.0", + "@hcengineering/server-core": "^0.6.1" + } +} diff --git a/models/server-guest/src/index.ts b/models/server-guest/src/index.ts new file mode 100644 index 0000000000..0cf3273f04 --- /dev/null +++ b/models/server-guest/src/index.ts @@ -0,0 +1,34 @@ +// +// 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 { type Builder } from '@hcengineering/model' + +import core from '@hcengineering/core' +import guest from '@hcengineering/guest' +import serverCore from '@hcengineering/server-core' +import serverGuest from '@hcengineering/server-guest' + +export { serverGuestId } from '@hcengineering/server-guest' + +export function createModel (builder: Builder): void { + builder.createDoc(serverCore.class.Trigger, core.space.Model, { + trigger: serverGuest.trigger.OnPublicLinkCreate, + txMatch: { + _class: core.class.TxCreateDoc, + objectClass: guest.class.PublicLink, + 'attributes.url': '' + } + }) +} diff --git a/models/server-guest/tsconfig.json b/models/server-guest/tsconfig.json new file mode 100644 index 0000000000..cce8988c63 --- /dev/null +++ b/models/server-guest/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/models/task/package.json b/models/task/package.json index 477523713f..bd7d865938 100644 --- a/models/task/package.json +++ b/models/task/package.json @@ -38,6 +38,7 @@ "@hcengineering/model-core": "^0.6.0", "@hcengineering/model-presentation": "^0.6.0", "@hcengineering/model-tags": "^0.6.0", + "@hcengineering/model-guest": "^0.6.0", "@hcengineering/model-view": "^0.6.0", "@hcengineering/model-workbench": "^0.6.1", "@hcengineering/platform": "^0.6.9", diff --git a/models/task/src/index.ts b/models/task/src/index.ts index 12b89a4551..add47db5b5 100644 --- a/models/task/src/index.ts +++ b/models/task/src/index.ts @@ -83,6 +83,7 @@ import { import type { AnyComponent } from '@hcengineering/ui' import { PaletteColorIndexes } from '@hcengineering/ui/src/colors' import { type ViewAction } from '@hcengineering/view' +import { createPublicLinkAction } from '@hcengineering/model-guest' import task from './plugin' @@ -557,6 +558,8 @@ export function createModel (builder: Builder): void { }, task.ids.ManageProjects ) + + createPublicLinkAction(builder, task.class.Task, task.action.PublicLink) } /** diff --git a/models/task/src/plugin.ts b/models/task/src/plugin.ts index be6a9c0cc5..82e240d8f3 100644 --- a/models/task/src/plugin.ts +++ b/models/task/src/plugin.ts @@ -15,7 +15,7 @@ // import {} from '@hcengineering/notification' -import type { Ref, Space } from '@hcengineering/core' +import type { Doc, Ref, Space } from '@hcengineering/core' import { mergeIds, type IntlString } from '@hcengineering/platform' import { type TagCategory } from '@hcengineering/tags' import { taskId } from '@hcengineering/task' @@ -28,7 +28,8 @@ export default mergeIds(taskId, task, { EditStatuses: '' as Ref, ArchiveSpace: '' as Ref, UnarchiveSpace: '' as Ref, - ArchiveState: '' as Ref + ArchiveState: '' as Ref, + PublicLink: '' as Ref> }, actionImpl: { EditStatuses: '' as ViewAction, diff --git a/models/tracker/src/types.ts b/models/tracker/src/types.ts index 8c5b0d8104..4cc030b65b 100644 --- a/models/tracker/src/types.ts +++ b/models/tracker/src/types.ts @@ -233,7 +233,6 @@ export class TIssue extends TTask implements Issue { estimation!: number @Prop(TypeReportedTime(), tracker.string.ReportedTime) - @ReadOnly() reportedTime!: number @Prop(TypeRemainingTime(), tracker.string.RemainingTime) diff --git a/packages/core/src/__tests__/memdb.test.ts b/packages/core/src/__tests__/memdb.test.ts index dcb73fa91d..0913724475 100644 --- a/packages/core/src/__tests__/memdb.test.ts +++ b/packages/core/src/__tests__/memdb.test.ts @@ -13,7 +13,7 @@ // limitations under the License. // -import { Client } from '..' +import { AccountRole, Client } from '..' import type { Class, Doc, Obj, Ref } from '../classes' import core from '../component' import { Hierarchy } from '../hierarchy' @@ -250,7 +250,7 @@ describe('memdb', () => { }) const account = await model.createDoc(core.class.Account, core.space.Model, { email: 'email', - role: 0 + role: AccountRole.User }) await model.updateDoc(core.class.Space, core.space.Model, space, { $push: { members: account } }) const txSpace = await model.findAll(core.class.Space, { _id: space }) diff --git a/packages/core/src/classes.ts b/packages/core/src/classes.ts index e86bfcb11c..5bdb434b66 100644 --- a/packages/core/src/classes.ts +++ b/packages/core/src/classes.ts @@ -366,9 +366,20 @@ export interface Account extends Doc { * @public */ export enum AccountRole { - User, - Maintainer, - Owner + Guest = 'GUEST', + User = 'USER', + Maintainer = 'MAINTAINER', + Owner = 'OWNER' +} + +/** + * @public + */ +export const roleOrder: Record = { + [AccountRole.Guest]: 1, + [AccountRole.User]: 2, + [AccountRole.Maintainer]: 3, + [AccountRole.Owner]: 4 } /** diff --git a/packages/presentation/img/chen.png b/packages/presentation/img/chen.png deleted file mode 100755 index 9f9d110791..0000000000 Binary files a/packages/presentation/img/chen.png and /dev/null differ diff --git a/packages/presentation/src/components/AttributeEditor.svelte b/packages/presentation/src/components/AttributeEditor.svelte index 28f024f6f9..56ce7b4805 100644 --- a/packages/presentation/src/components/AttributeEditor.svelte +++ b/packages/presentation/src/components/AttributeEditor.svelte @@ -48,8 +48,10 @@ } } + $: isReadonly = (attribute.readonly ?? false) || !editable + function onChange (value: any): void { - if (!editable) return + if (isReadonly) return const doc = object as Doc void updateAttribute(client, doc, _class, { key: attributeKey, attr: attribute }, value) } @@ -64,6 +66,9 @@ label={attribute?.label} placeholder={attribute?.label} type={attribute?.type} + readonly={isReadonly} + editable={!isReadonly} + disabled={isReadonly} {maxWidth} {attributeKey} value={getAttribute(client, object, { key: attributeKey, attr: attribute })} diff --git a/packages/presentation/src/components/DraggableList.svelte b/packages/presentation/src/components/DraggableList.svelte index 41985d1036..b59d69a193 100644 --- a/packages/presentation/src/components/DraggableList.svelte +++ b/packages/presentation/src/components/DraggableList.svelte @@ -98,7 +98,7 @@ class:is-dragged-over-down={draggingIndex !== null && index > draggingIndex && index === hoveringIndex} class:drag-over-highlight={index === dragOverIndex} draggable={editable} - on:contextmenu|preventDefault={(ev) => checkIsNotDraft(object) && showContextMenu?.(ev, object)} + on:contextmenu={(ev) => checkIsNotDraft(object) && showContextMenu?.(ev, object)} on:dragstart={(ev) => { handleDragStart(ev, index) }} diff --git a/packages/presentation/src/components/NavLink.svelte b/packages/presentation/src/components/NavLink.svelte index 5ff20655ba..3e0b407caa 100644 --- a/packages/presentation/src/components/NavLink.svelte +++ b/packages/presentation/src/components/NavLink.svelte @@ -59,6 +59,7 @@ 3 $: narrowModel = trimmed ? [models[0], models[models.length - 1]] : models @@ -51,7 +52,7 @@ {:else} {@const { title, href, onClick } = model} - +
{title}
{/if} diff --git a/packages/query/src/__tests__/minmodel.ts b/packages/query/src/__tests__/minmodel.ts index 7bea8a83d7..8e7322b60e 100644 --- a/packages/query/src/__tests__/minmodel.ts +++ b/packages/query/src/__tests__/minmodel.ts @@ -14,7 +14,7 @@ // import type { Account, Arr, Class, Data, Doc, Domain, Mixin, Obj, Ref, TxCreateDoc, TxCUD } from '@hcengineering/core' -import core, { AttachedDoc, ClassifierKind, DOMAIN_MODEL, DOMAIN_TX, TxFactory } from '@hcengineering/core' +import core, { AccountRole, AttachedDoc, ClassifierKind, DOMAIN_MODEL, DOMAIN_TX, TxFactory } from '@hcengineering/core' import type { IntlString, Plugin } from '@hcengineering/platform' import { plugin } from '@hcengineering/platform' @@ -194,8 +194,8 @@ export function genMinModel (): TxCUD[] { const u1 = 'User1' as Ref const u2 = 'User2' as Ref txes.push( - createDoc(core.class.Account, { email: 'user1@site.com', role: 0 }, u1), - createDoc(core.class.Account, { email: 'user2@site.com', role: 0 }, u2), + createDoc(core.class.Account, { email: 'user1@site.com', role: AccountRole.User }, u1), + createDoc(core.class.Account, { email: 'user2@site.com', role: AccountRole.User }, u2), createDoc(core.class.Space, { name: 'Sp1', description: '', diff --git a/packages/query/src/__tests__/query.test.ts b/packages/query/src/__tests__/query.test.ts index 365649b87a..7d6bf134c3 100644 --- a/packages/query/src/__tests__/query.test.ts +++ b/packages/query/src/__tests__/query.test.ts @@ -14,6 +14,7 @@ // import core, { + AccountRole, createClient, Doc, generateId, @@ -105,7 +106,7 @@ describe('query', () => { await factory.createDoc(core.class.Account, core.space.Model, { email: 'user1@site.com', - role: 0 + role: AccountRole.User }) await factory.createDoc(core.class.Space, core.space.Model, { private: true, diff --git a/packages/text-editor/src/components/CollaborativeAttributeBox.svelte b/packages/text-editor/src/components/CollaborativeAttributeBox.svelte index 12ecf68e7a..e35204da61 100644 --- a/packages/text-editor/src/components/CollaborativeAttributeBox.svelte +++ b/packages/text-editor/src/components/CollaborativeAttributeBox.svelte @@ -27,7 +27,7 @@ export let object: Doc export let key: KeyedAttribute - + export let readonly = false export let textNodeActions: TextNodeAction[] = [] export let refActions: RefAction[] = [] @@ -118,6 +118,7 @@ {attachFile} {placeholder} {boundary} + {readonly} field={key.key} on:focus on:blur diff --git a/packages/ui/img/chen.png b/packages/ui/img/chen.png deleted file mode 100755 index 9f9d110791..0000000000 Binary files a/packages/ui/img/chen.png and /dev/null differ diff --git a/packages/ui/img/elon.png b/packages/ui/img/elon.png deleted file mode 100755 index 7bf7c0983e..0000000000 Binary files a/packages/ui/img/elon.png and /dev/null differ diff --git a/packages/ui/img/kathryn.png b/packages/ui/img/kathryn.png deleted file mode 100755 index dbc348a1c6..0000000000 Binary files a/packages/ui/img/kathryn.png and /dev/null differ diff --git a/packages/ui/img/tim.png b/packages/ui/img/tim.png deleted file mode 100755 index 065e314e63..0000000000 Binary files a/packages/ui/img/tim.png and /dev/null differ diff --git a/packages/ui/src/components/Button.svelte b/packages/ui/src/components/Button.svelte index 8f566bfe9b..41f70049cc 100644 --- a/packages/ui/src/components/Button.svelte +++ b/packages/ui/src/components/Button.svelte @@ -14,7 +14,8 @@ --> {#if !isHidden} @@ -170,14 +173,14 @@ props={{ object: message, embedded, onReply }} /> {/if} - + {#if parentMessage && showEmbedded}
{/if}
- {#if withActions} + {#if withActions && !readonly}
{ e.stopPropagation() e.preventDefault() @@ -47,6 +49,7 @@ } function openEmojiPalette (ev: Event) { + if (readonly) return ev.preventDefault() ev.stopPropagation() showPopup(EmojiPopup, {}, ev.target as HTMLElement, (emoji: string) => { @@ -61,6 +64,7 @@
@@ -70,7 +74,7 @@
{/each} - {#if object && reactionsAccounts.size > 0} + {#if object && reactionsAccounts.size > 0 && !readonly}
@@ -102,7 +106,6 @@ height: 1.5rem; background: var(--secondary-button-disabled); border: none; - cursor: pointer; &:hover { border: 1px solid var(--theme-darker-color); diff --git a/plugins/activity-resources/src/components/reactions/ReactionsPresenter.svelte b/plugins/activity-resources/src/components/reactions/ReactionsPresenter.svelte index 7d782475ca..4614fbc6da 100644 --- a/plugins/activity-resources/src/components/reactions/ReactionsPresenter.svelte +++ b/plugins/activity-resources/src/components/reactions/ReactionsPresenter.svelte @@ -13,13 +13,14 @@ // limitations under the License. --> {#if object && hasReactions} {/if} diff --git a/plugins/attachment-resources/src/components/AttachmentActions.svelte b/plugins/attachment-resources/src/components/AttachmentActions.svelte index e158cff0d4..b91bad6c66 100644 --- a/plugins/attachment-resources/src/components/AttachmentActions.svelte +++ b/plugins/attachment-resources/src/components/AttachmentActions.svelte @@ -16,7 +16,7 @@ import type { Attachment } from '@hcengineering/attachment' import { getResource } from '@hcengineering/platform' import { PDFViewer, getFileUrl } from '@hcengineering/presentation' - import { ActionIcon, IconMoreH, IconOpen, Menu, closeTooltip, showPopup } from '@hcengineering/ui' + import { Action as UIAction, ActionIcon, IconMoreH, IconOpen, Menu, closeTooltip, showPopup } from '@hcengineering/ui' import view, { Action } from '@hcengineering/view' import attachmentPlugin from '../plugin' @@ -24,6 +24,7 @@ export let attachment: Attachment export let isSaved = false + export let removable = false let download: HTMLAnchorElement @@ -56,38 +57,40 @@ action: attachmentPlugin.actionImpl.AddAttachmentToSaved } as unknown as Action) + const openAction: UIAction = { + label: view.string.Open, + icon: IconOpen, + action: async (props: any, evt: Event) => { + showPreview(evt as MouseEvent) + } + } + const showMenu = (ev: Event) => { + const actions: UIAction[] = [] + if (openable) { + actions.push(openAction) + } + actions.push({ + label: saveAttachmentAction.label, + icon: saveAttachmentAction.icon, + action: async (props: any, evt: Event) => { + const impl = await getResource(saveAttachmentAction.action) + await impl(attachment, evt) + } + }) + if (removable) { + actions.push({ + label: attachmentPlugin.string.DeleteFile, + action: async (props: any, evt: Event) => { + const impl = await getResource(attachmentPlugin.actionImpl.DeleteAttachment) + await impl(attachment, evt) + } + }) + } showPopup( Menu, { - actions: [ - ...(openable - ? [ - { - label: view.string.Open, - icon: IconOpen, - action: async (props: any, evt: MouseEvent) => { - showPreview(evt) - } - } - ] - : []), - { - label: saveAttachmentAction.label, - icon: saveAttachmentAction.icon, - action: async (props: any, evt: MouseEvent) => { - const impl = await getResource(saveAttachmentAction.action) - await impl(attachment, evt) - } - }, - { - label: attachmentPlugin.string.DeleteFile, - action: async (props: any, evt: MouseEvent) => { - const impl = await getResource(attachmentPlugin.actionImpl.DeleteAttachment) - await impl(attachment, evt) - } - } - ] + actions }, ev.target as HTMLElement ) diff --git a/plugins/attachment-resources/src/components/AttachmentPreview.svelte b/plugins/attachment-resources/src/components/AttachmentPreview.svelte index 8bfc7f2695..ca20c47dca 100644 --- a/plugins/attachment-resources/src/components/AttachmentPreview.svelte +++ b/plugins/attachment-resources/src/components/AttachmentPreview.svelte @@ -27,6 +27,7 @@ export let value: Attachment export let isSaved: boolean = false export let listProvider: ListSelectionProvider | undefined = undefined + export let removable: boolean = false const dispatch = createEventDispatcher() $: type = getType(value.type) @@ -58,14 +59,14 @@ alt={value.name} />
- +
{:else if type === 'audio'}
- +
{:else if type === 'video'} @@ -78,14 +79,14 @@
- +
{:else}
- +
{/if} diff --git a/plugins/attachment-resources/src/components/AttachmentStyleBoxCollabEditor.svelte b/plugins/attachment-resources/src/components/AttachmentStyleBoxCollabEditor.svelte index 667581cca7..2c8c85bf36 100644 --- a/plugins/attachment-resources/src/components/AttachmentStyleBoxCollabEditor.svelte +++ b/plugins/attachment-resources/src/components/AttachmentStyleBoxCollabEditor.svelte @@ -34,6 +34,7 @@ export let enableAttachments: boolean = true export let useAttachmentPreview: boolean = false + export let readonly: boolean = false const client = getClient() @@ -43,7 +44,7 @@ let extraActions: RefAction[] = [] let modelRefActions: RefAction[] = [] - $: if (enableAttachments) { + $: if (enableAttachments && !readonly) { extraActions = [ { label: textEditor.string.Attach, @@ -59,10 +60,12 @@ void getModelRefActions().then((actions) => { modelRefActions = actions }) - $: refActions = defaultRefActions - .concat(extraActions) - .concat(modelRefActions) - .sort((a, b) => a.order - b.order) + $: refActions = readonly + ? [] + : defaultRefActions + .concat(extraActions) + .concat(modelRefActions) + .sort((a, b) => a.order - b.order) let progress = false let attachments: Attachment[] = [] @@ -89,6 +92,7 @@ } async function fileSelected (): Promise { + if (readonly) return progress = true const list = inputFile.files if (list === null || list.length === 0) return @@ -155,6 +159,7 @@ } export async function pasteAction (evt: ClipboardEvent): Promise { + if (readonly) return if (!isAllowedPaste(evt)) { return } @@ -172,6 +177,7 @@ } export async function fileDrop (e: DragEvent): Promise { + if (readonly) return progress = true const list = e.dataTransfer?.files if (list !== undefined && list.length !== 0) { @@ -231,6 +237,7 @@ {placeholder} {boundary} {refActions} + {readonly} attachFile={async (file) => { return await createAttachment(file) }} @@ -248,6 +255,7 @@ {#if (attachments.length > 0 && enableAttachments) || progress} [] = [] + export let readonly: boolean = false let element: HTMLElement let attachmentPopupId: string = '' @@ -46,11 +47,16 @@
{#each attachments as attachment (attachment._id)} {#if useAttachmentPreview} - (attachmentPopupId = res.detail)} /> + (attachmentPopupId = res.detail)} + /> {:else} { - showPopup( - ContextMenu, - { object, baseMenuClass: board.class.Card, mode: 'editor' }, - getEventPopupPositionElement(e) - ) + showMenu(e, { object, baseMenuClass: board.class.Card, mode: 'editor' }) }} /> diff --git a/plugins/board-resources/src/components/KanbanCard.svelte b/plugins/board-resources/src/components/KanbanCard.svelte index 893d98a676..2a1eb06fe2 100644 --- a/plugins/board-resources/src/components/KanbanCard.svelte +++ b/plugins/board-resources/src/components/KanbanCard.svelte @@ -22,19 +22,9 @@ import { ChatMessagesPresenter } from '@hcengineering/notification-resources' import { getClient } from '@hcengineering/presentation' import tags from '@hcengineering/tags' - import { - Button, - Component, - EditBox, - Icon, - IconMoreV, - Label, - getPopupPositionElement, - numberToHexColor, - showPopup - } from '@hcengineering/ui' + import { Button, Component, EditBox, Icon, IconMoreV, Label, numberToHexColor } from '@hcengineering/ui' import view from '@hcengineering/view' - import { ContextMenu } from '@hcengineering/view-resources' + import { showMenu } from '@hcengineering/view-resources' import board from '../plugin' import { hasDate, openCardPanel, updateCard, updateCardMembers } from '../utils/CardUtils' import DatePresenter from './presenters/DatePresenter.svelte' @@ -53,9 +43,9 @@ isEditMode = false } - function enterEditMode (): void { + function enterEditMode (e: MouseEvent): void { isEditMode = true - showPopup(ContextMenu, { object }, getPopupPositionElement(ref, { h: 'right', v: 'top' }), exitEditMode) + showMenu(e, { object }, exitEditMode) } function showCard () { diff --git a/plugins/board-resources/src/components/KanbanView.svelte b/plugins/board-resources/src/components/KanbanView.svelte index b04fc3653b..753a744450 100644 --- a/plugins/board-resources/src/components/KanbanView.svelte +++ b/plugins/board-resources/src/components/KanbanView.svelte @@ -14,7 +14,7 @@ // limitations under the License. --> {#if state} @@ -29,7 +16,13 @@
{state.name}
-
diff --git a/plugins/calendar-resources/src/components/DayCalendar.svelte b/plugins/calendar-resources/src/components/DayCalendar.svelte index c86de38de1..7a837f4249 100644 --- a/plugins/calendar-resources/src/components/DayCalendar.svelte +++ b/plugins/calendar-resources/src/components/DayCalendar.svelte @@ -37,7 +37,7 @@ ticker, isWeekend } from '@hcengineering/ui' - import { Menu } from '@hcengineering/view-resources' + import { Menu, showMenu } from '@hcengineering/view-resources' import { createEventDispatcher, onDestroy, onMount } from 'svelte' import type { CalendarADGrid, @@ -759,12 +759,6 @@ dispatch('dragEnter', { date: new Date(new Date(newTime).setMinutes(stickyMinutes, 0, 0)) }) } } - - function showMenu (ev: MouseEvent, event: Event) { - ev.preventDefault() - closeTooltip() - showPopup(Menu, { object: event }, getEventPositionElement(ev)) - } { - showMenu(e, ev) + showMenu(e, { object: ev }) }} />
{ - showMenu(e, ev) + showMenu(e, { object: ev }) }} /> {#if event} @@ -74,7 +65,7 @@ class:empty use:tooltip={{ component: EventPresenter, props: { value: event, hideDetails: !visible } }} on:click|stopPropagation={click} - on:contextmenu={showMenu} + on:contextmenu={contextMenu} > {#if !empty && presenter?.presenter} diff --git a/plugins/chunter-resources/src/components/chat-message/ChatMessagesPresenter.svelte b/plugins/chunter-resources/src/components/chat-message/ChatMessagesPresenter.svelte index 255d5a9c8c..8828deb59a 100644 --- a/plugins/chunter-resources/src/components/chat-message/ChatMessagesPresenter.svelte +++ b/plugins/chunter-resources/src/components/chat-message/ChatMessagesPresenter.svelte @@ -18,6 +18,7 @@ import { Button, ButtonKind, ButtonSize, IconThread } from '@hcengineering/ui' import ChatMessagePopup from './ChatMessagePopup.svelte' + import { restrictionStore } from '@hcengineering/view-resources' export let value: number | undefined export let object: Doc @@ -26,6 +27,8 @@ export let showCounter: boolean = true export let compactMode: boolean = false export let withInput: boolean = true + + $: disabled = $restrictionStore.disableComments {#if value && value > 0} @@ -34,7 +37,7 @@ {size} showTooltip={{ component: ChatMessagePopup, - props: { objectId: object._id, object, withInput } + props: { objectId: object._id, object, withInput: withInput && !disabled } }} >
diff --git a/plugins/contact-resources/src/components/AssigneeBox.svelte b/plugins/contact-resources/src/components/AssigneeBox.svelte index 9b1dec327e..7f8c3f75a3 100644 --- a/plugins/contact-resources/src/components/AssigneeBox.svelte +++ b/plugins/contact-resources/src/components/AssigneeBox.svelte @@ -35,11 +35,11 @@ import { openDoc } from '@hcengineering/view-resources' import { createEventDispatcher } from 'svelte' import { PersonLabelTooltip, personByIdStore } from '..' + import { AssigneeCategory } from '../assignee' import AssigneePopup from './AssigneePopup.svelte' import EmployeePresenter from './EmployeePresenter.svelte' import UserInfo from './UserInfo.svelte' import IconPerson from './icons/Person.svelte' - import { AssigneeCategory } from '../assignee' export let _class: Ref> = contact.mixin.Employee export let excluded: Ref[] | undefined = undefined @@ -156,7 +156,16 @@ onEmployeeEdit={_click} /> {:else} -
-
{/if} diff --git a/plugins/view-resources/src/components/DocAttributeBar.svelte b/plugins/view-resources/src/components/DocAttributeBar.svelte index 81359cd567..de2901b54e 100644 --- a/plugins/view-resources/src/components/DocAttributeBar.svelte +++ b/plugins/view-resources/src/components/DocAttributeBar.svelte @@ -24,6 +24,7 @@ export let ignoreKeys: string[] export let allowedCollections: string[] = [] export let showHeader: boolean = true + export let readonly: boolean = false const client = getClient() const hierarchy = client.getHierarchy() @@ -36,6 +37,7 @@ to={undefined} {allowedCollections} {showHeader} + {readonly} on:update /> {#each mixins as mixin} @@ -47,6 +49,7 @@ object={hierarchy.as(object, mixin._id)} {ignoreKeys} {to} + {readonly} {allowedCollections} {showHeader} on:update diff --git a/plugins/view-resources/src/components/DocNavLink.svelte b/plugins/view-resources/src/components/DocNavLink.svelte index 07ec6051e9..0aef777229 100644 --- a/plugins/view-resources/src/components/DocNavLink.svelte +++ b/plugins/view-resources/src/components/DocNavLink.svelte @@ -17,10 +17,10 @@ import { NavLink, getClient } from '@hcengineering/presentation' import { AnyComponent, getPanelURI, locationToUrl } from '@hcengineering/ui' import view from '../plugin' - import { getObjectLinkFragment } from '../utils' + import { getObjectLinkFragment, restrictionStore } from '../utils' export let object: Doc | undefined - export let disabled = false + export let disabled: boolean = false export let onClick: ((event: MouseEvent) => void) | undefined = undefined export let noUnderline = disabled export let inline = false @@ -31,6 +31,9 @@ export let accent: boolean = false export let noOverflow: boolean = false + let _disabled = disabled || $restrictionStore.disableNavigation + $: _disabled = disabled || $restrictionStore.disableNavigation + const client = getClient() const hierarchy = client.getHierarchy() @@ -40,7 +43,7 @@ : undefined async function getHref (object: Doc): Promise { - if (disabled) { + if (_disabled) { href = undefined return } @@ -53,6 +56,6 @@ $: if (object !== undefined) getHref(object) - + diff --git a/plugins/view-resources/src/components/EditDoc.svelte b/plugins/view-resources/src/components/EditDoc.svelte index d1abc4e539..0b3106abe2 100644 --- a/plugins/view-resources/src/components/EditDoc.svelte +++ b/plugins/view-resources/src/components/EditDoc.svelte @@ -14,32 +14,33 @@ // limitations under the License. --> @@ -92,6 +94,7 @@ kind={'ghost'} size={'small'} icon={IconCopy} + disabled={value === undefined || value === ''} showTooltip={{ label: view.string.CopyToClipboard }} on:click={() => { copyLink() @@ -102,6 +105,7 @@ kind={'ghost'} size={'small'} icon={IconArrowRight} + disabled={value === undefined || value === ''} showTooltip={{ label: view.string.Open }} on:click={() => { dispatch('update', value) diff --git a/plugins/view-resources/src/components/ParentsNavigator.svelte b/plugins/view-resources/src/components/ParentsNavigator.svelte index bc29833354..8703be806d 100644 --- a/plugins/view-resources/src/components/ParentsNavigator.svelte +++ b/plugins/view-resources/src/components/ParentsNavigator.svelte @@ -15,7 +15,7 @@ {#if viewlet} @@ -41,6 +45,7 @@