diff --git a/apps/cranio-provider/index.html b/apps/cranio-provider/index.html index dcb7745163..c63e87c591 100644 --- a/apps/cranio-provider/index.html +++ b/apps/cranio-provider/index.html @@ -1,20 +1,21 @@ - - - - - - + + + + + + ERN CRANIO - - - -
-
- - + + + +
+ + diff --git a/apps/cranio-provider/src/styles/index.scss b/apps/cranio-provider/src/styles/index.scss index 293fa3bde6..b86b95bc16 100644 --- a/apps/cranio-provider/src/styles/index.scss +++ b/apps/cranio-provider/src/styles/index.scss @@ -92,7 +92,7 @@ grid-template-columns: 1fr; align-items: flex-start; justify-content: flex-start; - + @media screen and (min-width: 924px) { grid-template-columns: 350px 1fr; } diff --git a/apps/cranio-provider/vite.config.js b/apps/cranio-provider/vite.config.js index a19edd11db..dfa2dbb96f 100644 --- a/apps/cranio-provider/vite.config.js +++ b/apps/cranio-provider/vite.config.js @@ -3,7 +3,7 @@ import vue from "@vitejs/plugin-vue"; const host = "https://cranio-demo.molgeniscloud.org"; const schema = "NL1"; -const opts = { changeOrigin: true, secure: false, logLevel: "debug" } +const opts = { changeOrigin: true, secure: false, logLevel: "debug" }; export default defineConfig(() => { return { @@ -15,9 +15,9 @@ export default defineConfig(() => { @import "../molgenis-viz/src/styles/variables.scss"; @import "../molgenis-viz/src/styles/mixins.scss"; @import "src/styles/variables.scss"; - ` - } - } + `, + }, + }, }, plugins: [vue()], base: "", @@ -25,7 +25,7 @@ export default defineConfig(() => { proxy: { "/api/graphql": { target: `${host}/${schema}`, - ...opts + ...opts, }, "^/[a-zA-Z0-9_.%-]+/api/graphql": { target: host, @@ -33,17 +33,17 @@ export default defineConfig(() => { }, "/api": { target: `${host}/api`, - ...opts + ...opts, }, "/apps": { target: host, - ...opts + ...opts, }, "/theme.css": { target: `${host}/apps/central`, - ...opts + ...opts, }, - } + }, }, - } + }; }); diff --git a/apps/cranio-public/index.html b/apps/cranio-public/index.html index c70ec3643c..eb9a033f77 100644 --- a/apps/cranio-public/index.html +++ b/apps/cranio-public/index.html @@ -1,18 +1,19 @@ - - - - - - ERN CRANIO + + + + + + ERN CRANIO
diff --git a/apps/cranio-public/vite.config.js b/apps/cranio-public/vite.config.js index cefc499b4f..6328deafc0 100644 --- a/apps/cranio-public/vite.config.js +++ b/apps/cranio-public/vite.config.js @@ -3,7 +3,7 @@ import vue from "@vitejs/plugin-vue"; const host = "https://cranio-demo.molgeniscloud.org"; const schema = "CranioStats"; -const opts = { changeOrigin: true, secure: false, logLevel: "debug" } +const opts = { changeOrigin: true, secure: false, logLevel: "debug" }; export default defineConfig(() => { return { @@ -15,9 +15,9 @@ export default defineConfig(() => { @import "../molgenis-viz/src/styles/variables.scss"; @import "../molgenis-viz/src/styles/mixins.scss"; @import "src/styles/variables.scss"; - ` - } - } + `, + }, + }, }, plugins: [vue()], base: "", @@ -25,7 +25,7 @@ export default defineConfig(() => { proxy: { "/api/graphql": { target: `${host}/${schema}`, - ...opts + ...opts, }, "^/[a-zA-Z0-9_.%-]+/api/graphql": { target: host, @@ -33,21 +33,21 @@ export default defineConfig(() => { }, "/api": { target: `${host}/api`, - ...opts + ...opts, }, "/graphql": { target: `${host}/api/graphql`, - ...opts + ...opts, }, "/apps": { target: host, - ...opts + ...opts, }, "/theme.css": { target: `${host}/apps/central`, - ...opts + ...opts, }, - } + }, }, - } + }; }); diff --git a/apps/ern-ithaca/index.html b/apps/ern-ithaca/index.html index 82e15c24bb..5982a5627a 100644 --- a/apps/ern-ithaca/index.html +++ b/apps/ern-ithaca/index.html @@ -11,8 +11,8 @@
diff --git a/apps/molgenis-components/src/Interfaces/IColumn.ts b/apps/molgenis-components/src/Interfaces/IColumn.ts index da9d039724..e85034ea38 100644 --- a/apps/molgenis-components/src/Interfaces/IColumn.ts +++ b/apps/molgenis-components/src/Interfaces/IColumn.ts @@ -11,6 +11,7 @@ export interface IColumn { labels?: ILocale[]; position?: number; readonly?: string; + defaultValue?: string; refBack?: string; refLabel?: string; refLabelDefault?: string; diff --git a/apps/molgenis-components/src/client/client.ts b/apps/molgenis-components/src/client/client.ts index 7272870652..1412e06c0e 100644 --- a/apps/molgenis-components/src/client/client.ts +++ b/apps/molgenis-components/src/client/client.ts @@ -192,6 +192,7 @@ _schema { refLabelDefault, refBack, required, + defaultValue, readonly, semantics, descriptions{ diff --git a/apps/molgenis-components/src/components/forms/EditModal.vue b/apps/molgenis-components/src/components/forms/EditModal.vue index 52a4dfd11b..430bf177a1 100644 --- a/apps/molgenis-components/src/components/forms/EditModal.vue +++ b/apps/molgenis-components/src/components/forms/EditModal.vue @@ -23,6 +23,7 @@ :clone="clone" :locale="locale" :errorPerColumn="rowErrors" + :applyDefaultValues="applyDefaultValues" @update:model-value="checkForErrors" /> @@ -183,6 +184,9 @@ export default { type: Boolean, default: () => null, }, + applyDefaultValues: { + type: Boolean, + }, }, computed: { title() { diff --git a/apps/molgenis-components/src/components/forms/RowEdit.vue b/apps/molgenis-components/src/components/forms/RowEdit.vue index e4dbbd7406..abc68f9dd6 100644 --- a/apps/molgenis-components/src/components/forms/RowEdit.vue +++ b/apps/molgenis-components/src/components/forms/RowEdit.vue @@ -109,6 +109,10 @@ export default { type: Object, default: () => ({}), }, + applyDefaultValues: { + type: Boolean, + default: () => false, + }, }, emits: ["update:modelValue"], components: { @@ -194,6 +198,16 @@ export default { } catch (error) { this.errorPerColumn[column.id] = "Computation failed: " + error; } + } else if (this.applyDefaultValues && column.defaultValue) { + if (column.defaultValue.startsWith("=")) { + this.internalValues[column.id] = executeExpression( + column.defaultValue.substr(1), + this.internalValues, + this.tableMetaData as ITableMetaData + ); + } else { + this.internalValues[column.id] = column.defaultValue; + } } }); }, diff --git a/apps/molgenis-components/src/components/tables/RowButtonAdd.vue b/apps/molgenis-components/src/components/tables/RowButtonAdd.vue index 9edce99c51..d722968180 100644 --- a/apps/molgenis-components/src/components/tables/RowButtonAdd.vue +++ b/apps/molgenis-components/src/components/tables/RowButtonAdd.vue @@ -9,6 +9,7 @@ :schemaName="schemaName" :defaultValue="defaultValue" :visibleColumns="visibleColumns" + :applyDefaultValues="true" @close="handleClose" /> diff --git a/apps/molgenis-components/src/components/tables/TableExplorer.vue b/apps/molgenis-components/src/components/tables/TableExplorer.vue index fd99eb2141..7b834bb76f 100644 --- a/apps/molgenis-components/src/components/tables/TableExplorer.vue +++ b/apps/molgenis-components/src/components/tables/TableExplorer.vue @@ -360,6 +360,7 @@ :schemaName="schemaName" @close="handleModalClose" :locale="locale" + :apply-default-values="editMode === 'add'" /> 1%", "last 2 versions" ] -} \ No newline at end of file +} diff --git a/apps/schema/src/components/ColumnEditModal.vue b/apps/schema/src/components/ColumnEditModal.vue index f0df9af7d9..897caf2e6e 100644 --- a/apps/schema/src/components/ColumnEditModal.vue +++ b/apps/schema/src/components/ColumnEditModal.vue @@ -128,6 +128,13 @@ label="isReadonly" /> +
+ +
@@ -220,6 +227,7 @@ :tableMetaData="table" :tableName="table.name" :key="JSON.stringify(table)" + :applyDefaultValues="true" :errorPerColumn="rowErrors" @update:model-value="checkForErrors" /> diff --git a/apps/schema/src/components/ColumnView.vue b/apps/schema/src/components/ColumnView.vue index ed8d8b681a..b025b45478 100644 --- a/apps/schema/src/components/ColumnView.vue +++ b/apps/schema/src/components/ColumnView.vue @@ -71,6 +71,9 @@ readonly + + defaultValue='{{ column.defaultValue }}' + refLabel='{{ column.refLabel }}' computed="{{ column.computed }}" diff --git a/apps/schema/src/components/Schema.vue b/apps/schema/src/components/Schema.vue index eec95a503f..03e6a6016d 100644 --- a/apps/schema/src/components/Schema.vue +++ b/apps/schema/src/components/Schema.vue @@ -245,6 +245,7 @@ export default { refLabel required readonly + defaultValue descriptions { locale value diff --git a/apps/tables/package.json b/apps/tables/package.json index 6c11f3b9b6..14ed922740 100644 --- a/apps/tables/package.json +++ b/apps/tables/package.json @@ -25,4 +25,4 @@ "> 1%", "last 2 versions" ] -} \ No newline at end of file +} diff --git a/apps/tasks/package.json b/apps/tasks/package.json index 1832bd5e02..eddaccef5a 100644 --- a/apps/tasks/package.json +++ b/apps/tasks/package.json @@ -24,4 +24,4 @@ "> 1%", "last 2 versions" ] -} \ No newline at end of file +} diff --git a/apps/yarn.lock b/apps/yarn.lock index 3c3fc8ee76..f382c35867 100644 --- a/apps/yarn.lock +++ b/apps/yarn.lock @@ -1559,109 +1559,109 @@ resolved "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^29.6.2": - version "29.6.2" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.6.2.tgz#bf1d4101347c23e07c029a1b1ae07d550f5cc541" - integrity sha512-0N0yZof5hi44HAR2pPS+ikJ3nzKNoZdVu8FffRf3wy47I7Dm7etk/3KetMdRUqzVd16V4O2m2ISpNTbnIuqy1w== +"@jest/console@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.7.0.tgz#cd4822dbdb84529265c5a2bdb529a3c9cc950ffc" + integrity sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg== dependencies: - "@jest/types" "^29.6.1" + "@jest/types" "^29.6.3" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^29.6.2" - jest-util "^29.6.2" + jest-message-util "^29.7.0" + jest-util "^29.7.0" slash "^3.0.0" -"@jest/core@^29.6.2": - version "29.6.2" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.6.2.tgz#6f2d1dbe8aa0265fcd4fb8082ae1952f148209c8" - integrity sha512-Oj+5B+sDMiMWLhPFF+4/DvHOf+U10rgvCLGPHP8Xlsy/7QxS51aU/eBngudHlJXnaWD5EohAgJ4js+T6pa+zOg== - dependencies: - "@jest/console" "^29.6.2" - "@jest/reporters" "^29.6.2" - "@jest/test-result" "^29.6.2" - "@jest/transform" "^29.6.2" - "@jest/types" "^29.6.1" +"@jest/core@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.7.0.tgz#b6cccc239f30ff36609658c5a5e2291757ce448f" + integrity sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg== + dependencies: + "@jest/console" "^29.7.0" + "@jest/reporters" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" ci-info "^3.2.0" exit "^0.1.2" graceful-fs "^4.2.9" - jest-changed-files "^29.5.0" - jest-config "^29.6.2" - jest-haste-map "^29.6.2" - jest-message-util "^29.6.2" - jest-regex-util "^29.4.3" - jest-resolve "^29.6.2" - jest-resolve-dependencies "^29.6.2" - jest-runner "^29.6.2" - jest-runtime "^29.6.2" - jest-snapshot "^29.6.2" - jest-util "^29.6.2" - jest-validate "^29.6.2" - jest-watcher "^29.6.2" + jest-changed-files "^29.7.0" + jest-config "^29.7.0" + jest-haste-map "^29.7.0" + jest-message-util "^29.7.0" + jest-regex-util "^29.6.3" + jest-resolve "^29.7.0" + jest-resolve-dependencies "^29.7.0" + jest-runner "^29.7.0" + jest-runtime "^29.7.0" + jest-snapshot "^29.7.0" + jest-util "^29.7.0" + jest-validate "^29.7.0" + jest-watcher "^29.7.0" micromatch "^4.0.4" - pretty-format "^29.6.2" + pretty-format "^29.7.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^29.6.2": - version "29.6.2" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.6.2.tgz#794c0f769d85e7553439d107d3f43186dc6874a9" - integrity sha512-AEcW43C7huGd/vogTddNNTDRpO6vQ2zaQNrttvWV18ArBx9Z56h7BIsXkNFJVOO4/kblWEQz30ckw0+L3izc+Q== +"@jest/environment@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.7.0.tgz#24d61f54ff1f786f3cd4073b4b94416383baf2a7" + integrity sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw== dependencies: - "@jest/fake-timers" "^29.6.2" - "@jest/types" "^29.6.1" + "@jest/fake-timers" "^29.7.0" + "@jest/types" "^29.6.3" "@types/node" "*" - jest-mock "^29.6.2" + jest-mock "^29.7.0" -"@jest/expect-utils@^29.6.2": - version "29.6.2" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.6.2.tgz#1b97f290d0185d264dd9fdec7567a14a38a90534" - integrity sha512-6zIhM8go3RV2IG4aIZaZbxwpOzz3ZiM23oxAlkquOIole+G6TrbeXnykxWYlqF7kz2HlBjdKtca20x9atkEQYg== +"@jest/expect-utils@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.7.0.tgz#023efe5d26a8a70f21677d0a1afc0f0a44e3a1c6" + integrity sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA== dependencies: - jest-get-type "^29.4.3" + jest-get-type "^29.6.3" -"@jest/expect@^29.6.2": - version "29.6.2" - resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.6.2.tgz#5a2ad58bb345165d9ce0a1845bbf873c480a4b28" - integrity sha512-m6DrEJxVKjkELTVAztTLyS/7C92Y2b0VYqmDROYKLLALHn8T/04yPs70NADUYPrV3ruI+H3J0iUIuhkjp7vkfg== +"@jest/expect@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.7.0.tgz#76a3edb0cb753b70dfbfe23283510d3d45432bf2" + integrity sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ== dependencies: - expect "^29.6.2" - jest-snapshot "^29.6.2" + expect "^29.7.0" + jest-snapshot "^29.7.0" -"@jest/fake-timers@^29.6.2": - version "29.6.2" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.6.2.tgz#fe9d43c5e4b1b901168fe6f46f861b3e652a2df4" - integrity sha512-euZDmIlWjm1Z0lJ1D0f7a0/y5Kh/koLFMUBE5SUYWrmy8oNhJpbTBDAP6CxKnadcMLDoDf4waRYCe35cH6G6PA== +"@jest/fake-timers@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.7.0.tgz#fd91bf1fffb16d7d0d24a426ab1a47a49881a565" + integrity sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ== dependencies: - "@jest/types" "^29.6.1" + "@jest/types" "^29.6.3" "@sinonjs/fake-timers" "^10.0.2" "@types/node" "*" - jest-message-util "^29.6.2" - jest-mock "^29.6.2" - jest-util "^29.6.2" + jest-message-util "^29.7.0" + jest-mock "^29.7.0" + jest-util "^29.7.0" -"@jest/globals@^29.6.2": - version "29.6.2" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.6.2.tgz#74af81b9249122cc46f1eb25793617eec69bf21a" - integrity sha512-cjuJmNDjs6aMijCmSa1g2TNG4Lby/AeU7/02VtpW+SLcZXzOLK2GpN2nLqcFjmhy3B3AoPeQVx7BnyOf681bAw== +"@jest/globals@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.7.0.tgz#8d9290f9ec47ff772607fa864ca1d5a2efae1d4d" + integrity sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ== dependencies: - "@jest/environment" "^29.6.2" - "@jest/expect" "^29.6.2" - "@jest/types" "^29.6.1" - jest-mock "^29.6.2" + "@jest/environment" "^29.7.0" + "@jest/expect" "^29.7.0" + "@jest/types" "^29.6.3" + jest-mock "^29.7.0" -"@jest/reporters@^29.6.2": - version "29.6.2" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.6.2.tgz#524afe1d76da33d31309c2c4a2c8062d0c48780a" - integrity sha512-sWtijrvIav8LgfJZlrGCdN0nP2EWbakglJY49J1Y5QihcQLfy7ovyxxjJBRXMNltgt4uPtEcFmIMbVshEDfFWw== +"@jest/reporters@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.7.0.tgz#04b262ecb3b8faa83b0b3d321623972393e8f4c7" + integrity sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^29.6.2" - "@jest/test-result" "^29.6.2" - "@jest/transform" "^29.6.2" - "@jest/types" "^29.6.1" + "@jest/console" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" "@jridgewell/trace-mapping" "^0.3.18" "@types/node" "*" chalk "^4.0.0" @@ -1670,13 +1670,13 @@ glob "^7.1.3" graceful-fs "^4.2.9" istanbul-lib-coverage "^3.0.0" - istanbul-lib-instrument "^5.1.0" + istanbul-lib-instrument "^6.0.0" istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.1.3" - jest-message-util "^29.6.2" - jest-util "^29.6.2" - jest-worker "^29.6.2" + jest-message-util "^29.7.0" + jest-util "^29.7.0" + jest-worker "^29.7.0" slash "^3.0.0" string-length "^4.0.1" strip-ansi "^6.0.0" @@ -1696,62 +1696,62 @@ dependencies: "@sinclair/typebox" "^0.27.8" -"@jest/source-map@^29.6.0": - version "29.6.0" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-29.6.0.tgz#bd34a05b5737cb1a99d43e1957020ac8e5b9ddb1" - integrity sha512-oA+I2SHHQGxDCZpbrsCQSoMLb3Bz547JnM+jUr9qEbuw0vQlWZfpPS7CO9J7XiwKicEz9OFn/IYoLkkiUD7bzA== +"@jest/source-map@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-29.6.3.tgz#d90ba772095cf37a34a5eb9413f1b562a08554c4" + integrity sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw== dependencies: "@jridgewell/trace-mapping" "^0.3.18" callsites "^3.0.0" graceful-fs "^4.2.9" -"@jest/test-result@^29.6.2": - version "29.6.2" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.6.2.tgz#fdd11583cd1608e4db3114e8f0cce277bf7a32ed" - integrity sha512-3VKFXzcV42EYhMCsJQURptSqnyjqCGbtLuX5Xxb6Pm6gUf1wIRIl+mandIRGJyWKgNKYF9cnstti6Ls5ekduqw== +"@jest/test-result@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.7.0.tgz#8db9a80aa1a097bb2262572686734baed9b1657c" + integrity sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA== dependencies: - "@jest/console" "^29.6.2" - "@jest/types" "^29.6.1" + "@jest/console" "^29.7.0" + "@jest/types" "^29.6.3" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^29.6.2": - version "29.6.2" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.6.2.tgz#585eff07a68dd75225a7eacf319780cb9f6b9bf4" - integrity sha512-GVYi6PfPwVejO7slw6IDO0qKVum5jtrJ3KoLGbgBWyr2qr4GaxFV6su+ZAjdTX75Sr1DkMFRk09r2ZVa+wtCGw== +"@jest/test-sequencer@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz#6cef977ce1d39834a3aea887a1726628a6f072ce" + integrity sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw== dependencies: - "@jest/test-result" "^29.6.2" + "@jest/test-result" "^29.7.0" graceful-fs "^4.2.9" - jest-haste-map "^29.6.2" + jest-haste-map "^29.7.0" slash "^3.0.0" -"@jest/transform@^29.6.2": - version "29.6.2" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.6.2.tgz#522901ebbb211af08835bc3bcdf765ab778094e3" - integrity sha512-ZqCqEISr58Ce3U+buNFJYUktLJZOggfyvR+bZMaiV1e8B1SIvJbwZMrYz3gx/KAPn9EXmOmN+uB08yLCjWkQQg== +"@jest/transform@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.7.0.tgz#df2dd9c346c7d7768b8a06639994640c642e284c" + integrity sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw== dependencies: "@babel/core" "^7.11.6" - "@jest/types" "^29.6.1" + "@jest/types" "^29.6.3" "@jridgewell/trace-mapping" "^0.3.18" babel-plugin-istanbul "^6.1.1" chalk "^4.0.0" convert-source-map "^2.0.0" fast-json-stable-stringify "^2.1.0" graceful-fs "^4.2.9" - jest-haste-map "^29.6.2" - jest-regex-util "^29.4.3" - jest-util "^29.6.2" + jest-haste-map "^29.7.0" + jest-regex-util "^29.6.3" + jest-util "^29.7.0" micromatch "^4.0.4" pirates "^4.0.4" slash "^3.0.0" write-file-atomic "^4.0.2" -"@jest/types@^29.6.1": - version "29.6.1" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.6.1.tgz#ae79080278acff0a6af5eb49d063385aaa897bf2" - integrity sha512-tPKQNMPuXgvdOn2/Lg9HNfUvjYVGolt04Hp03f5hAk878uwOLikN+JzeLY0HcVgKgFl9Hs3EIqpu3WX27XNhnw== +"@jest/types@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.6.3.tgz#1131f8cf634e7e84c5e77bab12f052af585fba59" + integrity sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw== dependencies: - "@jest/schemas" "^29.6.0" + "@jest/schemas" "^29.6.3" "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^3.0.0" "@types/node" "*" @@ -3923,15 +3923,15 @@ b4a@^1.6.4: resolved "https://registry.npmjs.org/b4a/-/b4a-1.6.4.tgz" integrity sha512-fpWrvyVHEKyeEvbKZTVOeZF3VSKKWtJxFIxX/jaVPf+cLbGUSitjb49pHLqPV2BUNNZ0LcoeEGfE/YCpyDYHIw== -babel-jest@29.6.2, babel-jest@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.6.2.tgz#cada0a59e07f5acaeb11cbae7e3ba92aec9c1126" - integrity sha512-BYCzImLos6J3BH/+HvUCHG1dTf2MzmAB4jaVxHV+29RZLjR29XuYTmsf2sdDwkrb+FczkGo3kOhE7ga6sI0P4A== +babel-jest@29.7.0, babel-jest@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.7.0.tgz#f4369919225b684c56085998ac63dbd05be020d5" + integrity sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg== dependencies: - "@jest/transform" "^29.6.2" + "@jest/transform" "^29.7.0" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" - babel-preset-jest "^29.5.0" + babel-preset-jest "^29.6.3" chalk "^4.0.0" graceful-fs "^4.2.9" slash "^3.0.0" @@ -3947,10 +3947,10 @@ babel-plugin-istanbul@^6.1.1: istanbul-lib-instrument "^5.0.4" test-exclude "^6.0.0" -babel-plugin-jest-hoist@^29.5.0: - version "29.5.0" - resolved "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.5.0.tgz" - integrity sha512-zSuuuAlTMT4mzLj2nPnUm6fsE6270vdOfnpbJ+RmruU75UhLFvL0N2NgI7xpeS7NaB6hGqmd5pVpGTDYvi4Q3w== +babel-plugin-jest-hoist@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz#aadbe943464182a8922c3c927c3067ff40d24626" + integrity sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg== dependencies: "@babel/template" "^7.3.3" "@babel/types" "^7.3.3" @@ -3991,12 +3991,12 @@ babel-preset-current-node-syntax@^1.0.0: "@babel/plugin-syntax-optional-chaining" "^7.8.3" "@babel/plugin-syntax-top-level-await" "^7.8.3" -babel-preset-jest@^29.5.0: - version "29.5.0" - resolved "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.5.0.tgz" - integrity sha512-JOMloxOqdiBSxMAzjRaH023/vvcaSaec49zvg+2LmNsktC7ei39LTJGw02J+9uUtTZUq6xbLyJ4dxe9sSmIuAg== +babel-preset-jest@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz#fa05fa510e7d493896d7b0dd2033601c840f171c" + integrity sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA== dependencies: - babel-plugin-jest-hoist "^29.5.0" + babel-plugin-jest-hoist "^29.6.3" babel-preset-current-node-syntax "^1.0.0" babel-runtime@^6.11.6: @@ -5075,6 +5075,19 @@ create-error-class@^3.0.0: dependencies: capture-stack-trace "^1.0.0" +create-jest@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/create-jest/-/create-jest-29.7.0.tgz#a355c5b3cb1e1af02ba177fe7afd7feee49a5320" + integrity sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q== + dependencies: + "@jest/types" "^29.6.3" + chalk "^4.0.0" + exit "^0.1.2" + graceful-fs "^4.2.9" + jest-config "^29.7.0" + jest-util "^29.7.0" + prompts "^2.0.1" + create-react-class@^15.5.1: version "15.7.0" resolved "https://registry.npmjs.org/create-react-class/-/create-react-class-15.7.0.tgz" @@ -6672,17 +6685,16 @@ expand-template@^2.0.3: resolved "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz" integrity sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg== -expect@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/expect/-/expect-29.6.2.tgz#7b08e83eba18ddc4a2cf62b5f2d1918f5cd84521" - integrity sha512-iAErsLxJ8C+S02QbLAwgSGSezLQK+XXRDt8IuFXFpwCNw2ECmzZSmjKcCaFVp5VRMk+WAvz6h6jokzEzBFZEuA== +expect@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.7.0.tgz#578874590dcb3214514084c08115d8aee61e11bc" + integrity sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw== dependencies: - "@jest/expect-utils" "^29.6.2" - "@types/node" "*" - jest-get-type "^29.4.3" - jest-matcher-utils "^29.6.2" - jest-message-util "^29.6.2" - jest-util "^29.6.2" + "@jest/expect-utils" "^29.7.0" + jest-get-type "^29.6.3" + jest-matcher-utils "^29.7.0" + jest-message-util "^29.7.0" + jest-util "^29.7.0" exponential-backoff@^3.1.1: version "3.1.1" @@ -8714,7 +8726,7 @@ istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: resolved "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz" integrity sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw== -istanbul-lib-instrument@^5.0.4, istanbul-lib-instrument@^5.1.0: +istanbul-lib-instrument@^5.0.4: version "5.2.1" resolved "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz" integrity sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg== @@ -8725,6 +8737,17 @@ istanbul-lib-instrument@^5.0.4, istanbul-lib-instrument@^5.1.0: istanbul-lib-coverage "^3.2.0" semver "^6.3.0" +istanbul-lib-instrument@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.1.tgz#71e87707e8041428732518c6fb5211761753fbdf" + integrity sha512-EAMEJBsYuyyztxMxW3g7ugGPkrZsV57v0Hmv3mm1uQsmB+QnZuepg731CRaIgeUVSdmsTngOkSnauNF8p7FIhA== + dependencies: + "@babel/core" "^7.12.3" + "@babel/parser" "^7.14.7" + "@istanbuljs/schema" "^0.1.2" + istanbul-lib-coverage "^3.2.0" + semver "^7.5.4" + istanbul-lib-report@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz" @@ -8783,87 +8806,87 @@ jake@^10.8.5: filelist "^1.0.4" minimatch "^3.1.2" -jest-changed-files@^29.5.0: - version "29.5.0" - resolved "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.5.0.tgz" - integrity sha512-IFG34IUMUaNBIxjQXF/iu7g6EcdMrGRRxaUSw92I/2g2YC6vCdTltl4nHvt7Ci5nSJwXIkCu8Ka1DKF+X7Z1Ag== +jest-changed-files@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.7.0.tgz#1c06d07e77c78e1585d020424dedc10d6e17ac3a" + integrity sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w== dependencies: execa "^5.0.0" + jest-util "^29.7.0" p-limit "^3.1.0" -jest-circus@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.6.2.tgz#1e6ffca60151ac66cad63fce34f443f6b5bb4258" - integrity sha512-G9mN+KOYIUe2sB9kpJkO9Bk18J4dTDArNFPwoZ7WKHKel55eKIS/u2bLthxgojwlf9NLCVQfgzM/WsOVvoC6Fw== +jest-circus@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.7.0.tgz#b6817a45fcc835d8b16d5962d0c026473ee3668a" + integrity sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw== dependencies: - "@jest/environment" "^29.6.2" - "@jest/expect" "^29.6.2" - "@jest/test-result" "^29.6.2" - "@jest/types" "^29.6.1" + "@jest/environment" "^29.7.0" + "@jest/expect" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/types" "^29.6.3" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^1.0.0" is-generator-fn "^2.0.0" - jest-each "^29.6.2" - jest-matcher-utils "^29.6.2" - jest-message-util "^29.6.2" - jest-runtime "^29.6.2" - jest-snapshot "^29.6.2" - jest-util "^29.6.2" + jest-each "^29.7.0" + jest-matcher-utils "^29.7.0" + jest-message-util "^29.7.0" + jest-runtime "^29.7.0" + jest-snapshot "^29.7.0" + jest-util "^29.7.0" p-limit "^3.1.0" - pretty-format "^29.6.2" + pretty-format "^29.7.0" pure-rand "^6.0.0" slash "^3.0.0" stack-utils "^2.0.3" -jest-cli@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.6.2.tgz#edb381763398d1a292cd1b636a98bfa5644b8fda" - integrity sha512-TT6O247v6dCEX2UGHGyflMpxhnrL0DNqP2fRTKYm3nJJpCTfXX3GCMQPGFjXDoj0i5/Blp3jriKXFgdfmbYB6Q== +jest-cli@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.7.0.tgz#5592c940798e0cae677eec169264f2d839a37995" + integrity sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg== dependencies: - "@jest/core" "^29.6.2" - "@jest/test-result" "^29.6.2" - "@jest/types" "^29.6.1" + "@jest/core" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/types" "^29.6.3" chalk "^4.0.0" + create-jest "^29.7.0" exit "^0.1.2" - graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^29.6.2" - jest-util "^29.6.2" - jest-validate "^29.6.2" - prompts "^2.0.1" + jest-config "^29.7.0" + jest-util "^29.7.0" + jest-validate "^29.7.0" yargs "^17.3.1" -jest-config@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.6.2.tgz#c68723f06b31ca5e63030686e604727d406cd7c3" - integrity sha512-VxwFOC8gkiJbuodG9CPtMRjBUNZEHxwfQXmIudSTzFWxaci3Qub1ddTRbFNQlD/zUeaifLndh/eDccFX4wCMQw== +jest-config@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.7.0.tgz#bcbda8806dbcc01b1e316a46bb74085a84b0245f" + integrity sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ== dependencies: "@babel/core" "^7.11.6" - "@jest/test-sequencer" "^29.6.2" - "@jest/types" "^29.6.1" - babel-jest "^29.6.2" + "@jest/test-sequencer" "^29.7.0" + "@jest/types" "^29.6.3" + babel-jest "^29.7.0" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.3" graceful-fs "^4.2.9" - jest-circus "^29.6.2" - jest-environment-node "^29.6.2" - jest-get-type "^29.4.3" - jest-regex-util "^29.4.3" - jest-resolve "^29.6.2" - jest-runner "^29.6.2" - jest-util "^29.6.2" - jest-validate "^29.6.2" + jest-circus "^29.7.0" + jest-environment-node "^29.7.0" + jest-get-type "^29.6.3" + jest-regex-util "^29.6.3" + jest-resolve "^29.7.0" + jest-runner "^29.7.0" + jest-util "^29.7.0" + jest-validate "^29.7.0" micromatch "^4.0.4" parse-json "^5.2.0" - pretty-format "^29.6.2" + pretty-format "^29.7.0" slash "^3.0.0" strip-json-comments "^3.1.1" -jest-diff@^29.4.1: +jest-diff@^29.4.1, jest-diff@^29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.7.0.tgz#017934a66ebb7ecf6f205e84699be10afd70458a" integrity sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw== @@ -8873,302 +8896,287 @@ jest-diff@^29.4.1: jest-get-type "^29.6.3" pretty-format "^29.7.0" -jest-diff@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.6.2.tgz#c36001e5543e82a0805051d3ceac32e6825c1c46" - integrity sha512-t+ST7CB9GX5F2xKwhwCf0TAR17uNDiaPTZnVymP9lw0lssa9vG+AFyDZoeIHStU3WowFFwT+ky+er0WVl2yGhA== - dependencies: - chalk "^4.0.0" - diff-sequences "^29.4.3" - jest-get-type "^29.4.3" - pretty-format "^29.6.2" - -jest-docblock@^29.4.3: - version "29.4.3" - resolved "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.4.3.tgz" - integrity sha512-fzdTftThczeSD9nZ3fzA/4KkHtnmllawWrXO69vtI+L9WjEIuXWs4AmyME7lN5hU7dB0sHhuPfcKofRsUb/2Fg== +jest-docblock@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-29.7.0.tgz#8fddb6adc3cdc955c93e2a87f61cfd350d5d119a" + integrity sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g== dependencies: detect-newline "^3.0.0" -jest-each@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.6.2.tgz#c9e4b340bcbe838c73adf46b76817b15712d02ce" - integrity sha512-MsrsqA0Ia99cIpABBc3izS1ZYoYfhIy0NNWqPSE0YXbQjwchyt6B1HD2khzyPe1WiJA7hbxXy77ZoUQxn8UlSw== +jest-each@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.7.0.tgz#162a9b3f2328bdd991beaabffbb74745e56577d1" + integrity sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ== dependencies: - "@jest/types" "^29.6.1" + "@jest/types" "^29.6.3" chalk "^4.0.0" - jest-get-type "^29.4.3" - jest-util "^29.6.2" - pretty-format "^29.6.2" + jest-get-type "^29.6.3" + jest-util "^29.7.0" + pretty-format "^29.7.0" -jest-environment-jsdom@29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-29.6.2.tgz#4fc68836a7774a771819a2f980cb47af3b1629da" - integrity sha512-7oa/+266AAEgkzae8i1awNEfTfjwawWKLpiw2XesZmaoVVj9u9t8JOYx18cG29rbPNtkUlZ8V4b5Jb36y/VxoQ== +jest-environment-jsdom@29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-29.7.0.tgz#d206fa3551933c3fd519e5dfdb58a0f5139a837f" + integrity sha512-k9iQbsf9OyOfdzWH8HDmrRT0gSIcX+FLNW7IQq94tFX0gynPwqDTW0Ho6iMVNjGz/nb+l/vW3dWM2bbLLpkbXA== dependencies: - "@jest/environment" "^29.6.2" - "@jest/fake-timers" "^29.6.2" - "@jest/types" "^29.6.1" + "@jest/environment" "^29.7.0" + "@jest/fake-timers" "^29.7.0" + "@jest/types" "^29.6.3" "@types/jsdom" "^20.0.0" "@types/node" "*" - jest-mock "^29.6.2" - jest-util "^29.6.2" + jest-mock "^29.7.0" + jest-util "^29.7.0" jsdom "^20.0.0" -jest-environment-node@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.6.2.tgz#a9ea2cabff39b08eca14ccb32c8ceb924c8bb1ad" - integrity sha512-YGdFeZ3T9a+/612c5mTQIllvWkddPbYcN2v95ZH24oWMbGA4GGS2XdIF92QMhUhvrjjuQWYgUGW2zawOyH63MQ== +jest-environment-node@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.7.0.tgz#0b93e111dda8ec120bc8300e6d1fb9576e164376" + integrity sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw== dependencies: - "@jest/environment" "^29.6.2" - "@jest/fake-timers" "^29.6.2" - "@jest/types" "^29.6.1" + "@jest/environment" "^29.7.0" + "@jest/fake-timers" "^29.7.0" + "@jest/types" "^29.6.3" "@types/node" "*" - jest-mock "^29.6.2" - jest-util "^29.6.2" - -jest-get-type@^29.4.3: - version "29.4.3" - resolved "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.4.3.tgz" - integrity sha512-J5Xez4nRRMjk8emnTpWrlkyb9pfRQQanDrvWHhsR1+VUfbwxi30eVcZFlcdGInRibU4G5LwHXpI7IRHU0CY+gg== + jest-mock "^29.7.0" + jest-util "^29.7.0" jest-get-type@^29.6.3: version "29.6.3" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.6.3.tgz#36f499fdcea197c1045a127319c0481723908fd1" integrity sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw== -jest-haste-map@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.6.2.tgz#298c25ea5255cfad8b723179d4295cf3a50a70d1" - integrity sha512-+51XleTDAAysvU8rT6AnS1ZJ+WHVNqhj1k6nTvN2PYP+HjU3kqlaKQ1Lnw3NYW3bm2r8vq82X0Z1nDDHZMzHVA== +jest-haste-map@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.7.0.tgz#3c2396524482f5a0506376e6c858c3bbcc17b104" + integrity sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA== dependencies: - "@jest/types" "^29.6.1" + "@jest/types" "^29.6.3" "@types/graceful-fs" "^4.1.3" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.9" - jest-regex-util "^29.4.3" - jest-util "^29.6.2" - jest-worker "^29.6.2" + jest-regex-util "^29.6.3" + jest-util "^29.7.0" + jest-worker "^29.7.0" micromatch "^4.0.4" walker "^1.0.8" optionalDependencies: fsevents "^2.3.2" -jest-leak-detector@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.6.2.tgz#e2b307fee78cab091c37858a98c7e1d73cdf5b38" - integrity sha512-aNqYhfp5uYEO3tdWMb2bfWv6f0b4I0LOxVRpnRLAeque2uqOVVMLh6khnTcE2qJ5wAKop0HcreM1btoysD6bPQ== +jest-leak-detector@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz#5b7ec0dadfdfec0ca383dc9aa016d36b5ea4c728" + integrity sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw== dependencies: - jest-get-type "^29.4.3" - pretty-format "^29.6.2" + jest-get-type "^29.6.3" + pretty-format "^29.7.0" -jest-matcher-utils@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.6.2.tgz#39de0be2baca7a64eacb27291f0bd834fea3a535" - integrity sha512-4LiAk3hSSobtomeIAzFTe+N8kL6z0JtF3n6I4fg29iIW7tt99R7ZcIFW34QkX+DuVrf+CUe6wuVOpm7ZKFJzZQ== +jest-matcher-utils@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz#ae8fec79ff249fd592ce80e3ee474e83a6c44f12" + integrity sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g== dependencies: chalk "^4.0.0" - jest-diff "^29.6.2" - jest-get-type "^29.4.3" - pretty-format "^29.6.2" + jest-diff "^29.7.0" + jest-get-type "^29.6.3" + pretty-format "^29.7.0" -jest-message-util@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.6.2.tgz#af7adc2209c552f3f5ae31e77cf0a261f23dc2bb" - integrity sha512-vnIGYEjoPSuRqV8W9t+Wow95SDp6KPX2Uf7EoeG9G99J2OVh7OSwpS4B6J0NfpEIpfkBNHlBZpA2rblEuEFhZQ== +jest-message-util@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.7.0.tgz#8bc392e204e95dfe7564abbe72a404e28e51f7f3" + integrity sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^29.6.1" + "@jest/types" "^29.6.3" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^29.6.2" + pretty-format "^29.7.0" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.6.2.tgz#ef9c9b4d38c34a2ad61010a021866dad41ce5e00" - integrity sha512-hoSv3lb3byzdKfwqCuT6uTscan471GUECqgNYykg6ob0yiAw3zYc7OrPnI9Qv8Wwoa4lC7AZ9hyS4AiIx5U2zg== +jest-mock@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.7.0.tgz#4e836cf60e99c6fcfabe9f99d017f3fdd50a6347" + integrity sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw== dependencies: - "@jest/types" "^29.6.1" + "@jest/types" "^29.6.3" "@types/node" "*" - jest-util "^29.6.2" + jest-util "^29.7.0" jest-pnp-resolver@^1.2.2: version "1.2.3" resolved "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz" integrity sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w== -jest-regex-util@^29.4.3: - version "29.4.3" - resolved "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.4.3.tgz" - integrity sha512-O4FglZaMmWXbGHSQInfXewIsd1LMn9p3ZXB/6r4FOkyhX2/iP/soMG98jGvk/A3HAN78+5VWcBGO0BJAPRh4kg== +jest-regex-util@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.6.3.tgz#4a556d9c776af68e1c5f48194f4d0327d24e8a52" + integrity sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg== -jest-resolve-dependencies@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.6.2.tgz#36435269b6672c256bcc85fb384872c134cc4cf2" - integrity sha512-LGqjDWxg2fuQQm7ypDxduLu/m4+4Lb4gczc13v51VMZbVP5tSBILqVx8qfWcsdP8f0G7aIqByIALDB0R93yL+w== +jest-resolve-dependencies@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz#1b04f2c095f37fc776ff40803dc92921b1e88428" + integrity sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA== dependencies: - jest-regex-util "^29.4.3" - jest-snapshot "^29.6.2" + jest-regex-util "^29.6.3" + jest-snapshot "^29.7.0" -jest-resolve@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.6.2.tgz#f18405fe4b50159b7b6d85e81f6a524d22afb838" - integrity sha512-G/iQUvZWI5e3SMFssc4ug4dH0aZiZpsDq9o1PtXTV1210Ztyb2+w+ZgQkB3iOiC5SmAEzJBOHWz6Hvrd+QnNPw== +jest-resolve@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.7.0.tgz#64d6a8992dd26f635ab0c01e5eef4399c6bcbc30" + integrity sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA== dependencies: chalk "^4.0.0" graceful-fs "^4.2.9" - jest-haste-map "^29.6.2" + jest-haste-map "^29.7.0" jest-pnp-resolver "^1.2.2" - jest-util "^29.6.2" - jest-validate "^29.6.2" + jest-util "^29.7.0" + jest-validate "^29.7.0" resolve "^1.20.0" resolve.exports "^2.0.0" slash "^3.0.0" -jest-runner@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.6.2.tgz#89e8e32a8fef24781a7c4c49cd1cb6358ac7fc01" - integrity sha512-wXOT/a0EspYgfMiYHxwGLPCZfC0c38MivAlb2lMEAlwHINKemrttu1uSbcGbfDV31sFaPWnWJPmb2qXM8pqZ4w== - dependencies: - "@jest/console" "^29.6.2" - "@jest/environment" "^29.6.2" - "@jest/test-result" "^29.6.2" - "@jest/transform" "^29.6.2" - "@jest/types" "^29.6.1" +jest-runner@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.7.0.tgz#809af072d408a53dcfd2e849a4c976d3132f718e" + integrity sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ== + dependencies: + "@jest/console" "^29.7.0" + "@jest/environment" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" "@types/node" "*" chalk "^4.0.0" emittery "^0.13.1" graceful-fs "^4.2.9" - jest-docblock "^29.4.3" - jest-environment-node "^29.6.2" - jest-haste-map "^29.6.2" - jest-leak-detector "^29.6.2" - jest-message-util "^29.6.2" - jest-resolve "^29.6.2" - jest-runtime "^29.6.2" - jest-util "^29.6.2" - jest-watcher "^29.6.2" - jest-worker "^29.6.2" + jest-docblock "^29.7.0" + jest-environment-node "^29.7.0" + jest-haste-map "^29.7.0" + jest-leak-detector "^29.7.0" + jest-message-util "^29.7.0" + jest-resolve "^29.7.0" + jest-runtime "^29.7.0" + jest-util "^29.7.0" + jest-watcher "^29.7.0" + jest-worker "^29.7.0" p-limit "^3.1.0" source-map-support "0.5.13" -jest-runtime@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.6.2.tgz#692f25e387f982e89ab83270e684a9786248e545" - integrity sha512-2X9dqK768KufGJyIeLmIzToDmsN0m7Iek8QNxRSI/2+iPFYHF0jTwlO3ftn7gdKd98G/VQw9XJCk77rbTGZnJg== - dependencies: - "@jest/environment" "^29.6.2" - "@jest/fake-timers" "^29.6.2" - "@jest/globals" "^29.6.2" - "@jest/source-map" "^29.6.0" - "@jest/test-result" "^29.6.2" - "@jest/transform" "^29.6.2" - "@jest/types" "^29.6.1" +jest-runtime@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.7.0.tgz#efecb3141cf7d3767a3a0cc8f7c9990587d3d817" + integrity sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ== + dependencies: + "@jest/environment" "^29.7.0" + "@jest/fake-timers" "^29.7.0" + "@jest/globals" "^29.7.0" + "@jest/source-map" "^29.6.3" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" "@types/node" "*" chalk "^4.0.0" cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" glob "^7.1.3" graceful-fs "^4.2.9" - jest-haste-map "^29.6.2" - jest-message-util "^29.6.2" - jest-mock "^29.6.2" - jest-regex-util "^29.4.3" - jest-resolve "^29.6.2" - jest-snapshot "^29.6.2" - jest-util "^29.6.2" + jest-haste-map "^29.7.0" + jest-message-util "^29.7.0" + jest-mock "^29.7.0" + jest-regex-util "^29.6.3" + jest-resolve "^29.7.0" + jest-snapshot "^29.7.0" + jest-util "^29.7.0" slash "^3.0.0" strip-bom "^4.0.0" -jest-snapshot@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.6.2.tgz#9b431b561a83f2bdfe041e1cab8a6becdb01af9c" - integrity sha512-1OdjqvqmRdGNvWXr/YZHuyhh5DeaLp1p/F8Tht/MrMw4Kr1Uu/j4lRG+iKl1DAqUJDWxtQBMk41Lnf/JETYBRA== +jest-snapshot@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.7.0.tgz#c2c574c3f51865da1bb329036778a69bf88a6be5" + integrity sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw== dependencies: "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" "@babel/plugin-syntax-jsx" "^7.7.2" "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/types" "^7.3.3" - "@jest/expect-utils" "^29.6.2" - "@jest/transform" "^29.6.2" - "@jest/types" "^29.6.1" + "@jest/expect-utils" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^29.6.2" + expect "^29.7.0" graceful-fs "^4.2.9" - jest-diff "^29.6.2" - jest-get-type "^29.4.3" - jest-matcher-utils "^29.6.2" - jest-message-util "^29.6.2" - jest-util "^29.6.2" + jest-diff "^29.7.0" + jest-get-type "^29.6.3" + jest-matcher-utils "^29.7.0" + jest-message-util "^29.7.0" + jest-util "^29.7.0" natural-compare "^1.4.0" - pretty-format "^29.6.2" + pretty-format "^29.7.0" semver "^7.5.3" -jest-util@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.6.2.tgz#8a052df8fff2eebe446769fd88814521a517664d" - integrity sha512-3eX1qb6L88lJNCFlEADKOkjpXJQyZRiavX1INZ4tRnrBVr2COd3RgcTLyUiEXMNBlDU/cgYq6taUS0fExrWW4w== +jest-util@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.7.0.tgz#23c2b62bfb22be82b44de98055802ff3710fc0bc" + integrity sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA== dependencies: - "@jest/types" "^29.6.1" + "@jest/types" "^29.6.3" "@types/node" "*" chalk "^4.0.0" ci-info "^3.2.0" graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.6.2.tgz#25d972af35b2415b83b1373baf1a47bb266c1082" - integrity sha512-vGz0yMN5fUFRRbpJDPwxMpgSXW1LDKROHfBopAvDcmD6s+B/s8WJrwi+4bfH4SdInBA5C3P3BI19dBtKzx1Arg== +jest-validate@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.7.0.tgz#7bf705511c64da591d46b15fce41400d52147d9c" + integrity sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw== dependencies: - "@jest/types" "^29.6.1" + "@jest/types" "^29.6.3" camelcase "^6.2.0" chalk "^4.0.0" - jest-get-type "^29.4.3" + jest-get-type "^29.6.3" leven "^3.1.0" - pretty-format "^29.6.2" + pretty-format "^29.7.0" -jest-watcher@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.6.2.tgz#77c224674f0620d9f6643c4cfca186d8893ca088" - integrity sha512-GZitlqkMkhkefjfN/p3SJjrDaxPflqxEAv3/ik10OirZqJGYH5rPiIsgVcfof0Tdqg3shQGdEIxDBx+B4tuLzA== +jest-watcher@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.7.0.tgz#7810d30d619c3a62093223ce6bb359ca1b28a2f2" + integrity sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g== dependencies: - "@jest/test-result" "^29.6.2" - "@jest/types" "^29.6.1" + "@jest/test-result" "^29.7.0" + "@jest/types" "^29.6.3" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.13.1" - jest-util "^29.6.2" + jest-util "^29.7.0" string-length "^4.0.1" -jest-worker@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.6.2.tgz#682fbc4b6856ad0aa122a5403c6d048b83f3fb44" - integrity sha512-l3ccBOabTdkng8I/ORCkADz4eSMKejTYv1vB/Z83UiubqhC1oQ5Li6dWCyqOIvSifGjUBxuvxvlm6KGK2DtuAQ== +jest-worker@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.7.0.tgz#acad073acbbaeb7262bd5389e1bcf43e10058d4a" + integrity sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw== dependencies: "@types/node" "*" - jest-util "^29.6.2" + jest-util "^29.7.0" merge-stream "^2.0.0" supports-color "^8.0.0" -jest@29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest/-/jest-29.6.2.tgz#3bd55b9fd46a161b2edbdf5f1d1bd0d1eab76c42" - integrity sha512-8eQg2mqFbaP7CwfsTpCxQ+sHzw1WuNWL5UUvjnWP4hx2riGz9fPSzYOaU5q8/GqWn1TfgZIVTqYJygbGbWAANg== +jest@29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-29.7.0.tgz#994676fc24177f088f1c5e3737f5697204ff2613" + integrity sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw== dependencies: - "@jest/core" "^29.6.2" - "@jest/types" "^29.6.1" + "@jest/core" "^29.7.0" + "@jest/types" "^29.6.3" import-local "^3.0.2" - jest-cli "^29.6.2" + jest-cli "^29.7.0" jiti@1.17.1: version "1.17.1" @@ -11902,7 +11910,7 @@ pretty-bytes@^6.1.1: resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-6.1.1.tgz#38cd6bb46f47afbf667c202cfc754bffd2016a3b" integrity sha512-mQUvGU6aUFQ+rNvTIAcZuWGRT9a6f6Yrg9bHs4ImKF+HZCEK+plBvnAZYSIQztknZF2qnzNtr6F8s0+IuptdlQ== -pretty-format@^29.5.0, pretty-format@^29.6.2: +pretty-format@^29.5.0: version "29.6.2" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.6.2.tgz#3d5829261a8a4d89d8b9769064b29c50ed486a47" integrity sha512-1q0oC8eRveTg5nnBEWMXAU2qpv65Gnuf2eCQzSjxpWFkPaPARwqZZDGuNE0zPAZfTCHzIk3A8dIjwlQKKLphyg== diff --git a/backend/molgenis-emx2-beacon-v2/src/main/java/org/molgenis/emx2/beaconv2/endpoints/FilteringTerms.java b/backend/molgenis-emx2-beacon-v2/src/main/java/org/molgenis/emx2/beaconv2/endpoints/FilteringTerms.java index c362a448a4..5c618f25cf 100644 --- a/backend/molgenis-emx2-beacon-v2/src/main/java/org/molgenis/emx2/beaconv2/endpoints/FilteringTerms.java +++ b/backend/molgenis-emx2-beacon-v2/src/main/java/org/molgenis/emx2/beaconv2/endpoints/FilteringTerms.java @@ -16,10 +16,13 @@ public class FilteringTerms { private Handover beaconHandovers; public FilteringTerms(Database database) { - this.meta = new DatasetsMeta("../beaconFilteringTermsResponse.json", "filteringterms"); - this.response = new FilteringTermsResponse(database); - this.responseSummary = new ResponseSummary(); - this.beaconHandovers = new Handover(); + database.tx( + db -> { + this.meta = new DatasetsMeta("../beaconFilteringTermsResponse.json", "filteringterms"); + this.response = new FilteringTermsResponse(database); + this.responseSummary = new ResponseSummary(); + this.beaconHandovers = new Handover(); + }); } public DatasetsMeta getMeta() { diff --git a/backend/molgenis-emx2-datamodels/src/main/java/org/molgenis/emx2/datamodels/AbstractDataLoader.java b/backend/molgenis-emx2-datamodels/src/main/java/org/molgenis/emx2/datamodels/AbstractDataLoader.java index 13572588a5..d97a5eb8bd 100644 --- a/backend/molgenis-emx2-datamodels/src/main/java/org/molgenis/emx2/datamodels/AbstractDataLoader.java +++ b/backend/molgenis-emx2-datamodels/src/main/java/org/molgenis/emx2/datamodels/AbstractDataLoader.java @@ -21,7 +21,7 @@ public void load(Schema schema, boolean includeExampleData) { try { this.loadInternalImplementation(db.getSchema(schema.getName()), includeExampleData); } catch (Exception e) { - throw new MolgenisException(e.getMessage()); + throw new MolgenisException(e.getMessage(), e); } }); } diff --git a/backend/molgenis-emx2-graphql/src/main/java/org/molgenis/emx2/graphql/GraphqlApiFactory.java b/backend/molgenis-emx2-graphql/src/main/java/org/molgenis/emx2/graphql/GraphqlApiFactory.java index f5a02c7756..d7c379fe52 100644 --- a/backend/molgenis-emx2-graphql/src/main/java/org/molgenis/emx2/graphql/GraphqlApiFactory.java +++ b/backend/molgenis-emx2-graphql/src/main/java/org/molgenis/emx2/graphql/GraphqlApiFactory.java @@ -20,88 +20,6 @@ public class GraphqlApiFactory { private static Logger logger = LoggerFactory.getLogger(GraphqlApiFactory.class); - static Iterable convertToRows(TableMetadata metadata, List> map) { - List rows = new ArrayList<>(); - for (Map object : map) { - Row row = new Row(); - for (Column column : metadata.getColumns()) { - if (object.containsKey(column.getIdentifier())) { - if (column.isRef()) { - convertRefToRow((Map) object.get(column.getIdentifier()), row, column); - } else if (column.isReference()) { - // REFBACK, REF_ARRAY - convertRefArrayToRow( - (List>) object.get(column.getIdentifier()), row, column); - } else if (column.isFile()) { - BinaryFileWrapper bfw = (BinaryFileWrapper) object.get(column.getIdentifier()); - if (bfw == null || !bfw.isSkip()) { - // also necessary in case of 'null' to ensure all file metadata fields are made empty - // skip is used when use submitted only metadata (that they received in query) - row.setBinary( - column.getName(), (BinaryFileWrapper) object.get(column.getIdentifier())); - } - } else { - row.set(column.getName(), object.get(column.getIdentifier())); - } - } - } - rows.add(row); - } - return rows; - } - - private static void convertRefArrayToRow(List> list, Row row, Column column) { - - List refs = column.getReferences(); - for (Reference ref : refs) { - if (!ref.isOverlapping()) { - if (!list.isEmpty()) { - row.set(ref.getName(), getRefValueFromList(ref.getPath(), list)); - } else { - row.set(ref.getName(), new ArrayList<>()); - } - } - } - } - - private static List getRefValueFromList( - List path, List> list) { - List result = new ArrayList<>(); - for (Map map : list) { - Object value = getRefValueFromMap(path, map); - if (value != null) { - result.add(value); - } - } - return result; - } - - private static Object getRefValueFromMap(List path, Map map) { - if (path.size() == 1) { - return map.get(path.get(0)); - } else { - // should be > 1 and value should be of type map - Object value = map.get(path.get(0)); - if (value != null) { - return getRefValueFromMap(path.subList(1, path.size()), (Map) value); - } - return null; - } - } - - private static void convertRefToRow(Map map, Row row, Column column) { - for (Reference ref : column.getReferences()) { - if (!ref.isOverlapping()) { - String name = ref.getName(); - if (map == null) { - row.set(name, null); - } else { - row.set(ref.getName(), getRefValueFromMap(ref.getPath(), map)); - } - } - } - } - public static String convertExecutionResultToJson(ExecutionResult executionResult) throws JsonProcessingException { // tests show conversions below is under 3ms diff --git a/backend/molgenis-emx2-graphql/src/main/java/org/molgenis/emx2/graphql/GraphqlConstants.java b/backend/molgenis-emx2-graphql/src/main/java/org/molgenis/emx2/graphql/GraphqlConstants.java index c19551a942..2638093bcc 100644 --- a/backend/molgenis-emx2-graphql/src/main/java/org/molgenis/emx2/graphql/GraphqlConstants.java +++ b/backend/molgenis-emx2-graphql/src/main/java/org/molgenis/emx2/graphql/GraphqlConstants.java @@ -7,6 +7,7 @@ public class GraphqlConstants { public static final String ANONYMOUS = "anonymous"; public static final String COLUMNS = "columns"; public static final String REQUIRED = "required"; + public static final String DEFAULT_VALUE = "defaultValue"; public static final String COLUMN_POSITION = "position"; public static final String COLUMN_TYPE = "columnType"; public static final String TABLE_TYPE = "tableType"; diff --git a/backend/molgenis-emx2-graphql/src/main/java/org/molgenis/emx2/graphql/GraphqlSchemaFieldFactory.java b/backend/molgenis-emx2-graphql/src/main/java/org/molgenis/emx2/graphql/GraphqlSchemaFieldFactory.java index ea5676d220..13fa0eb483 100644 --- a/backend/molgenis-emx2-graphql/src/main/java/org/molgenis/emx2/graphql/GraphqlSchemaFieldFactory.java +++ b/backend/molgenis-emx2-graphql/src/main/java/org/molgenis/emx2/graphql/GraphqlSchemaFieldFactory.java @@ -164,6 +164,10 @@ public class GraphqlSchemaFieldFactory { GraphQLFieldDefinition.newFieldDefinition() .name(REQUIRED) .type(Scalars.GraphQLBoolean)) + .field( + GraphQLFieldDefinition.newFieldDefinition() + .name(DEFAULT_VALUE) + .type(Scalars.GraphQLString)) .field( GraphQLFieldDefinition.newFieldDefinition() .name(REF_SCHEMA_NAME) @@ -320,6 +324,10 @@ public class GraphqlSchemaFieldFactory { GraphQLInputObjectField.newInputObjectField() .name(REQUIRED) .type(Scalars.GraphQLBoolean)) + .field( + GraphQLInputObjectField.newInputObjectField() + .name(DEFAULT_VALUE) + .type(Scalars.GraphQLString)) .field( GraphQLInputObjectField.newInputObjectField() .name(REF_SCHEMA_NAME) diff --git a/backend/molgenis-emx2-graphql/src/main/java/org/molgenis/emx2/graphql/GraphqlTableFieldFactory.java b/backend/molgenis-emx2-graphql/src/main/java/org/molgenis/emx2/graphql/GraphqlTableFieldFactory.java index d33bb6c9c3..55c10ce21c 100644 --- a/backend/molgenis-emx2-graphql/src/main/java/org/molgenis/emx2/graphql/GraphqlTableFieldFactory.java +++ b/backend/molgenis-emx2-graphql/src/main/java/org/molgenis/emx2/graphql/GraphqlTableFieldFactory.java @@ -14,6 +14,7 @@ import java.util.*; import java.util.stream.Collectors; import org.molgenis.emx2.*; +import org.molgenis.emx2.utils.TypeUtils; public class GraphqlTableFieldFactory { // static types @@ -749,27 +750,19 @@ private DataFetcher fetcher(Schema schema, MutationType mutationType) { int count = 0; switch (mutationType) { case UPDATE: - count = - table.update( - GraphqlApiFactory.convertToRows(table.getMetadata(), rowsAslistOfMaps)); + count = table.update(TypeUtils.convertToRows(table.getMetadata(), rowsAslistOfMaps)); result.append("updated " + count + " records to " + tableName + "\n"); break; case INSERT: - count = - table.insert( - GraphqlApiFactory.convertToRows(table.getMetadata(), rowsAslistOfMaps)); + count = table.insert(TypeUtils.convertToRows(table.getMetadata(), rowsAslistOfMaps)); result.append("inserted " + count + " records to " + tableName + "\n"); break; case SAVE: - count = - table.save( - GraphqlApiFactory.convertToRows(table.getMetadata(), rowsAslistOfMaps)); + count = table.save(TypeUtils.convertToRows(table.getMetadata(), rowsAslistOfMaps)); result.append("upserted " + count + " records to " + tableName + "\n"); break; case DELETE: - count = - table.delete( - GraphqlApiFactory.convertToRows(table.getMetadata(), rowsAslistOfMaps)); + count = table.delete(TypeUtils.convertToRows(table.getMetadata(), rowsAslistOfMaps)); result.append("delete " + count + " records from " + tableName + "\n"); break; } diff --git a/backend/molgenis-emx2-graphql/src/main/java/org/molgenis/emx2/json/Column.java b/backend/molgenis-emx2-graphql/src/main/java/org/molgenis/emx2/json/Column.java index d4d246e2a5..84f649e9e7 100644 --- a/backend/molgenis-emx2-graphql/src/main/java/org/molgenis/emx2/json/Column.java +++ b/backend/molgenis-emx2-graphql/src/main/java/org/molgenis/emx2/json/Column.java @@ -16,6 +16,7 @@ public class Column { private Integer key = 0; private Boolean required = false; private Boolean readonly = false; + private String defaultValue; private String refSchema = null; private String refTable = null; private String refLink = null; @@ -68,6 +69,7 @@ public Column(org.molgenis.emx2.Column column, TableMetadata table, boolean mini this.validation = column.getValidation(); this.required = column.isRequired(); this.readonly = column.isReadonly(); + this.defaultValue = column.getDefaultValue(); this.descriptions = column.getDescriptions().entrySet().stream() .map(entry -> new LanguageValue(entry.getKey(), entry.getValue())) @@ -91,6 +93,7 @@ public org.molgenis.emx2.Column getColumnMetadata(TableMetadata tm) { c.setType(columnType); if (drop) c.drop(); c.setRequired(required); + c.setDefaultValue(defaultValue); c.setRefSchema(refSchema); c.setRefTable(refTable); c.setRefLink(refLink); @@ -304,4 +307,12 @@ public List getLabels() { public void setLabels(List labels) { this.labels = labels; } + + public String getDefaultValue() { + return defaultValue; + } + + public void setDefaultValue(String defaultValue) { + this.defaultValue = defaultValue; + } } diff --git a/backend/molgenis-emx2-graphql/src/test/java/org/molgenis/emx2/graphql/TestGraphqSchemaFields.java b/backend/molgenis-emx2-graphql/src/test/java/org/molgenis/emx2/graphql/TestGraphqlSchemaFields.java similarity index 98% rename from backend/molgenis-emx2-graphql/src/test/java/org/molgenis/emx2/graphql/TestGraphqSchemaFields.java rename to backend/molgenis-emx2-graphql/src/test/java/org/molgenis/emx2/graphql/TestGraphqlSchemaFields.java index 603b6b2c7b..89c719da68 100644 --- a/backend/molgenis-emx2-graphql/src/test/java/org/molgenis/emx2/graphql/TestGraphqSchemaFields.java +++ b/backend/molgenis-emx2-graphql/src/test/java/org/molgenis/emx2/graphql/TestGraphqlSchemaFields.java @@ -29,9 +29,9 @@ import org.molgenis.emx2.tasks.TaskService; import org.molgenis.emx2.tasks.TaskServiceInMemory; -public class TestGraphqSchemaFields { +public class TestGraphqlSchemaFields { - private static final String schemaName = TestGraphqSchemaFields.class.getSimpleName(); + private static final String schemaName = TestGraphqlSchemaFields.class.getSimpleName(); private static GraphQL grapql; private static Database database; private static TaskService taskService; @@ -472,12 +472,12 @@ public void testTableAlterDropOperations() throws IOException { // add table execute( - "mutation{change(tables:[{name:\"table1\",labels:[{locale:\"en\", value: \"table1\"}],descriptions:[{locale:\"en\", value: \"desc1\"}],columns:[{name:\"col1\", key:1, labels:[{locale:\"en\", value:\"column1\"}], descriptions:[{locale:\"en\", value:\"desc11\"}]}]}]){message}}"); - + "mutation{change(tables:[{name:\"table1\",labels:[{locale:\"en\", value: \"table1\"}],descriptions:[{locale:\"en\", value: \"desc1\"}],columns:[{name:\"col1\", defaultValue: \"bla\", key:1, labels:[{locale:\"en\", value:\"column1\"}], descriptions:[{locale:\"en\", value:\"desc11\"}]}]}]){message}}"); JsonNode node = execute( - "{_schema{tables{name,labels{locale,value},descriptions{locale,value},columns{name,key,labels{locale,value},descriptions{locale,value}}}}}"); - assertEquals(1, node.at("/_schema/tables/0/columns/0/key").intValue()); + "{_schema{tables{name,labels{locale,value},descriptions{locale,value},columns{name,key,defaultValue,labels{locale,value},descriptions{locale,value}}}}}"); + assertEquals(1, node.at("/_schema/tables/5/columns/0/key").intValue()); + assertEquals("bla", node.at("/_schema/tables/5/columns/0/defaultValue").asText()); assertEquals("en", node.at("/_schema/tables/5/labels/0/locale").asText()); assertEquals("table1", node.at("/_schema/tables/5/labels/0/value").asText()); diff --git a/backend/molgenis-emx2-io/src/main/java/org/molgenis/emx2/io/emx2/Emx2.java b/backend/molgenis-emx2-io/src/main/java/org/molgenis/emx2/io/emx2/Emx2.java index 9b918eee4e..b7e047ef8d 100644 --- a/backend/molgenis-emx2-io/src/main/java/org/molgenis/emx2/io/emx2/Emx2.java +++ b/backend/molgenis-emx2-io/src/main/java/org/molgenis/emx2/io/emx2/Emx2.java @@ -23,6 +23,7 @@ public class Emx2 { public static final String REF_JS_TEMPLATE = "refLabel"; public static final String REF_BACK = "refBack"; public static final String REQUIRED = "required"; + public static final String DEFAULT_VALUE = "defaultValue"; private static final String VALIDATION = "validation"; private static final String VISIBLE = "visible"; private static final String COMPUTED = "computed"; @@ -108,6 +109,7 @@ public static SchemaMetadata fromRowList(Iterable rows) { if (r.notNull(REF_LINK)) column.setRefLink(r.getString(REF_LINK)); if (r.notNull(REF_BACK)) column.setRefBack(r.getString(REF_BACK)); if (r.notNull(REQUIRED)) column.setRequired(r.getBoolean(REQUIRED)); + if (r.notNull(DEFAULT_VALUE)) column.setDefaultValue(r.getString(DEFAULT_VALUE)); if (r.notNull(DESCRIPTION)) column.setDescription(r.getString(DESCRIPTION)); // description i18n r.getColumnNames().stream() @@ -174,6 +176,7 @@ public static List getHeaders(SchemaMetadata schema) { REF_LINK, REF_BACK, REF_JS_TEMPLATE, + DEFAULT_VALUE, VALIDATION, VISIBLE, COMPUTED, @@ -218,6 +221,7 @@ public static List toRowList(SchemaMetadata schema) { row.setString(COLUMN_TYPE, null); row.setString(KEY, null); row.setString(REQUIRED, null); + row.setString(DEFAULT_VALUE, null); row.setString(REF_SCHEMA, null); row.setString(REF_TABLE, null); row.setString(REF_LINK, null); @@ -254,6 +258,7 @@ public static List toRowList(SchemaMetadata schema) { if (!c.getColumnType().equals(STRING)) row.setString(COLUMN_TYPE, c.getColumnType().toString().toLowerCase()); if (c.isRequired()) row.setBool(REQUIRED, c.isRequired()); + if (c.getDefaultValue() != null) row.setString(DEFAULT_VALUE, c.getDefaultValue()); if (c.getKey() > 0) row.setInt(KEY, c.getKey()); if (c.getRefSchema() != null && !c.getRefSchema().equals(c.getSchemaName())) row.setString(REF_SCHEMA, c.getRefSchema()); diff --git a/backend/molgenis-emx2-io/src/test/java/org/molgenis/emx2/io/TestImportExportAllExamples.java b/backend/molgenis-emx2-io/src/test/java/org/molgenis/emx2/io/TestImportExportAllExamples.java index b16631f07e..3d6e3c03d6 100644 --- a/backend/molgenis-emx2-io/src/test/java/org/molgenis/emx2/io/TestImportExportAllExamples.java +++ b/backend/molgenis-emx2-io/src/test/java/org/molgenis/emx2/io/TestImportExportAllExamples.java @@ -1,5 +1,9 @@ package org.molgenis.emx2.io; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.molgenis.emx2.Column.column; +import static org.molgenis.emx2.TableMetadata.table; + import java.io.IOException; import java.util.List; import org.junit.jupiter.api.BeforeAll; @@ -61,7 +65,16 @@ public void testPetStoreExample() throws IOException { executeCompare(schema1); } - public void executeCompare(SchemaMetadata schema1) throws IOException, MolgenisException { + @Test + public void testDefaultValuesMetadata() throws IOException { + SchemaMetadata schema1 = new SchemaMetadata("8"); + schema1.create(table("test", column("id").setDefaultValue("bla"))); + Schema result = executeCompare(schema1); + assertEquals( + "bla", result.getMetadata().getTableMetadata("test").getColumn("id").getDefaultValue()); + } + + public Schema executeCompare(SchemaMetadata schema1) throws IOException, MolgenisException { try { // now write it out and fromReader back and compare List contents = Emx2.toRowList(schema1); @@ -75,6 +88,7 @@ public void executeCompare(SchemaMetadata schema1) throws IOException, MolgenisE Schema schema3 = db.dropCreateSchema(getClass().getSimpleName() + schema1.getName()); schema3.migrate(schema2); + return schema3; } catch (MolgenisException e) { System.out.println(e.getDetails()); diff --git a/backend/molgenis-emx2-sql-it/src/test/java/org/molgenis/emx2/sql/TestComputedOrDefaultValue.java b/backend/molgenis-emx2-sql-it/src/test/java/org/molgenis/emx2/sql/TestComputedOrDefaultValue.java new file mode 100644 index 0000000000..c1f3b2f3e1 --- /dev/null +++ b/backend/molgenis-emx2-sql-it/src/test/java/org/molgenis/emx2/sql/TestComputedOrDefaultValue.java @@ -0,0 +1,99 @@ +package org.molgenis.emx2.sql; + +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.molgenis.emx2.Column.column; +import static org.molgenis.emx2.Row.row; +import static org.molgenis.emx2.TableMetadata.table; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.molgenis.emx2.*; + +@Tag("slow") +public class TestComputedOrDefaultValue { + static Database db; + static Schema schema; + + @BeforeAll + public static void setup() { + db = TestDatabaseFactory.getTestDatabase(); + + schema = db.dropCreateSchema(TestComputedOrDefaultValue.class.getSimpleName()); + } + + @Test + public void testComputed() { + Table t = + schema.create(table("Test1", column("id").setPkey(), column("computed").setComputed("5;"))); + + // reload to make sure 'computed' is really in backend + db.clearCache(); + schema = db.getSchema(TestComputedOrDefaultValue.class.getSimpleName()); + + t.insert(new Row().set("id", 1)); + assertEquals(5, (int) t.query().retrieveRows().get(0).getInteger("computed")); + + t = schema.create(table("Test2", column("id").setPkey(), column("computed").setComputed("id"))); + t.insert(new Row().set("id", 1)); + assertEquals(1, (int) t.query().retrieveRows().get(0).getInteger("computed")); + + // t = schema.create(table("Test3", column("id").pkey(), column("computed").computed("id"))); + // List rows = new ArrayList<>(); + // for (int i = 0; i < 10000; i++) { + // rows.add(new Row().set("id", i)); + // } + // + // // perf test; + // StopWatch.start("start"); + // t.insert(rows); + // StopWatch.print("complete", 10000); + } + + @Test + public void testDefault() { + final Table t = + schema.create( + table("Test3", column("id").setPkey(), column("hasDefault").setDefaultValue("blaat"))); + + t.insert(new Row().set("id", 1)); + assertEquals("blaat", t.query().retrieveRows().get(0).getString("hasDefault")); + + final Table t2 = + schema.create( + table( + "Test4", + column("id").setPkey(), + column("autoDate") + .setType(ColumnType.DATE) + .setDefaultValue("=new Date().toISOString().substring(0,10)"), + column("autoDateTime") + .setType(ColumnType.DATETIME) + .setDefaultValue("=new Date().toISOString()"))); + t2.insert(new Row().set("id", 1)); + final Row result = t2.query().retrieveRows().get(0); + assertDoesNotThrow(() -> result.getDate("autoDate")); + assertDoesNotThrow(() -> result.getDate("autoDateTime")); + + final Table t3 = + schema.create( + table( + "Test5", + column("id").setPkey(), + column("ontologyArray") + .setType(ColumnType.ONTOLOGY_ARRAY) + .setRefTable("Colors") + .setDefaultValue("=[{name:\"green\"}]"), + column("ontology") + .setType(ColumnType.ONTOLOGY) + .setRefTable("Colors") + .setDefaultValue("={name:\"green\"}"))); + schema.getTable("Colors").insert(row("name", "green")); + + t3.insert(new Row().set("id", 1)); + final Row result2 = t3.query().retrieveRows().get(0); + assertEquals("green", result2.getString("ontology")); + assertEquals("green", result2.getStringArray("ontologyArray")[0]); + } +} diff --git a/backend/molgenis-emx2-sql-it/src/test/java/org/molgenis/emx2/sql/TestComputedValue.java b/backend/molgenis-emx2-sql-it/src/test/java/org/molgenis/emx2/sql/TestComputedValue.java deleted file mode 100644 index 0af5a59efa..0000000000 --- a/backend/molgenis-emx2-sql-it/src/test/java/org/molgenis/emx2/sql/TestComputedValue.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.molgenis.emx2.sql; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.molgenis.emx2.Column.column; -import static org.molgenis.emx2.TableMetadata.table; - -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Tag; -import org.junit.jupiter.api.Test; -import org.molgenis.emx2.Database; -import org.molgenis.emx2.Row; -import org.molgenis.emx2.Schema; -import org.molgenis.emx2.Table; - -@Tag("slow") -public class TestComputedValue { - static Database db; - static Schema schema; - - @BeforeAll - public static void setup() { - db = TestDatabaseFactory.getTestDatabase(); - - schema = db.dropCreateSchema(TestComputedValue.class.getSimpleName()); - } - - @Test - public void test1() { - Table t = - schema.create(table("Test1", column("id").setPkey(), column("computed").setComputed("5;"))); - - // reload to make sure 'computed' is really in backend - db.clearCache(); - schema = db.getSchema(TestComputedValue.class.getSimpleName()); - - t.insert(new Row().set("id", 1)); - assertEquals(5, (int) t.query().retrieveRows().get(0).getInteger("computed")); - - t = schema.create(table("Test2", column("id").setPkey(), column("computed").setComputed("id"))); - t.insert(new Row().set("id", 1)); - assertEquals(1, (int) t.query().retrieveRows().get(0).getInteger("computed")); - - // t = schema.create(table("Test3", column("id").pkey(), column("computed").computed("id"))); - // List rows = new ArrayList<>(); - // for (int i = 0; i < 10000; i++) { - // rows.add(new Row().set("id", i)); - // } - // - // // perf test; - // StopWatch.start("start"); - // t.insert(rows); - // StopWatch.print("complete", 10000); - } -} diff --git a/backend/molgenis-emx2-sql-it/src/test/java/org/molgenis/emx2/sql/TestEvaluateExpressions.java b/backend/molgenis-emx2-sql-it/src/test/java/org/molgenis/emx2/sql/TestEvaluateExpressions.java index c3dd9018f3..4de261439f 100644 --- a/backend/molgenis-emx2-sql-it/src/test/java/org/molgenis/emx2/sql/TestEvaluateExpressions.java +++ b/backend/molgenis-emx2-sql-it/src/test/java/org/molgenis/emx2/sql/TestEvaluateExpressions.java @@ -88,8 +88,8 @@ public void evaluateValidationExpressionTestSuccessFunctionCall() { @Test public void testCalculateComputedExpression() { String expression = "5 + 7"; - String outcome = executeJavascriptOnMap(expression, Map.of()); - assertEquals(12, Integer.parseInt(outcome)); + Object outcome = executeJavascriptOnMap(expression, Map.of()); + assertEquals(12, outcome); } @Test diff --git a/backend/molgenis-emx2-sql/src/main/java/org/molgenis/emx2/sql/MetadataUtils.java b/backend/molgenis-emx2-sql/src/main/java/org/molgenis/emx2/sql/MetadataUtils.java index 34852364f6..85fae83d79 100644 --- a/backend/molgenis-emx2-sql/src/main/java/org/molgenis/emx2/sql/MetadataUtils.java +++ b/backend/molgenis-emx2-sql/src/main/java/org/molgenis/emx2/sql/MetadataUtils.java @@ -94,6 +94,8 @@ public class MetadataUtils { field(name("cascade"), BOOLEAN.nullable(true)); private static final Field COLUMN_READONLY = field(name("readonly"), BOOLEAN.nullable(true)); + private static final Field COLUMN_DEFAULT = + field(name("defaultValue"), VARCHAR.nullable(true)); // users private static final Field USER_NAME = field(name("username"), VARCHAR); @@ -503,6 +505,7 @@ protected static void saveColumnMetadata(DSLContext jooq, Column column) { COLUMN_DESCRIPTION, COLUMN_READONLY, COLUMN_SEMANTICS, + COLUMN_DEFAULT, COLUMN_PROFILES, COLUMN_VISIBLE) .values( @@ -526,6 +529,7 @@ protected static void saveColumnMetadata(DSLContext jooq, Column column) { column.getDescriptions(), column.isReadonly(), column.getSemantics(), + column.getDefaultValue(), column.getProfiles(), column.getVisible()) .onConflict(TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME) @@ -549,6 +553,7 @@ protected static void saveColumnMetadata(DSLContext jooq, Column column) { .set(COLUMN_SEMANTICS, column.getSemantics()) .set(COLUMN_PROFILES, column.getProfiles()) .set(COLUMN_VISIBLE, column.getVisible()) + .set(COLUMN_DEFAULT, column.getDefaultValue()) .execute(); } @@ -588,6 +593,7 @@ private static Column recordToColumn(org.jooq.Record col) { c.setSemantics(col.get(COLUMN_SEMANTICS, String[].class)); c.setProfiles(col.get(COLUMN_PROFILES, String[].class)); c.setVisible(col.get(COLUMN_VISIBLE, String.class)); + c.setDefaultValue(col.get(COLUMN_DEFAULT, String.class)); return c; } diff --git a/backend/molgenis-emx2-sql/src/main/java/org/molgenis/emx2/sql/Migrations.java b/backend/molgenis-emx2-sql/src/main/java/org/molgenis/emx2/sql/Migrations.java index a64f8176bc..d9dfa3d079 100644 --- a/backend/molgenis-emx2-sql/src/main/java/org/molgenis/emx2/sql/Migrations.java +++ b/backend/molgenis-emx2-sql/src/main/java/org/molgenis/emx2/sql/Migrations.java @@ -20,7 +20,7 @@ public class Migrations { // version the current software needs to work - private static final int SOFTWARE_DATABASE_VERSION = 11; + private static final int SOFTWARE_DATABASE_VERSION = 12; private static Logger logger = LoggerFactory.getLogger(Migrations.class); public static synchronized void initOrMigrate(SqlDatabase db) { @@ -85,6 +85,9 @@ public static synchronized void initOrMigrate(SqlDatabase db) { if (version < 11) executeMigrationFile(tdb, "migration11.sql", "add profile metadata"); + if (version < 12) + executeMigrationFile(tdb, "migration12.sql", "add defaultValue in metadata schema"); + // if success, update version to SOFTWARE_DATABASE_VERSION updateDatabaseVersion((SqlDatabase) tdb, SOFTWARE_DATABASE_VERSION); }); diff --git a/backend/molgenis-emx2-sql/src/main/java/org/molgenis/emx2/sql/SqlColumnExecutor.java b/backend/molgenis-emx2-sql/src/main/java/org/molgenis/emx2/sql/SqlColumnExecutor.java index 208b0d952b..dfa5a3d0cb 100644 --- a/backend/molgenis-emx2-sql/src/main/java/org/molgenis/emx2/sql/SqlColumnExecutor.java +++ b/backend/molgenis-emx2-sql/src/main/java/org/molgenis/emx2/sql/SqlColumnExecutor.java @@ -11,6 +11,8 @@ import static org.molgenis.emx2.sql.SqlColumnRefBackExecutor.removeRefBackConstraints; import static org.molgenis.emx2.sql.SqlColumnRefExecutor.createRefConstraints; import static org.molgenis.emx2.sql.SqlTypeUtils.getPsqlType; +import static org.molgenis.emx2.sql.SqlTypeUtils.getTypedValue; +import static org.molgenis.emx2.utils.JavaScriptUtils.executeJavascript; import java.util.Map; import java.util.concurrent.atomic.AtomicBoolean; @@ -443,10 +445,20 @@ static void executeRemoveRefConstraints(DSLContext jooq, Column column) { } public static void executeSetDefaultValue(DSLContext jooq, Column newColumn) { - if (newColumn.getDefaultValue() != null) { + if (newColumn.getDefaultValue() != null && newColumn.isReference()) { + // we can't do this for references yet + Object defaultValue = newColumn.getDefaultValue(); + if (newColumn.getDefaultValue().startsWith("=")) { + defaultValue = executeJavascript(newColumn.getDefaultValue().substring(1)); + } + defaultValue = getTypedValue(defaultValue, newColumn.getPrimitiveColumnType()); jooq.alterTable(newColumn.getJooqTable()) .alterColumn(newColumn.getJooqField()) - .defaultValue(newColumn.getDefaultValue()) + .defaultValue(defaultValue) + .execute(); + jooq.update(newColumn.getJooqTable()) + .set(newColumn.getJooqField(), defaultValue) + .where(newColumn.getJooqField().isNull()) .execute(); } else { // remove default diff --git a/backend/molgenis-emx2-sql/src/main/java/org/molgenis/emx2/sql/SqlTypeUtils.java b/backend/molgenis-emx2-sql/src/main/java/org/molgenis/emx2/sql/SqlTypeUtils.java index 03acc45104..82aff015cf 100644 --- a/backend/molgenis-emx2-sql/src/main/java/org/molgenis/emx2/sql/SqlTypeUtils.java +++ b/backend/molgenis-emx2-sql/src/main/java/org/molgenis/emx2/sql/SqlTypeUtils.java @@ -1,6 +1,7 @@ package org.molgenis.emx2.sql; import static org.molgenis.emx2.ColumnType.AUTO_ID; +import static org.molgenis.emx2.utils.JavaScriptUtils.executeJavascript; import static org.molgenis.emx2.utils.JavaScriptUtils.executeJavascriptOnMap; import java.util.*; @@ -32,6 +33,32 @@ public static void applyValidationAndComputed(List columns, Row row) { c.getName(), Constants.MG_USER_PREFIX + row.getString(Constants.MG_EDIT_ROLE)); } else if (AUTO_ID.equals(c.getColumnType())) { applyAutoid(c, row); + } else if (c.getDefaultValue() != null && !row.notNull(c.getName())) { + if (c.getDefaultValue().startsWith("=")) { + try { + if (c.isRefArray()) { + convertRefArrayToRow( + (List) + executeJavascriptOnMap(c.getDefaultValue().substring(1), graph, List.class), + row, + c); + } else if (c.isRef()) { + convertRefToRow( + (Map) + executeJavascriptOnMap( + "(" + c.getDefaultValue().substring(1) + ")", graph, Map.class), + row, + c); + } else { + row.set(c.getName(), executeJavascript(c.getDefaultValue().substring(1))); + } + } catch (Exception e) { + throw new MolgenisException( + "Error in defaultValue of column " + c.getName() + ": " + e.getMessage()); + } + } else { + row.set(c.getName(), c.getDefaultValue()); + } } else if (c.getComputed() != null) { row.set(c.getName(), executeJavascriptOnMap(c.getComputed(), graph)); } else if (columnIsVisible(c, graph)) { @@ -84,8 +111,8 @@ private static void checkRequired(Column c, Row row) { private static boolean columnIsVisible(Column column, Map values) { if (column.getVisible() != null) { - String visibleResult = executeJavascriptOnMap(column.getVisible(), values); - if (visibleResult.equals("false") || visibleResult.equals("null")) { + Object visibleResult = executeJavascriptOnMap(column.getVisible(), values); + if (visibleResult == null || Boolean.FALSE.equals(visibleResult)) { return false; } } @@ -164,19 +191,22 @@ public static void checkValidation(Column column, Map values) { public static String checkValidation(String validationScript, Map values) { try { - String error = executeJavascriptOnMap(validationScript, values); + Object error = executeJavascriptOnMap(validationScript, values); if (error != null) { - if (error.trim().equals("false")) { + if (error instanceof Boolean && (Boolean) error == false) { // you can have a validation rule that simply returns true or false; // false means not valid. return validationScript; - } else + } else if (error instanceof Boolean && (Boolean) error == true) { + return null; + } // you can have a validation script returning true which means valid, and undefined also - if (!error.trim().equals("true") && !error.trim().equals("undefined")) { - return error; + else { + return error.toString(); } + } else { + return null; } - return null; } catch (MolgenisException me) { // seperate syntax errors throw me; diff --git a/backend/molgenis-emx2-sql/src/main/resources/org/molgenis/emx2/sql/migration12.sql b/backend/molgenis-emx2-sql/src/main/resources/org/molgenis/emx2/sql/migration12.sql new file mode 100644 index 0000000000..a6909fe023 --- /dev/null +++ b/backend/molgenis-emx2-sql/src/main/resources/org/molgenis/emx2/sql/migration12.sql @@ -0,0 +1,2 @@ +ALTER TABLE "MOLGENIS"."column_metadata" + ADD COLUMN IF NOT EXISTS "defaultValue" VARCHAR; \ No newline at end of file diff --git a/backend/molgenis-emx2-webapi/src/main/java/org/molgenis/emx2/web/BeaconApi.java b/backend/molgenis-emx2-webapi/src/main/java/org/molgenis/emx2/web/BeaconApi.java index f596a0e94a..cca9329758 100644 --- a/backend/molgenis-emx2-webapi/src/main/java/org/molgenis/emx2/web/BeaconApi.java +++ b/backend/molgenis-emx2-webapi/src/main/java/org/molgenis/emx2/web/BeaconApi.java @@ -147,8 +147,9 @@ private static String getGenomicVariants(Request request, Response response) thr static List getTableFromAllSchemas(String tableName, Request request) { List
tables = new ArrayList<>(); Collection schemaNames = MolgenisWebservice.getSchemaNames(request); + Database database = sessionManager.getSession(request).getDatabase(); for (String sn : schemaNames) { - Schema schema = sessionManager.getSession(request).getDatabase().getSchema(sn); + Schema schema = database.getSchema(sn); Table t = schema.getTable(tableName); if (t != null) { tables.add(t); diff --git a/backend/molgenis-emx2-webapi/src/test/java/org.molgenis.emx2.web/WebApiSmokeTests.java b/backend/molgenis-emx2-webapi/src/test/java/org.molgenis.emx2.web/WebApiSmokeTests.java index f6a6bbf8e0..1bec294771 100644 --- a/backend/molgenis-emx2-webapi/src/test/java/org.molgenis.emx2.web/WebApiSmokeTests.java +++ b/backend/molgenis-emx2-webapi/src/test/java/org.molgenis.emx2.web/WebApiSmokeTests.java @@ -182,47 +182,49 @@ public void testCsvApi_csvTableMetadataUpdate() throws IOException { // full table header present in exported table metadata String header = - "tableName,tableExtends,tableType,columnName,columnType,key,required,refSchema,refTable,refLink,refBack,refLabel,validation,visible,computed,semantics,profiles,label,description\r\n"; + "tableName,tableExtends,tableType,columnName,columnType,key,required,refSchema,refTable,refLink,refBack,refLabel,defaultValue,validation,visible,computed,semantics,profiles,label,description\r\n"; // add new table with description and semantics as metadata addUpdateTableAndCompare( header, "tableName,description,semantics\r\nTestMetaTable,TestDesc,TestSem", - "TestMetaTable,,,,,,,,,,,,,,,TestSem,,,TestDesc\r\n"); + "TestMetaTable,,,,,,,,,,,,,,,,TestSem,,,TestDesc\r\n"); // update table without new description or semantics, values should be untouched addUpdateTableAndCompare( - header, "tableName\r\nTestMetaTable", "TestMetaTable,,,,,,,,,,,,,,,TestSem,,,TestDesc\r\n"); + header, + "tableName\r\nTestMetaTable", + "TestMetaTable,,,,,,,,,,,,,,,,TestSem,,,TestDesc\r\n"); // update only description, semantics should be untouched addUpdateTableAndCompare( header, "tableName,description\r\nTestMetaTable,NewTestDesc", - "TestMetaTable,,,,,,,,,,,,,,,TestSem,,,NewTestDesc\r\n"); + "TestMetaTable,,,,,,,,,,,,,,,,TestSem,,,NewTestDesc\r\n"); // make semantics empty by not supplying a value, description should be untouched addUpdateTableAndCompare( header, "tableName,semantics\r\nTestMetaTable,", - "TestMetaTable,,,,,,,,,,,,,,,,,,NewTestDesc\r\n"); + "TestMetaTable,,,,,,,,,,,,,,,,,,,NewTestDesc\r\n"); // make description empty while also adding a new value for semantics addUpdateTableAndCompare( header, "tableName,description,semantics\r\nTestMetaTable,,NewTestSem", - "TestMetaTable,,,,,,,,,,,,,,,NewTestSem,,,\r\n"); + "TestMetaTable,,,,,,,,,,,,,,,,NewTestSem,,,\r\n"); // empty both description and semantics addUpdateTableAndCompare( header, "tableName,description,semantics\r\nTestMetaTable,,", - "TestMetaTable,,,,,,,,,,,,,,,,,,\r\n"); + "TestMetaTable,,,,,,,,,,,,,,,,,,,\r\n"); // add description value, and string array value for semantics addUpdateTableAndCompare( header, "tableName,description,semantics\r\nTestMetaTable,TestDesc,\"TestSem1,TestSem2\"", - "TestMetaTable,,,,,,,,,,,,,,,\"TestSem1,TestSem2\",,,TestDesc\r\n"); + "TestMetaTable,,,,,,,,,,,,,,,,\"TestSem1,TestSem2\",,,TestDesc\r\n"); } /** diff --git a/backend/molgenis-emx2/src/main/java/org/molgenis/emx2/Row.java b/backend/molgenis-emx2/src/main/java/org/molgenis/emx2/Row.java index f18374e1fb..0505c9ed49 100644 --- a/backend/molgenis-emx2/src/main/java/org/molgenis/emx2/Row.java +++ b/backend/molgenis-emx2/src/main/java/org/molgenis/emx2/Row.java @@ -380,7 +380,7 @@ public boolean containsName(String columnName) { } public boolean notNull(String columnName) { - return values.get(columnName) != null; + return values.get(columnName) != null && !values.get(columnName).toString().trim().equals(""); } public boolean isNull(String columnName, ColumnType type) { diff --git a/backend/molgenis-emx2/src/main/java/org/molgenis/emx2/utils/JavaScriptUtils.java b/backend/molgenis-emx2/src/main/java/org/molgenis/emx2/utils/JavaScriptUtils.java index 78e960f04d..d0bc8037e9 100644 --- a/backend/molgenis-emx2/src/main/java/org/molgenis/emx2/utils/JavaScriptUtils.java +++ b/backend/molgenis-emx2/src/main/java/org/molgenis/emx2/utils/JavaScriptUtils.java @@ -19,7 +19,20 @@ private JavaScriptUtils() { // hide constructor } - public static String executeJavascriptOnMap(String script, Map values) { + public static Object executeJavascript(String script) { + return executeJavascript(script, Object.class); + } + + public static Object executeJavascript(String script, Class clazz) { + return executeJavascriptOnMap(script, null, clazz); + } + + public static Object executeJavascriptOnMap(String script, Map values) { + return executeJavascriptOnMap(script, values, Object.class); + } + + public static Object executeJavascriptOnMap( + String script, Map values, Class clazz) { try { final Context context = Context.newBuilder("js") @@ -28,15 +41,18 @@ public static String executeJavascriptOnMap(String script, Map v .allowArrayAccess(true) .allowListAccess(true) .allowMapAccess(true) + .allowAllClassImplementations(true) .build()) .engine(engine) .build(); Value bindings = context.getBindings("js"); - for (Map.Entry entry : values.entrySet()) { - bindings.putMember(entry.getKey(), entry.getValue()); + if (values != null) { + for (Map.Entry entry : values.entrySet()) { + bindings.putMember(entry.getKey(), entry.getValue()); + } } String scriptWithFixedRegex = script.replace("\\\\", "\\"); - return context.eval("js", scriptWithFixedRegex).toString(); + return context.eval("js", scriptWithFixedRegex).as(clazz); } catch (Exception e) { throw new MolgenisException("script failed: " + e.getMessage()); } diff --git a/backend/molgenis-emx2/src/main/java/org/molgenis/emx2/utils/TypeUtils.java b/backend/molgenis-emx2/src/main/java/org/molgenis/emx2/utils/TypeUtils.java index 103977df56..944d72b199 100644 --- a/backend/molgenis-emx2/src/main/java/org/molgenis/emx2/utils/TypeUtils.java +++ b/backend/molgenis-emx2/src/main/java/org/molgenis/emx2/utils/TypeUtils.java @@ -15,8 +15,7 @@ import org.jooq.DataType; import org.jooq.JSONB; import org.jooq.impl.SQLDataType; -import org.molgenis.emx2.ColumnType; -import org.molgenis.emx2.MolgenisException; +import org.molgenis.emx2.*; public class TypeUtils { private static final String LOOSE_PARSER_FORMAT = @@ -178,7 +177,8 @@ public static LocalDate toDate(Object v) { // otherwise try to use string value String value = toString(v); if (value != null) { - return LocalDate.parse(v.toString()); + LocalDateTime ldt = toDateTime(v); + if (ldt != null) return ldt.toLocalDate(); } return null; } @@ -478,4 +478,87 @@ public static LocalDateTime millisecondsToLocalDateTime(long milliseconds) { return null; } } + + public static Iterable convertToRows(TableMetadata metadata, List> map) { + List rows = new ArrayList<>(); + for (Map object : map) { + Row row = new Row(); + for (Column column : metadata.getColumns()) { + if (object.containsKey(column.getIdentifier())) { + if (column.isRef()) { + convertRefToRow((Map) object.get(column.getIdentifier()), row, column); + } else if (column.isReference()) { + // REFBACK, REF_ARRAY + convertRefArrayToRow( + (List>) object.get(column.getIdentifier()), row, column); + } else if (column.isFile()) { + BinaryFileWrapper bfw = (BinaryFileWrapper) object.get(column.getIdentifier()); + if (bfw == null || !bfw.isSkip()) { + // also necessary in case of 'null' to ensure all file metadata fields are made empty + // skip is used when use submitted only metadata (that they received in query) + row.setBinary( + column.getName(), (BinaryFileWrapper) object.get(column.getIdentifier())); + } + } else { + row.set(column.getName(), object.get(column.getIdentifier())); + } + } + } + rows.add(row); + } + return rows; + } + + protected static void convertRefArrayToRow( + List> list, Row row, Column column) { + + List refs = column.getReferences(); + for (Reference ref : refs) { + if (!ref.isOverlapping()) { + if (!list.isEmpty()) { + row.set(ref.getName(), getRefValueFromList(ref.getPath(), list)); + } else { + row.set(ref.getName(), new ArrayList<>()); + } + } + } + } + + private static List getRefValueFromList( + List path, List> list) { + List result = new ArrayList<>(); + for (Map map : list) { + Object value = getRefValueFromMap(path, map); + if (value != null) { + result.add(value); + } + } + return result; + } + + private static Object getRefValueFromMap(List path, Map map) { + if (path.size() == 1) { + return map.get(path.get(0)); + } else { + // should be > 1 and value should be of type map + Object value = map.get(path.get(0)); + if (value != null) { + return getRefValueFromMap(path.subList(1, path.size()), (Map) value); + } + return null; + } + } + + protected static void convertRefToRow(Map map, Row row, Column column) { + for (Reference ref : column.getReferences()) { + if (!ref.isOverlapping()) { + String name = ref.getName(); + if (map == null) { + row.set(name, null); + } else { + row.set(ref.getName(), getRefValueFromMap(ref.getPath(), map)); + } + } + } + } } diff --git a/backend/molgenis-emx2/src/test/java/org/molgenis/emx2/utils/TestJavaScriptUtils.java b/backend/molgenis-emx2/src/test/java/org/molgenis/emx2/utils/TestJavaScriptUtils.java index a788f10559..c1e13b9b2b 100644 --- a/backend/molgenis-emx2/src/test/java/org/molgenis/emx2/utils/TestJavaScriptUtils.java +++ b/backend/molgenis-emx2/src/test/java/org/molgenis/emx2/utils/TestJavaScriptUtils.java @@ -13,7 +13,7 @@ class TestJavaScriptUtils { @Test void testCalculateComputedExpression() { String expression = "5 + 7"; - String outcome = executeJavascriptOnMap(expression, Map.of()); - assertEquals(12, Integer.parseInt(outcome)); + Object outcome = executeJavascriptOnMap(expression, Map.of()); + assertEquals(12, outcome); } } diff --git a/docs/molgenis/use_schema.md b/docs/molgenis/use_schema.md index 2eba91c7ac..197a7ed5be 100644 --- a/docs/molgenis/use_schema.md +++ b/docs/molgenis/use_schema.md @@ -93,6 +93,19 @@ is used as the primary key in the user interface, upload and API. Other key>1 ca When required=TRUE then values in this column must be filled. When required=FALSE then this column can be left empty. Default value: FALSE. +### defaultValue + +Using 'defaultValue' you can set a default value for a column. In forms, this value will be pre-filled. +When uploading csv/excel all empty cells will receive the defaultValue (in insert and update) +Optionally you can also use javascript expressions. For example: +* ```duck``` would set a string value +* ```1``` would set a numeric value +* ```=new Date().toJSONString()``` provides automatic date/dateTime +* ```={name:"green"}``` could be default value for an ontology_ +* ```=[{name:"green"}]``` could be default value for an ontology_array + +Known limitation: doesn't work for columns refering to a table with composite primary key (i.e. having multiple key=1 fields). + ### label,label:en,label:fr etc Using label you can change the labels in forms. Typically useful for data capture and surveys. Using :suffix you can give labels for multiple languages, e.g.