From 2a8ecb8a8c4be739ff8c3ae3e2c4bc87e9c1cf91 Mon Sep 17 00:00:00 2001 From: renovate Date: Thu, 3 Jun 2021 09:15:21 +0000 Subject: [PATCH 01/13] Update dependency jest to v27.0.4 (#535) Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/535 Co-authored-by: renovate Co-committed-by: renovate --- package.json | 2 +- yarn.lock | 162 ++++++++++++++++++++++++++------------------------- 2 files changed, 83 insertions(+), 81 deletions(-) diff --git a/package.json b/package.json index 3274a0ef8..0f75e9f18 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "eslint": "7.27.0", "eslint-plugin-vue": "7.10.0", "faker": "5.5.3", - "jest": "27.0.3", + "jest": "27.0.4", "sass-loader": "10.2.0", "vue-flatpickr-component": "8.1.6", "vue-notification": "1.3.20", diff --git a/yarn.lock b/yarn.lock index 8e4bf56f0..5ca4936ed 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1843,13 +1843,13 @@ jest-util "^27.0.2" slash "^3.0.0" -"@jest/core@^27.0.3": - version "27.0.3" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.0.3.tgz#b5a38675fa0466450a7fd465f4b226762cb592a2" - integrity sha512-rN8lr/OJ8iApcQUh4khnMaOCVX4oRnLwy2tPW3Vh70y62K8Da8fhkxMUq0xX9VPa4+yWUm0tGc/jUSJi+Jzuwg== +"@jest/core@^27.0.4": + version "27.0.4" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.0.4.tgz#679bf9ac07900da2ddbb9667bb1afa8029038f53" + integrity sha512-+dsmV8VUs1h/Szb+rEWk8xBM1fp1I///uFy9nk3wXGvRsF2lBp8EVPmtWc+QFRb3MY2b7u2HbkGF1fzoDzQTLA== dependencies: "@jest/console" "^27.0.2" - "@jest/reporters" "^27.0.2" + "@jest/reporters" "^27.0.4" "@jest/test-result" "^27.0.2" "@jest/transform" "^27.0.2" "@jest/types" "^27.0.2" @@ -1860,15 +1860,15 @@ exit "^0.1.2" graceful-fs "^4.2.4" jest-changed-files "^27.0.2" - jest-config "^27.0.3" + jest-config "^27.0.4" jest-haste-map "^27.0.2" jest-message-util "^27.0.2" jest-regex-util "^27.0.1" - jest-resolve "^27.0.2" - jest-resolve-dependencies "^27.0.3" - jest-runner "^27.0.3" - jest-runtime "^27.0.3" - jest-snapshot "^27.0.2" + jest-resolve "^27.0.4" + jest-resolve-dependencies "^27.0.4" + jest-runner "^27.0.4" + jest-runtime "^27.0.4" + jest-snapshot "^27.0.4" jest-util "^27.0.2" jest-validate "^27.0.2" jest-watcher "^27.0.2" @@ -1909,10 +1909,10 @@ "@jest/types" "^27.0.2" expect "^27.0.2" -"@jest/reporters@^27.0.2": - version "27.0.2" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.0.2.tgz#ad73835d1cd54da08b0998a70b14446405e8e0d9" - integrity sha512-SVQjew/kafNxSN1my4praGQP+VPVGHsU8zqiEDppLvq6j1lryIjdNb9P+bZSsKeifU4bIoaPnf9Ui0tK9WOpFA== +"@jest/reporters@^27.0.4": + version "27.0.4" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.0.4.tgz#95609b1be97afb80d55d8aa3d7c3179c15810e65" + integrity sha512-Xa90Nm3JnV0xCe4M6A10M9WuN9krb+WFKxV1A98Y4ePCw40n++r7uxFUNU7DT1i9Behj7fjrAIju9oU0t1QtCg== dependencies: "@bcoe/v8-coverage" "^0.2.3" "@jest/console" "^27.0.2" @@ -1930,7 +1930,7 @@ istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.0.2" jest-haste-map "^27.0.2" - jest-resolve "^27.0.2" + jest-resolve "^27.0.4" jest-util "^27.0.2" jest-worker "^27.0.2" slash "^3.0.0" @@ -1958,15 +1958,15 @@ "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^27.0.3": - version "27.0.3" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.0.3.tgz#2a8632b86a9a6f8900e514917cdab6a062e71049" - integrity sha512-DcLTzraZ8xLr5fcIl+CF14vKeBBpBrn55wFxI9Ju+dhEBdjRdJQ/Z/pLkMehkPZWIQ+rR23J8e+wFDkfjree0Q== +"@jest/test-sequencer@^27.0.4": + version "27.0.4" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.0.4.tgz#976493b277594d81e589896f0ed21f198308928a" + integrity sha512-6UFEVwdmxYdyNffBxVVZxmXEdBE4riSddXYSnFNH0ELFQFk/bvagizim8WfgJTqF4EKd+j1yFxvhb8BMHfOjSQ== dependencies: "@jest/test-result" "^27.0.2" graceful-fs "^4.2.4" jest-haste-map "^27.0.2" - jest-runtime "^27.0.3" + jest-runtime "^27.0.4" "@jest/transform@^27.0.2": version "27.0.2" @@ -8554,10 +8554,10 @@ jest-changed-files@^27.0.2: execa "^5.0.0" throat "^6.0.1" -jest-circus@^27.0.3: - version "27.0.3" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.0.3.tgz#32006967de484e03589da944064d72e172ce3261" - integrity sha512-tdMfzs7SgD5l7jRcI1iB3vtQi5fHwCgo4RlO8bzZnYc05PZ+tlAOMZeS8eGYkZ2tPaRY/aRLMFWQp/8zXBrolQ== +jest-circus@^27.0.4: + version "27.0.4" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.0.4.tgz#3b261514ee3b3da33def736a6352c98ff56bb6e6" + integrity sha512-QD+eblDiRphta630WRKewuASLs/oY1Zki2G4bccntRvrTHQ63ljwFR5TLduuK4Zg0ZPzW0+8o6AP7KRd1yKOjw== dependencies: "@jest/environment" "^27.0.3" "@jest/test-result" "^27.0.2" @@ -8571,39 +8571,39 @@ jest-circus@^27.0.3: jest-each "^27.0.2" jest-matcher-utils "^27.0.2" jest-message-util "^27.0.2" - jest-runtime "^27.0.3" - jest-snapshot "^27.0.2" + jest-runtime "^27.0.4" + jest-snapshot "^27.0.4" jest-util "^27.0.2" pretty-format "^27.0.2" slash "^3.0.0" stack-utils "^2.0.3" throat "^6.0.1" -jest-cli@^27.0.3: - version "27.0.3" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.0.3.tgz#b733871acb526054a0f8c971d0466595c5f8316d" - integrity sha512-7bt9Sgv4nWH5pUnyJfdLf8CHWfo4+7lSPxeBwQx4r0vBj9jweJam/piE2U91SXtQI+ckm+TIN97OVnqIYpVhSg== +jest-cli@^27.0.4: + version "27.0.4" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.0.4.tgz#491b12c754c0d7c6873b13a66f26b3a80a852910" + integrity sha512-E0T+/i2lxsWAzV7LKYd0SB7HUAvePqaeIh5vX43/G5jXLhv1VzjYzJAGEkTfvxV774ll9cyE2ljcL73PVMEOXQ== dependencies: - "@jest/core" "^27.0.3" + "@jest/core" "^27.0.4" "@jest/test-result" "^27.0.2" "@jest/types" "^27.0.2" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.4" import-local "^3.0.2" - jest-config "^27.0.3" + jest-config "^27.0.4" jest-util "^27.0.2" jest-validate "^27.0.2" prompts "^2.0.1" yargs "^16.0.3" -jest-config@^27.0.3: - version "27.0.3" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.0.3.tgz#31871583573c6d669dcdb5bb2d1a8738f3b91c20" - integrity sha512-zgtI2YQo+ekKsmYNyDlXFY/7w7WWBSJFoj/WRe173WB88CDUrEYWr0sLdbLOQe+sRu6l1Y2S0MCS6BOJm5jkoA== +jest-config@^27.0.4: + version "27.0.4" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.0.4.tgz#c4f41378acf40ca77860fb4e213b12109d87b8cf" + integrity sha512-VkQFAHWnPQefdvHU9A+G3H/Z3NrrTKqWpvxgQz3nkUdkDTWeKJE6e//BL+R7z79dXOMVksYgM/z6ndtN0hfChg== dependencies: "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^27.0.3" + "@jest/test-sequencer" "^27.0.4" "@jest/types" "^27.0.2" babel-jest "^27.0.2" chalk "^4.0.0" @@ -8611,14 +8611,14 @@ jest-config@^27.0.3: glob "^7.1.1" graceful-fs "^4.2.4" is-ci "^3.0.0" - jest-circus "^27.0.3" + jest-circus "^27.0.4" jest-environment-jsdom "^27.0.3" jest-environment-node "^27.0.3" jest-get-type "^27.0.1" - jest-jasmine2 "^27.0.3" + jest-jasmine2 "^27.0.4" jest-regex-util "^27.0.1" - jest-resolve "^27.0.2" - jest-runner "^27.0.3" + jest-resolve "^27.0.4" + jest-runner "^27.0.4" jest-util "^27.0.2" jest-validate "^27.0.2" micromatch "^4.0.4" @@ -8702,10 +8702,10 @@ jest-haste-map@^27.0.2: optionalDependencies: fsevents "^2.3.2" -jest-jasmine2@^27.0.3: - version "27.0.3" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.0.3.tgz#fa6f6499566ea1b01b68b3ad13f49d1592b02c85" - integrity sha512-odJ2ia8P5c+IsqOcWJPmku4AqbXIfTVLRjYTKHri3TEvbmTdLw0ghy13OAPIl/0v7cVH0TURK7+xFOHKDLvKIA== +jest-jasmine2@^27.0.4: + version "27.0.4" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.0.4.tgz#c669519ccf4904a485338555e1e66cad36bb0670" + integrity sha512-yj3WrjjquZwkJw+eA4c9yucHw4/+EHndHWSqgHbHGQfT94ihaaQsa009j1a0puU8CNxPDk0c1oAPeOpdJUElwA== dependencies: "@babel/traverse" "^7.1.0" "@jest/environment" "^27.0.3" @@ -8720,8 +8720,8 @@ jest-jasmine2@^27.0.3: jest-each "^27.0.2" jest-matcher-utils "^27.0.2" jest-message-util "^27.0.2" - jest-runtime "^27.0.3" - jest-snapshot "^27.0.2" + jest-runtime "^27.0.4" + jest-snapshot "^27.0.4" jest-util "^27.0.2" pretty-format "^27.0.2" throat "^6.0.1" @@ -8777,19 +8777,19 @@ jest-regex-util@^27.0.1: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.0.1.tgz#69d4b1bf5b690faa3490113c47486ed85dd45b68" integrity sha512-6nY6QVcpTgEKQy1L41P4pr3aOddneK17kn3HJw6SdwGiKfgCGTvH02hVXL0GU8GEKtPH83eD2DIDgxHXOxVohQ== -jest-resolve-dependencies@^27.0.3: - version "27.0.3" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.0.3.tgz#7e258f7d0458bb910855f8a50f5c1e9d92c319dc" - integrity sha512-HdjWOvFAgT5CYChF2eiBN2rRKicjaTCCtA3EtH47REIdGzEHGUhYrWYgLahXsiOovvWN6edhcHL5WCa3gbc04A== +jest-resolve-dependencies@^27.0.4: + version "27.0.4" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.0.4.tgz#a07a242d70d668afd3fcf7f4270755eebb1fe579" + integrity sha512-F33UPfw1YGWCV2uxJl7wD6TvcQn5IC0LtguwY3r4L7R6H4twpLkp5Q2ZfzRx9A2I3G8feiy0O0sqcn/Qoym71A== dependencies: "@jest/types" "^27.0.2" jest-regex-util "^27.0.1" - jest-snapshot "^27.0.2" + jest-snapshot "^27.0.4" -jest-resolve@^27.0.2: - version "27.0.2" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.0.2.tgz#087a3ed17182722a3415f92bfacc99c49cf8a965" - integrity sha512-rmfLGyZhwAUR5z3EwPAW7LQTorWAuCYCcsQJoQxT2it+BOgX3zKxa67r1pfpK3ihy2k9TjYD3/lMp5rPm/CL1Q== +jest-resolve@^27.0.4: + version "27.0.4" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.0.4.tgz#8a27bc3f2f00c8ea28f3bc99bbf6f468300a703d" + integrity sha512-BcfyK2i3cG79PDb/6gB6zFeFQlcqLsQjGBqznFCpA0L/3l1L/oOsltdUjs5eISAWA9HS9qtj8v2PSZr/yWxONQ== dependencies: "@jest/types" "^27.0.2" chalk "^4.0.0" @@ -8801,10 +8801,10 @@ jest-resolve@^27.0.2: resolve "^1.20.0" slash "^3.0.0" -jest-runner@^27.0.3: - version "27.0.3" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.0.3.tgz#d9747af3bee5a6ffaeb9e10b653263b780258b54" - integrity sha512-zH23uIIh1ro1JCD7XX1bQ0bQwXEsBzLX2UJVE/AVLsk4YJRmTfyXIzzRzBWRdnMHHg1NWkJ4fGs7eFP15IqZpQ== +jest-runner@^27.0.4: + version "27.0.4" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.0.4.tgz#2787170a9509b792ae129794f6944d27d5d12a4f" + integrity sha512-NfmvSYLCsCJk2AG8Ar2NAh4PhsJJpO+/r+g4bKR5L/5jFzx/indUpnVBdrfDvuqhGLLAvrKJ9FM/Nt8o1dsqxg== dependencies: "@jest/console" "^27.0.2" "@jest/environment" "^27.0.3" @@ -8817,20 +8817,22 @@ jest-runner@^27.0.3: exit "^0.1.2" graceful-fs "^4.2.4" jest-docblock "^27.0.1" + jest-environment-jsdom "^27.0.3" + jest-environment-node "^27.0.3" jest-haste-map "^27.0.2" jest-leak-detector "^27.0.2" jest-message-util "^27.0.2" - jest-resolve "^27.0.2" - jest-runtime "^27.0.3" + jest-resolve "^27.0.4" + jest-runtime "^27.0.4" jest-util "^27.0.2" jest-worker "^27.0.2" source-map-support "^0.5.6" throat "^6.0.1" -jest-runtime@^27.0.3: - version "27.0.3" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.0.3.tgz#32499c1047e5d953cfbb67fe790ab0167a614d28" - integrity sha512-k1Hl2pWWHBkSXdCggX2lyLRuDnnnmMlnJd+DPLb8LmmAeHW87WgGC6TplD377VxY3KQu73sklkhGUIdwFgsRVQ== +jest-runtime@^27.0.4: + version "27.0.4" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.0.4.tgz#2e4a6aa77cac32ac612dfe12768387a8aa15c2f0" + integrity sha512-voJB4xbAjS/qYPboV+e+gmg3jfvHJJY4CagFWBOM9dQKtlaiTjcpD2tWwla84Z7PtXSQPeIpXY0qksA9Dum29A== dependencies: "@jest/console" "^27.0.2" "@jest/environment" "^27.0.3" @@ -8851,8 +8853,8 @@ jest-runtime@^27.0.3: jest-message-util "^27.0.2" jest-mock "^27.0.3" jest-regex-util "^27.0.1" - jest-resolve "^27.0.2" - jest-snapshot "^27.0.2" + jest-resolve "^27.0.4" + jest-snapshot "^27.0.4" jest-util "^27.0.2" jest-validate "^27.0.2" slash "^3.0.0" @@ -8867,10 +8869,10 @@ jest-serializer@^27.0.1: "@types/node" "*" graceful-fs "^4.2.4" -jest-snapshot@^27.0.2: - version "27.0.2" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.0.2.tgz#40c48dc6afd3cbc5d3d07c061f20fc10d94ca0cd" - integrity sha512-4RcgvZbPrrbEE/hT6XQ4hr+NVVLNrmsgUnYSnZRT6UAvW9Q2yzGMS+tfJh+xlQJAapnnkNJzsMn6vUa+yfiVHA== +jest-snapshot@^27.0.4: + version "27.0.4" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.0.4.tgz#2b96e22ca90382b3e93bd0aae2ce4c78bf51fb5b" + integrity sha512-hnjrvpKGdSMvKfbHyaG5Kul7pDJGZvjVy0CKpzhu28MmAssDXS6GpynhXzgst1wBQoKD8c9b2VS2a5yhDLQRCA== dependencies: "@babel/core" "^7.7.2" "@babel/generator" "^7.7.2" @@ -8891,7 +8893,7 @@ jest-snapshot@^27.0.2: jest-haste-map "^27.0.2" jest-matcher-utils "^27.0.2" jest-message-util "^27.0.2" - jest-resolve "^27.0.2" + jest-resolve "^27.0.4" jest-util "^27.0.2" natural-compare "^1.4.0" pretty-format "^27.0.2" @@ -8943,14 +8945,14 @@ jest-worker@^27.0.2: merge-stream "^2.0.0" supports-color "^8.0.0" -jest@27.0.3: - version "27.0.3" - resolved "https://registry.yarnpkg.com/jest/-/jest-27.0.3.tgz#0b4ac738c93612f778d58250aee026220487e5a4" - integrity sha512-0G9+QqXFIZWgf5rs3yllpaA+13ZawVHfyuhuCV1EnoFbX++rVMRrYWCAnk+dfhwyv9/VTQvn+XG969u8aPRsBg== +jest@27.0.4: + version "27.0.4" + resolved "https://registry.yarnpkg.com/jest/-/jest-27.0.4.tgz#91d4d564b36bcf93b98dac1ab19f07089e670f53" + integrity sha512-Px1iKFooXgGSkk1H8dJxxBIrM3tsc5SIuI4kfKYK2J+4rvCvPGr/cXktxh0e9zIPQ5g09kOMNfHQEmusBUf/ZA== dependencies: - "@jest/core" "^27.0.3" + "@jest/core" "^27.0.4" import-local "^3.0.2" - jest-cli "^27.0.3" + jest-cli "^27.0.4" joi@^17.3.0: version "17.3.0" From 7802cf619f79aa552e222487abcaba18c90f7091 Mon Sep 17 00:00:00 2001 From: renovate Date: Thu, 3 Jun 2021 09:15:34 +0000 Subject: [PATCH 02/13] Update dependency sass to v1.34.1 (#534) Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/534 Co-authored-by: renovate Co-committed-by: renovate --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 0f75e9f18..634ead0bf 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "lodash": "4.17.21", "marked": "2.0.7", "register-service-worker": "1.7.2", - "sass": "1.34.0", + "sass": "1.34.1", "snake-case": "3.0.4", "verte": "0.0.12", "vue": "2.6.13", diff --git a/yarn.lock b/yarn.lock index 5ca4936ed..2e868c04a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11978,10 +11978,10 @@ sass-loader@10.2.0: schema-utils "^3.0.0" semver "^7.3.2" -sass@1.34.0: - version "1.34.0" - resolved "https://registry.yarnpkg.com/sass/-/sass-1.34.0.tgz#e46d5932d8b0ecc4feb846d861f26a578f7f7172" - integrity sha512-rHEN0BscqjUYuomUEaqq3BMgsXqQfkcMVR7UhscsAVub0/spUrZGBMxQXFS2kfiDsPLZw5yuU9iJEFNC2x38Qw== +sass@1.34.1: + version "1.34.1" + resolved "https://registry.yarnpkg.com/sass/-/sass-1.34.1.tgz#30f45c606c483d47b634f1e7371e13ff773c96ef" + integrity sha512-scLA7EIZM+MmYlej6sdVr0HRbZX5caX5ofDT9asWnUJj21oqgsC+1LuNfm0eg+vM0fCTZHhwImTiCU0sx9h9CQ== dependencies: chokidar ">=3.0.0 <4.0.0" From 0f42ed3cf71c59a8aa131e1ee4c58ab06d952e3f Mon Sep 17 00:00:00 2001 From: kolaente Date: Thu, 3 Jun 2021 14:20:26 +0200 Subject: [PATCH 03/13] Add filters for quick action bar --- .../quick-actions/quick-actions.vue | 88 +++++++++++++++++-- 1 file changed, 80 insertions(+), 8 deletions(-) diff --git a/src/components/quick-actions/quick-actions.vue b/src/components/quick-actions/quick-actions.vue index 9742fb354..02279db4f 100644 --- a/src/components/quick-actions/quick-actions.vue +++ b/src/components/quick-actions/quick-actions.vue @@ -20,7 +20,7 @@ /> -
+
{{ hintText }}
@@ -72,6 +72,11 @@ const CMD_NEW_LIST = 'newList' const CMD_NEW_NAMESPACE = 'newNamespace' const CMD_NEW_TEAM = 'newTeam' +const SEARCH_MODE_ALL = 'all' +const SEARCH_MODE_TASKS = 'tasks' +const SEARCH_MODE_LISTS = 'lists' +const SEARCH_MODE_TEAMS = 'teams' + export default { name: 'quick-actions', data() { @@ -84,6 +89,7 @@ export default { taskService: null, foundTeams: [], + teamSearchTimeout: null, teamService: null, namespaceService: null, @@ -99,9 +105,17 @@ export default { return active }, results() { - const lists = (Object.values(this.$store.state.lists).filter(l => { - return l.title.toLowerCase().includes(this.query.toLowerCase()) - }) ?? []) + let lists = [] + if (this.searchMode === SEARCH_MODE_ALL || this.searchMode === SEARCH_MODE_LISTS) { + let query = this.query + if (this.searchMode === SEARCH_MODE_LISTS) { + query = query.substr(1) + } + + lists = (Object.values(this.$store.state.lists).filter(l => { + return l.title.toLowerCase().includes(query.toLowerCase()) + }) ?? []) + } const cmds = this.availableCmds .filter(a => a.title.toLowerCase().includes(this.query.toLowerCase())) @@ -167,7 +181,7 @@ export default { } } - return '' + return 'You can use # to only seach for tasks, * to only search for lists and @ to only search for teams.' }, currentList() { return Object.keys(this.$store.state[CURRENT_LIST]).length === 0 ? null : this.$store.state[CURRENT_LIST] @@ -196,6 +210,23 @@ export default { return cmds }, + searchMode() { + if (this.query === '') { + return SEARCH_MODE_ALL + } + + if (this.query.startsWith('#')) { + return SEARCH_MODE_TASKS + } + if (this.query.startsWith('*')) { + return SEARCH_MODE_LISTS + } + if (this.query.startsWith('@')) { + return SEARCH_MODE_TEAMS + } + + return SEARCH_MODE_ALL + }, }, created() { this.taskService = new TaskService() @@ -206,9 +237,20 @@ export default { methods: { search() { this.searchTasks() + this.searchTeams() }, searchTasks() { - if (this.query === '' || this.selectedCmd !== null) { + if (this.searchMode !== SEARCH_MODE_ALL && this.searchMode !== SEARCH_MODE_TASKS) { + this.foundTasks = [] + return + } + + let query = this.query + if (this.searchMode === SEARCH_MODE_TASKS) { + query = query.substr(1) + } + + if (query === '' || this.selectedCmd !== null) { return } @@ -218,7 +260,7 @@ export default { } this.taskSearchTimeout = setTimeout(() => { - this.taskService.getAll({}, {s: this.query}) + this.taskService.getAll({}, {s: query}) .then(r => { r = r.map(t => { t.type = TYPE_TASK @@ -233,6 +275,37 @@ export default { }) }, 150) }, + searchTeams() { + if (this.searchMode !== SEARCH_MODE_ALL && this.searchMode !== SEARCH_MODE_TEAMS) { + this.foundTeams = [] + return + } + + let query = this.query + if (this.searchMode === SEARCH_MODE_TEAMS) { + query = query.substr(1) + } + + if (query === '' || this.selectedCmd !== null) { + return + } + + if (this.teamSearchTimeout !== null) { + clearTimeout(this.teamSearchTimeout) + this.teamSearchTimeout = null + } + + this.teamSearchTimeout = setTimeout(() => { + this.teamService.getAll({}, {s: query}) + .then(r => { + r = r.map(t => { + t.title = t.name + return t + }) + this.$set(this, 'foundTeams', r) + }) + }, 150) + }, closeQuickActions() { this.$store.commit(QUICK_ACTIONS_ACTIVE, false) }, @@ -321,7 +394,6 @@ export default { .then(r => { this.$store.commit('namespaces/addNamespace', r) this.success({message: 'The namespace was successfully created.'}, this) - this.$router.back() this.closeQuickActions() }) .catch((e) => { From 4a3b4982ab631a38c067ce7d4747077d76133d8d Mon Sep 17 00:00:00 2001 From: kolaente Date: Thu, 3 Jun 2021 15:31:39 +0200 Subject: [PATCH 04/13] Fix saving showing archived setting --- cypress/integration/list/namespaces.spec.js | 45 ++++++++++++++++++++- cypress/support/factory.js | 4 +- cypress/support/seed.js | 6 +-- src/views/namespaces/ListNamespaces.vue | 4 +- 4 files changed, 51 insertions(+), 8 deletions(-) diff --git a/cypress/integration/list/namespaces.spec.js b/cypress/integration/list/namespaces.spec.js index dbdba9156..9d3125b59 100644 --- a/cypress/integration/list/namespaces.spec.js +++ b/cypress/integration/list/namespaces.spec.js @@ -3,7 +3,6 @@ import {UserFactory} from '../../factories/user' import '../../support/authenticateUser' import {ListFactory} from '../../factories/list' import {NamespaceFactory} from '../../factories/namespace' -import {TaskFactory} from '../../factories/task' describe('Namepaces', () => { let namespaces @@ -99,4 +98,48 @@ describe('Namepaces', () => { cy.get('.namespace-container .menu.namespaces-lists') .should('not.contain', newNamespaces[0].title) }) + + it('Should not show archived lists & namespaces if the filter is not checked', () => { + const n = NamespaceFactory.create(1, { + id: 2, + is_archived: true, + }, false) + ListFactory.create(1, { + id: 2, + namespace_id: n[0].id, + }, false) + + ListFactory.create(1, { + id: 3, + is_archived: true, + }, false) + + // Initial + cy.visit('/namespaces') + cy.get('.namespaces-list .namespace') + .should('not.contain', 'Archived') + + // Show archived + cy.get('.namespaces-list .fancycheckbox.show-archived-check label.check span') + .should('be.visible') + .click() + cy.get('.namespaces-list .fancycheckbox.show-archived-check input') + .should('be.checked') + cy.get('.namespaces-list .namespace') + .should('contain', 'Archived') + + // Don't show archived + cy.get('.namespaces-list .fancycheckbox.show-archived-check label.check span') + .should('be.visible') + .click() + cy.get('.namespaces-list .fancycheckbox.show-archived-check input') + .should('not.be.checked') + + // Second time visiting after unchecking + cy.visit('/namespaces') + cy.get('.namespaces-list .fancycheckbox.show-archived-check input') + .should('not.be.checked') + cy.get('.namespaces-list .namespace') + .should('not.contain', 'Archived') + }) }) diff --git a/cypress/support/factory.js b/cypress/support/factory.js index 638464761..0c50bf8fc 100644 --- a/cypress/support/factory.js +++ b/cypress/support/factory.js @@ -21,7 +21,7 @@ export class Factory { * @param override * @returns {[]} */ - static create(count = 1, override = {}) { + static create(count = 1, override = {}, truncate = true) { const data = [] for (let i = 1; i <= count; i++) { @@ -38,7 +38,7 @@ export class Factory { data.push(entry) } - seed(this.table, data) + seed(this.table, data, truncate) return data } diff --git a/cypress/support/seed.js b/cypress/support/seed.js index acb1b2df4..d86152e2b 100644 --- a/cypress/support/seed.js +++ b/cypress/support/seed.js @@ -8,14 +8,14 @@ * @param table * @param data */ -export function seed(table, data = {}) { - if(data === null) { +export function seed(table, data = {}, truncate = true) { + if (data === null) { data = [] } cy.request({ method: 'PATCH', - url: `${Cypress.env('API_URL')}/test/${table}`, + url: `${Cypress.env('API_URL')}/test/${table}?truncate=${truncate ? 'true' : 'false'}`, headers: { 'Authorization': Cypress.env('TEST_SECRET'), }, diff --git a/src/views/namespaces/ListNamespaces.vue b/src/views/namespaces/ListNamespaces.vue index 85397e9f5..7edf311c6 100644 --- a/src/views/namespaces/ListNamespaces.vue +++ b/src/views/namespaces/ListNamespaces.vue @@ -108,7 +108,7 @@ export default { } }, created() { - this.showArchived = localStorage.getItem('showArchived') ?? false + this.showArchived = JSON.parse(localStorage.getItem('showArchived')) ?? false this.loadBackgroundsForLists() }, mounted() { @@ -147,7 +147,7 @@ export default { .catch(e => this.error(e, this)) }, saveShowArchivedState() { - localStorage.setItem('showArchived', this.showArchived) + localStorage.setItem('showArchived', JSON.stringify(this.showArchived)) }, }, } From c92062b6a54e7d2d76301e8d2c28ff84a9fe9251 Mon Sep 17 00:00:00 2001 From: kolaente Date: Thu, 3 Jun 2021 15:38:46 +0200 Subject: [PATCH 05/13] Fix list archived notification mobile layout --- src/styles/components/list.scss | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/src/styles/components/list.scss b/src/styles/components/list.scss index 19b3992e7..17a3d3aa5 100644 --- a/src/styles/components/list.scss +++ b/src/styles/components/list.scss @@ -152,23 +152,6 @@ $filter-container-top-link-share-list: -47px; margin-top: $filter-container-top-default; } -.is-archived { - $notification-height: 1.25rem + 1.25rem + 1.5rem + 1.5rem; - - .filter-container { - margin-top: calc(#{$filter-container-top-default} - #{$notification-height}); - } - - .link-share-container .gantt-chart-container .filter-container, - .gantt-chart-container .filter-container { - margin-top: calc(#{$filter-container-top-link-share-gantt} - 2rem - #{$notification-height}); - } - - .link-share-container .list-view .filter-container { - margin-top: calc(#{$filter-container-top-link-share-list} - #{$notification-height}); - } - - .link-share-container .filter-container { - margin-top: calc(#{$filter-container-top-default} - #{$notification-height}); - } +.is-archived .notification.is-warning { + margin-bottom: 1rem; } From 0cd9d43a7c939b58340c909ee0bcadb300edfd57 Mon Sep 17 00:00:00 2001 From: kolaente Date: Thu, 3 Jun 2021 16:27:41 +0200 Subject: [PATCH 06/13] Fix showing edit buttons when the user does not have the rights to use them --- src/components/input/editor.vue | 6 ++++-- src/services/abstractService.js | 3 +-- src/styles/components/task.scss | 4 ++++ src/views/list/views/Kanban.vue | 2 +- src/views/tasks/TaskDetailView.vue | 7 +++++-- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/components/input/editor.vue b/src/components/input/editor.vue index d016466d3..0334bac6b 100644 --- a/src/components/input/editor.vue +++ b/src/components/input/editor.vue @@ -34,11 +34,13 @@

{{ emptyText }} - Edit. +

    -