From 7a9060894ae105cf45c250ec7450c291216c8839 Mon Sep 17 00:00:00 2001 From: Christian Zosel Date: Wed, 25 Aug 2021 10:48:54 +0200 Subject: [PATCH 1/5] feat: add option "emailAsUsername" --- addon/components/data-table.js | 6 +- addon/controllers/users/edit/index.js | 10 +- addon/controllers/users/index.js | 10 +- addon/engine.js | 2 +- addon/services/emeis-options.js | 3 + addon/templates/users/edit/index.hbs | 22 +- addon/templates/users/index.hbs | 32 ++- app/services/emeis-options.js | 1 + config/environment.js | 8 - tests/dummy/app/app.js | 8 +- tests/dummy/app/services/emeis-options.js | 6 + tests/dummy/config/environment.js | 3 - tests/unit/services/emeis-options-test.js | 12 ++ yarn.lock | 233 +++++++++++++--------- 14 files changed, 223 insertions(+), 133 deletions(-) create mode 100644 addon/services/emeis-options.js create mode 100644 app/services/emeis-options.js create mode 100644 tests/dummy/app/services/emeis-options.js create mode 100644 tests/unit/services/emeis-options-test.js diff --git a/addon/components/data-table.js b/addon/components/data-table.js index 56f7cba9..4606167a 100644 --- a/addon/components/data-table.js +++ b/addon/components/data-table.js @@ -1,4 +1,3 @@ -import { getOwner } from "@ember/application"; import { assert } from "@ember/debug"; import { action } from "@ember/object"; import { inject as service } from "@ember/service"; @@ -9,6 +8,7 @@ import { task, lastValue } from "ember-concurrency"; export default class DataTableComponent extends Component { @service store; @service router; + @service emeisOptions; @tracked numPages; @tracked internalSearch; @@ -62,12 +62,10 @@ export default class DataTableComponent extends Component { typeof this.args.modelName === "string" ); - const ENV = getOwner(this).resolveRegistration("config:environment"); - const options = { page: { number: this.page, - size: ENV["ember-emeis"].pageSize, + size: this.emeisOptions.pageSize, }, filter: { search: this.search, ...(this.args.filter || {}) }, include: this.args.include || "", diff --git a/addon/controllers/users/edit/index.js b/addon/controllers/users/edit/index.js index c9343a11..3f72a36f 100644 --- a/addon/controllers/users/edit/index.js +++ b/addon/controllers/users/edit/index.js @@ -4,10 +4,10 @@ import { inject as service } from "@ember/service"; export default class UsersEditIndexController extends Controller { @service intl; + @service emeisOptions; @action updateModel(model, formElements) { - model.username = formElements.username.value; model.firstName = formElements.firstName.value; model.lastName = formElements.lastName.value; model.email = formElements.email.value; @@ -18,6 +18,14 @@ export default class UsersEditIndexController extends Controller { model.zip = formElements.zip.value; model.isActive = formElements.isActive.checked; + model.username = this.emailAsUsername + ? formElements.email.value + : formElements.username.value; + return model; } + + get emailAsUsername() { + return this.emeisOptions.emailAsUsername; + } } diff --git a/addon/controllers/users/index.js b/addon/controllers/users/index.js index eff1c55b..7225ff98 100644 --- a/addon/controllers/users/index.js +++ b/addon/controllers/users/index.js @@ -1,3 +1,11 @@ +import { inject as service } from "@ember/service"; + import PaginationController from "ember-emeis/-private/controllers/pagination"; -export default class UsersIndexController extends PaginationController {} +export default class UsersIndexController extends PaginationController { + @service emeisOptions; + + get emailAsUsername() { + return this.emeisOptions.emailAsUsername; + } +} diff --git a/addon/engine.js b/addon/engine.js index e1900722..629edda2 100644 --- a/addon/engine.js +++ b/addon/engine.js @@ -11,7 +11,7 @@ export default class EmberEmeisEngine extends Engine { Resolver = Resolver; dependencies = { - services: ["store", "intl", "notification", "router"], + services: ["store", "intl", "notification", "router", "emeis-options"], }; } diff --git a/addon/services/emeis-options.js b/addon/services/emeis-options.js new file mode 100644 index 00000000..83f27e71 --- /dev/null +++ b/addon/services/emeis-options.js @@ -0,0 +1,3 @@ +import Service from "@ember/service"; + +export default class EmeisOptionsService extends Service {} diff --git a/addon/templates/users/edit/index.hbs b/addon/templates/users/edit/index.hbs index b1e92cfc..5b5540ff 100644 --- a/addon/templates/users/edit/index.hbs +++ b/addon/templates/users/edit/index.hbs @@ -4,16 +4,18 @@ @noDelete={{true}} @listViewRouteName="users.index" > - - - + {{#unless this.emailAsUsername}} + + + + {{/unless}} - - {{t "emeis.users.headings.username"}} - + {{#unless this.emailAsUsername}} + + {{t "emeis.users.headings.username"}} + + {{/unless}} {{t "emeis.users.headings.fullName"}} @@ -19,15 +21,23 @@ {{#let body.model as |user|}} - - - {{user.username}} - - + {{#if this.emailAsUsername}} + + + {{user.fullName}} + + + {{else}} + + + {{user.username}} + + - - {{user.fullName}} - + + {{user.fullName}} + + {{/if}} {{user.email}} diff --git a/app/services/emeis-options.js b/app/services/emeis-options.js new file mode 100644 index 00000000..e7394ef3 --- /dev/null +++ b/app/services/emeis-options.js @@ -0,0 +1 @@ +export { default } from "ember-emeis/services/emeis-options"; diff --git a/config/environment.js b/config/environment.js index a4c8e5ef..f53e9fae 100644 --- a/config/environment.js +++ b/config/environment.js @@ -4,15 +4,7 @@ module.exports = function (environment) { const ENV = { modulePrefix: "ember-emeis", environment, - - "ember-emeis": { - pageSize: 25, - }, }; - if (environment === "test") { - ENV["ember-emeis"].pageSize = 10; - } - return ENV; }; diff --git a/tests/dummy/app/app.js b/tests/dummy/app/app.js index 77f20480..4449f8fd 100644 --- a/tests/dummy/app/app.js +++ b/tests/dummy/app/app.js @@ -15,7 +15,13 @@ export default class App extends Application { this.engines = { emberEmeis: { dependencies: { - services: ["store", "intl", "notification", "router"], + services: [ + "store", + "intl", + "notification", + "router", + "emeis-options", + ], }, }, }; diff --git a/tests/dummy/app/services/emeis-options.js b/tests/dummy/app/services/emeis-options.js new file mode 100644 index 00000000..0b15aa0a --- /dev/null +++ b/tests/dummy/app/services/emeis-options.js @@ -0,0 +1,6 @@ +import Service from "@ember/service"; + +export default class EmeisOptionsService extends Service { + emailAsUsername = false; + pageSize = 10; +} diff --git a/tests/dummy/config/environment.js b/tests/dummy/config/environment.js index f8473f8c..bb5874ad 100644 --- a/tests/dummy/config/environment.js +++ b/tests/dummy/config/environment.js @@ -21,9 +21,6 @@ module.exports = function (environment) { // Here you can pass flags/options to your application instance // when it is created }, - "ember-emeis": { - pageSize: 10, - }, }; if (environment === "development") { diff --git a/tests/unit/services/emeis-options-test.js b/tests/unit/services/emeis-options-test.js new file mode 100644 index 00000000..c90d090f --- /dev/null +++ b/tests/unit/services/emeis-options-test.js @@ -0,0 +1,12 @@ +import { module, test } from "qunit"; +import { setupTest } from "ember-qunit"; + +module("Unit | Service | emeis-options", function (hooks) { + setupTest(hooks); + + // TODO: Replace this with your real tests. + test("it exists", function (assert) { + let service = this.owner.lookup("service:emeis-options"); + assert.ok(service); + }); +}); diff --git a/yarn.lock b/yarn.lock index 9002fcfc..9f565cf4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1610,11 +1610,6 @@ dependencies: tslib "^2.1.0" -"@gar/promisify@^1.0.1": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.2.tgz#30aa825f11d438671d585bd44e7fd564535fc210" - integrity sha512-82cpyJyKRoQoRi+14ibCeGPu0CwypgtBAdBhq1WfvagpCZNKqwXbKwXllYSMG91DhmG4jt9gN8eP6lGOtozuaw== - "@glimmer/component@1.0.4", "@glimmer/component@^1.0.2", "@glimmer/component@^1.0.4": version "1.0.4" resolved "https://registry.yarnpkg.com/@glimmer/component/-/component-1.0.4.tgz#1c85a5181615a6647f6acfaaed68e28ad7e9626e" @@ -1913,14 +1908,6 @@ dependencies: ansi-styles "^4.3.0" -"@npmcli/fs@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@npmcli/fs/-/fs-1.0.0.tgz#589612cfad3a6ea0feafcb901d29c63fd52db09f" - integrity sha512-8ltnOpRR/oJbOp8vaGUnipOi3bqkcW+sLHFlyXIr08OGHmVJLB1Hn7QtGXbYcpVtH1gAYZTlmDXtE4YV0+AMMQ== - dependencies: - "@gar/promisify" "^1.0.1" - semver "^7.3.5" - "@npmcli/git@^2.0.7", "@npmcli/git@^2.1.0": version "2.1.0" resolved "https://registry.yarnpkg.com/@npmcli/git/-/git-2.1.0.tgz#2fbd77e147530247d37f325930d457b3ebe894f6" @@ -2034,9 +2021,9 @@ universal-user-agent "^6.0.0" "@octokit/graphql@^4.5.8": - version "4.7.0" - resolved "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-4.7.0.tgz#cbe12edc2bc61e9eaa5f9e5d092644c92b6fcb74" - integrity sha512-diY0qMPyQjfu4rDu3kDhJ9qIZadIm4IISO3RJSv9ajYUWJUCO0AykbgzLcg1xclxtXgzY583u3gAv66M6zz5SA== + version "4.6.4" + resolved "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-4.6.4.tgz#0c3f5bed440822182e972317122acb65d311a5ed" + integrity sha512-SWTdXsVheRmlotWNjKzPOb6Js6tjSqA2a8z9+glDJng0Aqjzti8MEWOtuT8ZSu6wHnci7LZNuarE87+WJBG4vg== dependencies: "@octokit/request" "^5.6.0" "@octokit/types" "^6.0.3" @@ -2313,12 +2300,12 @@ dependencies: "@types/node" "*" -"@types/cookie@^0.4.1": +"@types/cookie@^0.4.0": version "0.4.1" resolved "https://registry.yarnpkg.com/@types/cookie/-/cookie-0.4.1.tgz#bfd02c1f2224567676c1545199f87c3a861d878d" integrity sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q== -"@types/cors@^2.8.12": +"@types/cors@^2.8.10": version "2.8.12" resolved "https://registry.yarnpkg.com/@types/cors/-/cors-2.8.12.tgz#6b2c510a7ad7039e98e7b8d3d6598f4359e5c080" integrity sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw== @@ -2403,9 +2390,9 @@ integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== "@types/node@*", "@types/node@>=10.0.0": - version "16.7.6" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.7.6.tgz#8666478db8095aa66e25b7e469f3e7b53ea2855e" - integrity sha512-VESVNFoa/ahYA62xnLBjo5ur6gPsgEE5cNRy8SrdnkZ2nwJSW0kJ4ufbFr2zuU9ALtHM8juY53VcRoTA7htXSg== + version "16.7.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.7.2.tgz#0465a39b5456b61a04d98bd5545f8b34be340cb7" + integrity sha512-TbG4TOx9hng8FKxaVrCisdaxKxqEwJ3zwHoCWXZ0Jw6mnvTInpaB99/2Cy4+XxpXtjNv9/TgfGSvZFyfV/t8Fw== "@types/normalize-package-data@^2.4.0": version "2.4.1" @@ -2604,9 +2591,9 @@ "@xtuc/long" "4.2.2" "@xmldom/xmldom@^0.7.1": - version "0.7.3" - resolved "https://registry.yarnpkg.com/@xmldom/xmldom/-/xmldom-0.7.3.tgz#55de695f77afd3cc0e5bee0aa900040bc63c0f63" - integrity sha512-8XmJdPut2XGtfFcsNsqEsvMUmAwk7xLq7m+E/GcsU9b5qyFFIsiX4Fvnb5UoQ4wo12Wlm07YFJERoyWUYdbIpw== + version "0.7.2" + resolved "https://registry.yarnpkg.com/@xmldom/xmldom/-/xmldom-0.7.2.tgz#d920079e66806b2626b5311955f6a7c4bed1cba8" + integrity sha512-t/Zqo0ewes3iq6zGqEqJNUWI27Acr3jkmSUNp6E3nl0Z2XbtqAG5XYqPNLdYonILmhcxANsIidh69tHzjXtuRg== "@xtuc/ieee754@^1.2.0": version "1.2.0" @@ -4915,12 +4902,11 @@ cacache@^12.0.0, cacache@^12.0.2, cacache@^12.0.3: unique-filename "^1.1.1" y18n "^4.0.0" -cacache@^15.0.3, cacache@^15.0.5, cacache@^15.2.0, cacache@^15.3.0: - version "15.3.0" - resolved "https://registry.yarnpkg.com/cacache/-/cacache-15.3.0.tgz#dc85380fb2f556fe3dda4c719bfa0ec875a7f1eb" - integrity sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ== +cacache@^15.0.3, cacache@^15.0.5, cacache@^15.2.0: + version "15.2.0" + resolved "https://registry.yarnpkg.com/cacache/-/cacache-15.2.0.tgz#73af75f77c58e72d8c630a7a2858cb18ef523389" + integrity sha512-uKoJSHmnrqXgthDFx/IU6ED/5xd+NNGe+Bb+kLZy7Ku4P+BaiWEUflAKPZ7eAzsYGcsAGASJZsybXp+quEcHTw== dependencies: - "@npmcli/fs" "^1.0.0" "@npmcli/move-file" "^1.0.1" chownr "^2.0.0" fs-minipass "^2.0.0" @@ -5727,9 +5713,9 @@ copy-descriptor@^0.1.0: integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= core-js-compat@^3.14.0, core-js-compat@^3.16.0: - version "3.16.4" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.16.4.tgz#cf28abe0e45a43645b04b2c1a073efa03d0b3b26" - integrity sha512-IzCSomxRdahCYb6G3HiN6pl3JCiM0NMunRcNa1pIeC7g17Vd6Ue3AT9anQiENPIm/svThUVer1pIbLMDERIsFw== + version "3.16.3" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.16.3.tgz#ae12a6e20505a1d79fbd16b6689dfc77fc989114" + integrity sha512-A/OtSfSJQKLAFRVd4V0m6Sep9lPdjD8bpN8v3tCCGwE0Tmh0hOiVDm9tw6mXmWOKOSZIyr3EkywPo84cJjGvIQ== dependencies: browserslist "^4.16.8" semver "7.0.0" @@ -5740,9 +5726,9 @@ core-js@^2.4.0, core-js@^2.5.0, core-js@^2.6.5: integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== core-js@^3.6.1: - version "3.16.4" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.16.4.tgz#0fb1029a554fc2688c0963d7c900e188188a78e0" - integrity sha512-Tq4GVE6XCjE+hcyW6hPy0ofN3hwtLudz5ZRdrlCnsnD/xkm/PWQRudzYHiKgZKUcefV6Q57fhDHjZHJP5dpfSg== + version "3.16.3" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.16.3.tgz#1f2d43c51a9ed014cc6c83440af14697ae4b75f2" + integrity sha512-lM3GftxzHNtPNUJg0v4pC2RC6puwMd6VZA7vXUczi+SKmCWSf4JwO89VJGMqbzmB7jlK7B5hr3S64PqwFL49cA== core-object@^3.1.5: version "3.1.5" @@ -5976,7 +5962,7 @@ debug@3.1.0: dependencies: ms "2.0.0" -debug@4, debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@~4.3.1, debug@~4.3.2: +debug@4, debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@~4.3.1: version "4.3.2" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== @@ -6042,7 +6028,7 @@ defaults@^1.0.3: dependencies: clone "^1.0.2" -define-properties@^1.1.3: +define-properties@^1.1.2, define-properties@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== @@ -6303,9 +6289,9 @@ ee-first@1.1.1: integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= electron-to-chromium@^1.3.47, electron-to-chromium@^1.3.811: - version "1.3.822" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.822.tgz#7036edc7f669b0aa79e9801dc5f56866c6ddc0b2" - integrity sha512-k7jG5oYYHxF4jx6PcqwHX3JVME/OjzolqOZiIogi9xtsfsmTjTdie4x88OakYFPEa8euciTgCCzvVNwvmjHb1Q== + version "1.3.818" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.818.tgz#32ed024fa8316e5d469c96eecbea7d2463d80085" + integrity sha512-c/Z9gIr+jDZAR9q+mn40hEc1NharBT+8ejkarjbCDnBNFviI6hvcC5j2ezkAXru//bTnQp5n6iPi0JA83Tla1Q== elliptic@^6.5.3: version "6.5.4" @@ -7433,16 +7419,16 @@ end-of-stream@^1.0.0, end-of-stream@^1.1.0: once "^1.4.0" engine.io-parser@~4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-4.0.3.tgz#83d3a17acfd4226f19e721bb22a1ee8f7662d2f6" - integrity sha512-xEAAY0msNnESNPc00e19y5heTPX4y/TJ36gr8t1voOaNmTojP9b3oK3BbJLFufW2XFPQaaijpFewm2g2Um3uqA== + version "4.0.2" + resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-4.0.2.tgz#e41d0b3fb66f7bf4a3671d2038a154024edb501e" + integrity sha512-sHfEQv6nmtJrq6TKuIz5kyEKH/qSdK56H/A+7DnAuUPWosnIZAS2NHNcPLmyjtY3cGS/MqJdZbUjW97JU72iYg== dependencies: base64-arraybuffer "0.1.4" -engine.io@~5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-5.2.0.tgz#554cdd0230d89de7b1a49a809d7ee5a129d36809" - integrity sha512-d1DexkQx87IFr1FLuV+0f5kAm1Hk1uOVijLOb+D1sDO2QMb7YjE02VHtZtxo7xIXMgcWLb+vl3HRT0rI9tr4jQ== +engine.io@~5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-5.1.1.tgz#a1f97e51ddf10cbd4db8b5ff4b165aad3760cdd3" + integrity sha512-aMWot7H5aC8L4/T8qMYbLdvKlZOdJTH54FxfdFunTGvhMx1BHkJOntWArsVfgAZVwAO9LC2sryPWRcEeUzCe5w== dependencies: accepts "~1.3.4" base64id "2.0.0" @@ -7537,7 +7523,24 @@ error@^7.0.0: dependencies: string-template "~0.2.1" -es-abstract@^1.17.0-next.0, es-abstract@^1.18.0-next.1, es-abstract@^1.18.0-next.2, es-abstract@^1.18.2: +es-abstract@^1.17.0-next.0: + version "1.17.5" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.5.tgz#d8c9d1d66c8981fb9200e2251d799eee92774ae9" + integrity sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg== + dependencies: + es-to-primitive "^1.2.1" + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.1" + is-callable "^1.1.5" + is-regex "^1.0.5" + object-inspect "^1.7.0" + object-keys "^1.1.1" + object.assign "^4.1.0" + string.prototype.trimleft "^2.1.1" + string.prototype.trimright "^2.1.1" + +es-abstract@^1.18.0-next.1, es-abstract@^1.18.0-next.2, es-abstract@^1.18.2: version "1.18.5" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.5.tgz#9b10de7d4c206a3581fd5b2124233e04db49ae19" integrity sha512-DDggyJLoS91CkJjgauM5c0yZMjiD1uK3KcaCeAmffGwZ+ODWzOkPN4QwRbsK5DOFf06fywmyLci3ZD8jLGhVYA== @@ -8315,9 +8318,9 @@ find-cache-dir@^2.1.0: pkg-dir "^3.0.0" find-cache-dir@^3.3.1: - version "3.3.2" - resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.3.2.tgz#b30c5b6eff0730731aea9bbd9dbecbd80256d64b" - integrity sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig== + version "3.3.1" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.3.1.tgz#89b33fad4a4670daa94f855f7fbe31d6d84fe880" + integrity sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ== dependencies: commondir "^1.0.1" make-dir "^3.0.2" @@ -9202,7 +9205,7 @@ has-symbol-support-x@^1.4.1: resolved "https://registry.yarnpkg.com/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz#1409f98bc00247da45da67cee0a36f282ff26455" integrity sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw== -has-symbols@^1.0.1, has-symbols@^1.0.2: +has-symbols@^1.0.0, has-symbols@^1.0.1, has-symbols@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423" integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== @@ -9852,7 +9855,12 @@ is-buffer@^1.1.5: resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== -is-callable@^1.1.4, is-callable@^1.2.3: +is-callable@^1.1.4, is-callable@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.5.tgz#f7e46b596890456db74e7f6e976cb3273d06faab" + integrity sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q== + +is-callable@^1.2.3: version "1.2.4" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945" integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w== @@ -10103,6 +10111,13 @@ is-redirect@^1.0.0: resolved "https://registry.yarnpkg.com/is-redirect/-/is-redirect-1.0.0.tgz#1d03dded53bd8db0f30c26e4f95d36fc7c87dc24" integrity sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ= +is-regex@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.5.tgz#39d589a358bf18967f726967120b8fc1aed74eae" + integrity sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ== + dependencies: + has "^1.0.3" + is-regex@^1.1.3: version "1.1.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" @@ -11416,7 +11431,7 @@ make-fetch-happen@^5.0.0: socks-proxy-agent "^4.0.0" ssri "^6.0.0" -make-fetch-happen@^9.0.1, make-fetch-happen@^9.1.0: +make-fetch-happen@^9.0.1, make-fetch-happen@^9.0.5: version "9.1.0" resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz#53085a09e7971433e6765f7971bf63f4e05cb968" integrity sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg== @@ -12581,9 +12596,9 @@ npm@^6.14.8: write-file-atomic "^2.4.3" npm@^7.0.0: - version "7.21.1" - resolved "https://registry.yarnpkg.com/npm/-/npm-7.21.1.tgz#2ab886fc8b5eb044ca5b4e2f7570340fad9934eb" - integrity sha512-k7XQNHGHAp0VowMMUMRMtntxWatNad9hhYrelUKDPvZ++DBxvofA8QTNPiuMKtx8CBOFA8iJ4aizhbx6ZYVfzQ== + version "7.21.0" + resolved "https://registry.yarnpkg.com/npm/-/npm-7.21.0.tgz#12af61f27ab6ece10af2b20ffb355fb2ae227fb6" + integrity sha512-OYSQykXItCDXYGb9U8o85Snhmbe0k/nwVK6CmUNmgtOcfPevVB5ZXwA44eWOCvM+WdWYQsJAJoA7eCHKImQt8g== dependencies: "@npmcli/arborist" "^2.8.2" "@npmcli/ci-detect" "^1.2.0" @@ -12595,7 +12610,7 @@ npm@^7.0.0: ansicolors "~0.3.2" ansistyles "~0.1.3" archy "~1.0.0" - cacache "^15.3.0" + cacache "^15.2.0" chalk "^4.1.2" chownr "^2.0.0" cli-columns "^3.1.2" @@ -12620,7 +12635,7 @@ npm@^7.0.0: libnpmsearch "^3.1.1" libnpmteam "^2.0.3" libnpmversion "^1.2.1" - make-fetch-happen "^9.1.0" + make-fetch-happen "^9.0.5" minipass "^3.1.3" minipass-pipeline "^1.2.4" mkdirp "^1.0.4" @@ -12640,13 +12655,13 @@ npm@^7.0.0: parse-conflict-json "^1.1.1" qrcode-terminal "^0.12.0" read "~1.0.7" - read-package-json "^4.0.1" + read-package-json "^4.0.0" read-package-json-fast "^2.0.3" readdir-scoped-modules "^1.1.0" rimraf "^3.0.2" semver "^7.3.5" ssri "^8.0.1" - tar "^6.1.11" + tar "^6.1.10" text-table "~0.2.0" tiny-relative-date "^1.3.0" treeverse "^1.0.4" @@ -12718,7 +12733,12 @@ object-inspect@^1.11.0, object-inspect@^1.9.0: resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.11.0.tgz#9dceb146cedd4148a0d9e51ab88d34cf509922b1" integrity sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg== -object-keys@^1.0.12, object-keys@^1.1.1: +object-inspect@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.7.0.tgz#f4f6bd181ad77f006b5ece60bd0b6f398ff74a67" + integrity sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw== + +object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== @@ -12730,7 +12750,17 @@ object-visit@^1.0.0: dependencies: isobject "^3.0.0" -object.assign@^4.1.0, object.assign@^4.1.2: +object.assign@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" + integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== + dependencies: + define-properties "^1.1.2" + function-bind "^1.1.1" + has-symbols "^1.0.0" + object-keys "^1.0.11" + +object.assign@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940" integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ== @@ -12741,13 +12771,12 @@ object.assign@^4.1.0, object.assign@^4.1.2: object-keys "^1.1.1" object.getownpropertydescriptors@^2.0.3: - version "2.1.2" - resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.2.tgz#1bd63aeacf0d5d2d2f31b5e393b03a7c601a23f7" - integrity sha512-WtxeKSzfBjlzL+F9b7M7hewDzMwy+C8NRssHd1YrNlzHzIDrXcXiNOMrezdAEM4UXixgV+vvnyBeN7Rygl2ttQ== + version "2.1.0" + resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz#369bf1f9592d8ab89d712dced5cb81c7c5352649" + integrity sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg== dependencies: - call-bind "^1.0.2" define-properties "^1.1.3" - es-abstract "^1.18.0-next.2" + es-abstract "^1.17.0-next.1" object.pick@^1.3.0: version "1.3.0" @@ -13813,10 +13842,10 @@ read-package-json-fast@^2.0.1, read-package-json-fast@^2.0.2, read-package-json- normalize-package-data "^2.0.0" npm-normalize-package-bin "^1.0.0" -read-package-json@^4.0.0, read-package-json@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/read-package-json/-/read-package-json-4.0.1.tgz#da88a38c410344fecb7d840d35f27635e848ea54" - integrity sha512-czqCcYfkEl6sIFJVOND/5/Goseu7cVw1rcDUATq6ED0jLGjMm9/HOPmFmEZMvRu9yl272YERaMUcOlvcNU9InQ== +read-package-json@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/read-package-json/-/read-package-json-4.0.0.tgz#b555a9f749bf5eb9b8f053806b32f17001914e90" + integrity sha512-EBQiek1udd0JKvUzaViAWHYVQRuQZ0IP0LWUOqVCJaZIX92ZO86dOpvsTOO3esRIQGgl7JhFBaGqW41VI57KvQ== dependencies: glob "^7.1.1" json-parse-even-better-errors "^2.3.0" @@ -14834,10 +14863,10 @@ snapdragon@^0.8.1: source-map-resolve "^0.5.0" use "^3.1.0" -socket.io-adapter@~2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-2.3.2.tgz#039cd7c71a52abad984a6d57da2c0b7ecdd3c289" - integrity sha512-PBZpxUPYjmoogY0aoaTmo1643JelsaS1CiAwNjRVdrI0X9Seuc19Y2Wife8k88avW6haG8cznvwbubAZwH4Mtg== +socket.io-adapter@~2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-2.3.1.tgz#a442720cb09a4823cfb81287dda1f9b52d4ccdb2" + integrity sha512-8cVkRxI8Nt2wadkY6u60Y4rpW3ejA1rxgcK2JuyIhmF+RMNpTy1QRtkHIDUOf3B4HlQwakMsWbKftMv/71VMmw== socket.io-parser@~4.0.4: version "4.0.4" @@ -14849,18 +14878,18 @@ socket.io-parser@~4.0.4: debug "~4.3.1" socket.io@^4.1.2: - version "4.2.0" - resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-4.2.0.tgz#9e1c09d3ea647e24963a2e7ba8ea5c847778e2ed" - integrity sha512-sjlGfMmnaWvTRVxGRGWyhd9ctpg4APxWAxu85O/SxekkxHhfxmePWZbaYCkeX5QQX0z1YEnKOlNt6w82E4Nzug== + version "4.1.3" + resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-4.1.3.tgz#d114328ef27ab31b889611792959c3fa6d502500" + integrity sha512-tLkaY13RcO4nIRh1K2hT5iuotfTaIQw7cVIe0FUykN3SuQi0cm7ALxuyT5/CtDswOMWUzMGTibxYNx/gU7In+Q== dependencies: - "@types/cookie" "^0.4.1" - "@types/cors" "^2.8.12" + "@types/cookie" "^0.4.0" + "@types/cors" "^2.8.10" "@types/node" ">=10.0.0" accepts "~1.3.4" base64id "~2.0.0" - debug "~4.3.2" - engine.io "~5.2.0" - socket.io-adapter "~2.3.2" + debug "~4.3.1" + engine.io "~5.1.1" + socket.io-adapter "~2.3.1" socket.io-parser "~4.0.4" socks-proxy-agent@^4.0.0: @@ -15272,7 +15301,7 @@ string.prototype.padend@^3.0.0: define-properties "^1.1.3" es-abstract "^1.18.0-next.2" -string.prototype.trimend@^1.0.4: +string.prototype.trimend@^1.0.3, string.prototype.trimend@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz#e75ae90c2942c63504686c18b287b4a0b1a45f80" integrity sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A== @@ -15280,7 +15309,25 @@ string.prototype.trimend@^1.0.4: call-bind "^1.0.2" define-properties "^1.1.3" -string.prototype.trimstart@^1.0.4: +string.prototype.trimleft@^2.1.1: + version "2.1.3" + resolved "https://registry.yarnpkg.com/string.prototype.trimleft/-/string.prototype.trimleft-2.1.3.tgz#dee305118117d0a1843c1fc0d38d5d0754d83c60" + integrity sha512-699Ibssmj/awVzvdNk4g83/Iu8U9vDohzmA/ly2BrQWGhamuY4Tlvs5XKmKliDt3ky6SKbE1bzPhASKCFlx9Sg== + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + string.prototype.trimstart "^1.0.3" + +string.prototype.trimright@^2.1.1: + version "2.1.3" + resolved "https://registry.yarnpkg.com/string.prototype.trimright/-/string.prototype.trimright-2.1.3.tgz#dc16a21d7456cbc8b2c54d47fe01f06d9efe94eb" + integrity sha512-hoOq56oRFnnfDuXNy2lGHiwT77MehHv9d0zGfRZ8QdC+4zjrkFB9vd5i/zYTd/ymFBd4YxtbdgHt3U6ksGeuBw== + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + string.prototype.trimend "^1.0.3" + +string.prototype.trimstart@^1.0.3, string.prototype.trimstart@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz#b36399af4ab2999b4c9c648bd7a3fb2bb26feeed" integrity sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw== @@ -15492,10 +15539,10 @@ tar@^4.4.10, tar@^4.4.12, tar@^4.4.19: safe-buffer "^5.2.1" yallist "^3.1.1" -tar@^6.0.2, tar@^6.1.0, tar@^6.1.11: - version "6.1.11" - resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.11.tgz#6760a38f003afa1b2ffd0ffe9e9abbd0eab3d621" - integrity sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA== +tar@^6.0.2, tar@^6.1.0, tar@^6.1.10: + version "6.1.10" + resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.10.tgz#8a320a74475fba54398fa136cd9883aa8ad11175" + integrity sha512-kvvfiVvjGMxeUNB6MyYv5z7vhfFRwbwCXJAeL0/lnbrttBVqcMOnpHUf0X42LrPMR8mMpgapkJMchFH4FSHzNA== dependencies: chownr "^2.0.0" fs-minipass "^2.0.0" @@ -16647,9 +16694,9 @@ ws@^6.1.0: async-limiter "~1.0.0" ws@^7.4.6: - version "7.5.4" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.4.tgz#56bfa20b167427e138a7795de68d134fe92e21f9" - integrity sha512-zP9z6GXm6zC27YtspwH99T3qTG7bBFv2VIkeHstMLrLlDJuzA7tQ5ls3OJ1hOGGCzTQPniNJoHXIAOS0Jljohg== + version "7.5.3" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.3.tgz#160835b63c7d97bfab418fc1b8a9fced2ac01a74" + integrity sha512-kQ/dHIzuLrS6Je9+uv81ueZomEwH0qVYstcAQ4/Z93K8zeko9gtAbttJWzoC5ukqXY1PpoouV3+VSOqEAFt5wg== ws@~7.4.2: version "7.4.6" From e1e476fdb1112f045a2f2d94280a86f700b8d0a6 Mon Sep 17 00:00:00 2001 From: Christian Zosel Date: Mon, 30 Aug 2021 10:48:15 +0200 Subject: [PATCH 2/5] feat: add config option to hide "additional" user fields --- addon/controllers/users/edit/index.js | 24 ++- addon/templates/users/edit/index.hbs | 120 ++++++----- tests/dummy/app/services/emeis-options.js | 1 + tests/unit/services/emeis-options-test.js | 4 +- yarn.lock | 233 +++++++++------------- 5 files changed, 180 insertions(+), 202 deletions(-) diff --git a/addon/controllers/users/edit/index.js b/addon/controllers/users/edit/index.js index 3f72a36f..ed343808 100644 --- a/addon/controllers/users/edit/index.js +++ b/addon/controllers/users/edit/index.js @@ -11,13 +11,15 @@ export default class UsersEditIndexController extends Controller { model.firstName = formElements.firstName.value; model.lastName = formElements.lastName.value; model.email = formElements.email.value; - model.phone = formElements.phone.value; - model.language = formElements.language.selectedOptions[0].value; - model.address = formElements.address.value; - model.city = formElements.city.value; - model.zip = formElements.zip.value; model.isActive = formElements.isActive.checked; + // additional fields might not be present + model.phone = formElements.phone?.value; + model.language = formElements.language?.selectedOptions[0].value; + model.address = formElements.address?.value; + model.city = formElements.city?.value; + model.zip = formElements.zip?.value; + model.username = this.emailAsUsername ? formElements.email.value : formElements.username.value; @@ -28,4 +30,16 @@ export default class UsersEditIndexController extends Controller { get emailAsUsername() { return this.emeisOptions.emailAsUsername; } + + get additionalUserFields() { + return ( + this.emeisOptions.additionalUserFields || [ + "phone", + "language", + "address", + "city", + "zip", + ] + ); + } } diff --git a/addon/templates/users/edit/index.hbs b/addon/templates/users/edit/index.hbs index 5b5540ff..69bef182 100644 --- a/addon/templates/users/edit/index.hbs +++ b/addon/templates/users/edit/index.hbs @@ -50,67 +50,77 @@ /> - - + {{#if (includes "phone" this.additionalUserFields)}} + + - - {{t "emeis.form.phone-hint"}} - - + + {{t "emeis.form.phone-hint"}} + + + {{/if}} - - + - {{/each}} - - + {{#each this.intl.locales as |language|}} + + {{/each}} + + + {{/if}} - - - + {{#if (includes "address" this.additionalUserFields)}} + + + + {{/if}} - - - + {{#if (includes "city" this.additionalUserFields)}} + + + + {{/if}} - - - + {{#if (includes "zip" this.additionalUserFields)}} + + + + {{/if}} =10.0.0": - version "16.7.2" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.7.2.tgz#0465a39b5456b61a04d98bd5545f8b34be340cb7" - integrity sha512-TbG4TOx9hng8FKxaVrCisdaxKxqEwJ3zwHoCWXZ0Jw6mnvTInpaB99/2Cy4+XxpXtjNv9/TgfGSvZFyfV/t8Fw== + version "16.7.6" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.7.6.tgz#8666478db8095aa66e25b7e469f3e7b53ea2855e" + integrity sha512-VESVNFoa/ahYA62xnLBjo5ur6gPsgEE5cNRy8SrdnkZ2nwJSW0kJ4ufbFr2zuU9ALtHM8juY53VcRoTA7htXSg== "@types/normalize-package-data@^2.4.0": version "2.4.1" @@ -2591,9 +2604,9 @@ "@xtuc/long" "4.2.2" "@xmldom/xmldom@^0.7.1": - version "0.7.2" - resolved "https://registry.yarnpkg.com/@xmldom/xmldom/-/xmldom-0.7.2.tgz#d920079e66806b2626b5311955f6a7c4bed1cba8" - integrity sha512-t/Zqo0ewes3iq6zGqEqJNUWI27Acr3jkmSUNp6E3nl0Z2XbtqAG5XYqPNLdYonILmhcxANsIidh69tHzjXtuRg== + version "0.7.3" + resolved "https://registry.yarnpkg.com/@xmldom/xmldom/-/xmldom-0.7.3.tgz#55de695f77afd3cc0e5bee0aa900040bc63c0f63" + integrity sha512-8XmJdPut2XGtfFcsNsqEsvMUmAwk7xLq7m+E/GcsU9b5qyFFIsiX4Fvnb5UoQ4wo12Wlm07YFJERoyWUYdbIpw== "@xtuc/ieee754@^1.2.0": version "1.2.0" @@ -4902,11 +4915,12 @@ cacache@^12.0.0, cacache@^12.0.2, cacache@^12.0.3: unique-filename "^1.1.1" y18n "^4.0.0" -cacache@^15.0.3, cacache@^15.0.5, cacache@^15.2.0: - version "15.2.0" - resolved "https://registry.yarnpkg.com/cacache/-/cacache-15.2.0.tgz#73af75f77c58e72d8c630a7a2858cb18ef523389" - integrity sha512-uKoJSHmnrqXgthDFx/IU6ED/5xd+NNGe+Bb+kLZy7Ku4P+BaiWEUflAKPZ7eAzsYGcsAGASJZsybXp+quEcHTw== +cacache@^15.0.3, cacache@^15.0.5, cacache@^15.2.0, cacache@^15.3.0: + version "15.3.0" + resolved "https://registry.yarnpkg.com/cacache/-/cacache-15.3.0.tgz#dc85380fb2f556fe3dda4c719bfa0ec875a7f1eb" + integrity sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ== dependencies: + "@npmcli/fs" "^1.0.0" "@npmcli/move-file" "^1.0.1" chownr "^2.0.0" fs-minipass "^2.0.0" @@ -5713,9 +5727,9 @@ copy-descriptor@^0.1.0: integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= core-js-compat@^3.14.0, core-js-compat@^3.16.0: - version "3.16.3" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.16.3.tgz#ae12a6e20505a1d79fbd16b6689dfc77fc989114" - integrity sha512-A/OtSfSJQKLAFRVd4V0m6Sep9lPdjD8bpN8v3tCCGwE0Tmh0hOiVDm9tw6mXmWOKOSZIyr3EkywPo84cJjGvIQ== + version "3.16.4" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.16.4.tgz#cf28abe0e45a43645b04b2c1a073efa03d0b3b26" + integrity sha512-IzCSomxRdahCYb6G3HiN6pl3JCiM0NMunRcNa1pIeC7g17Vd6Ue3AT9anQiENPIm/svThUVer1pIbLMDERIsFw== dependencies: browserslist "^4.16.8" semver "7.0.0" @@ -5726,9 +5740,9 @@ core-js@^2.4.0, core-js@^2.5.0, core-js@^2.6.5: integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== core-js@^3.6.1: - version "3.16.3" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.16.3.tgz#1f2d43c51a9ed014cc6c83440af14697ae4b75f2" - integrity sha512-lM3GftxzHNtPNUJg0v4pC2RC6puwMd6VZA7vXUczi+SKmCWSf4JwO89VJGMqbzmB7jlK7B5hr3S64PqwFL49cA== + version "3.16.4" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.16.4.tgz#0fb1029a554fc2688c0963d7c900e188188a78e0" + integrity sha512-Tq4GVE6XCjE+hcyW6hPy0ofN3hwtLudz5ZRdrlCnsnD/xkm/PWQRudzYHiKgZKUcefV6Q57fhDHjZHJP5dpfSg== core-object@^3.1.5: version "3.1.5" @@ -5962,7 +5976,7 @@ debug@3.1.0: dependencies: ms "2.0.0" -debug@4, debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@~4.3.1: +debug@4, debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@~4.3.1, debug@~4.3.2: version "4.3.2" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== @@ -6028,7 +6042,7 @@ defaults@^1.0.3: dependencies: clone "^1.0.2" -define-properties@^1.1.2, define-properties@^1.1.3: +define-properties@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== @@ -6289,9 +6303,9 @@ ee-first@1.1.1: integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= electron-to-chromium@^1.3.47, electron-to-chromium@^1.3.811: - version "1.3.818" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.818.tgz#32ed024fa8316e5d469c96eecbea7d2463d80085" - integrity sha512-c/Z9gIr+jDZAR9q+mn40hEc1NharBT+8ejkarjbCDnBNFviI6hvcC5j2ezkAXru//bTnQp5n6iPi0JA83Tla1Q== + version "1.3.822" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.822.tgz#7036edc7f669b0aa79e9801dc5f56866c6ddc0b2" + integrity sha512-k7jG5oYYHxF4jx6PcqwHX3JVME/OjzolqOZiIogi9xtsfsmTjTdie4x88OakYFPEa8euciTgCCzvVNwvmjHb1Q== elliptic@^6.5.3: version "6.5.4" @@ -7419,16 +7433,16 @@ end-of-stream@^1.0.0, end-of-stream@^1.1.0: once "^1.4.0" engine.io-parser@~4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-4.0.2.tgz#e41d0b3fb66f7bf4a3671d2038a154024edb501e" - integrity sha512-sHfEQv6nmtJrq6TKuIz5kyEKH/qSdK56H/A+7DnAuUPWosnIZAS2NHNcPLmyjtY3cGS/MqJdZbUjW97JU72iYg== + version "4.0.3" + resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-4.0.3.tgz#83d3a17acfd4226f19e721bb22a1ee8f7662d2f6" + integrity sha512-xEAAY0msNnESNPc00e19y5heTPX4y/TJ36gr8t1voOaNmTojP9b3oK3BbJLFufW2XFPQaaijpFewm2g2Um3uqA== dependencies: base64-arraybuffer "0.1.4" -engine.io@~5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-5.1.1.tgz#a1f97e51ddf10cbd4db8b5ff4b165aad3760cdd3" - integrity sha512-aMWot7H5aC8L4/T8qMYbLdvKlZOdJTH54FxfdFunTGvhMx1BHkJOntWArsVfgAZVwAO9LC2sryPWRcEeUzCe5w== +engine.io@~5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-5.2.0.tgz#554cdd0230d89de7b1a49a809d7ee5a129d36809" + integrity sha512-d1DexkQx87IFr1FLuV+0f5kAm1Hk1uOVijLOb+D1sDO2QMb7YjE02VHtZtxo7xIXMgcWLb+vl3HRT0rI9tr4jQ== dependencies: accepts "~1.3.4" base64id "2.0.0" @@ -7523,24 +7537,7 @@ error@^7.0.0: dependencies: string-template "~0.2.1" -es-abstract@^1.17.0-next.0: - version "1.17.5" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.5.tgz#d8c9d1d66c8981fb9200e2251d799eee92774ae9" - integrity sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg== - dependencies: - es-to-primitive "^1.2.1" - function-bind "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.1" - is-callable "^1.1.5" - is-regex "^1.0.5" - object-inspect "^1.7.0" - object-keys "^1.1.1" - object.assign "^4.1.0" - string.prototype.trimleft "^2.1.1" - string.prototype.trimright "^2.1.1" - -es-abstract@^1.18.0-next.1, es-abstract@^1.18.0-next.2, es-abstract@^1.18.2: +es-abstract@^1.17.0-next.0, es-abstract@^1.18.0-next.1, es-abstract@^1.18.0-next.2, es-abstract@^1.18.2: version "1.18.5" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.5.tgz#9b10de7d4c206a3581fd5b2124233e04db49ae19" integrity sha512-DDggyJLoS91CkJjgauM5c0yZMjiD1uK3KcaCeAmffGwZ+ODWzOkPN4QwRbsK5DOFf06fywmyLci3ZD8jLGhVYA== @@ -8318,9 +8315,9 @@ find-cache-dir@^2.1.0: pkg-dir "^3.0.0" find-cache-dir@^3.3.1: - version "3.3.1" - resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.3.1.tgz#89b33fad4a4670daa94f855f7fbe31d6d84fe880" - integrity sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ== + version "3.3.2" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.3.2.tgz#b30c5b6eff0730731aea9bbd9dbecbd80256d64b" + integrity sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig== dependencies: commondir "^1.0.1" make-dir "^3.0.2" @@ -9205,7 +9202,7 @@ has-symbol-support-x@^1.4.1: resolved "https://registry.yarnpkg.com/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz#1409f98bc00247da45da67cee0a36f282ff26455" integrity sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw== -has-symbols@^1.0.0, has-symbols@^1.0.1, has-symbols@^1.0.2: +has-symbols@^1.0.1, has-symbols@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423" integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== @@ -9855,12 +9852,7 @@ is-buffer@^1.1.5: resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== -is-callable@^1.1.4, is-callable@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.5.tgz#f7e46b596890456db74e7f6e976cb3273d06faab" - integrity sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q== - -is-callable@^1.2.3: +is-callable@^1.1.4, is-callable@^1.2.3: version "1.2.4" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945" integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w== @@ -10111,13 +10103,6 @@ is-redirect@^1.0.0: resolved "https://registry.yarnpkg.com/is-redirect/-/is-redirect-1.0.0.tgz#1d03dded53bd8db0f30c26e4f95d36fc7c87dc24" integrity sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ= -is-regex@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.5.tgz#39d589a358bf18967f726967120b8fc1aed74eae" - integrity sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ== - dependencies: - has "^1.0.3" - is-regex@^1.1.3: version "1.1.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" @@ -11431,7 +11416,7 @@ make-fetch-happen@^5.0.0: socks-proxy-agent "^4.0.0" ssri "^6.0.0" -make-fetch-happen@^9.0.1, make-fetch-happen@^9.0.5: +make-fetch-happen@^9.0.1, make-fetch-happen@^9.1.0: version "9.1.0" resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz#53085a09e7971433e6765f7971bf63f4e05cb968" integrity sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg== @@ -12596,9 +12581,9 @@ npm@^6.14.8: write-file-atomic "^2.4.3" npm@^7.0.0: - version "7.21.0" - resolved "https://registry.yarnpkg.com/npm/-/npm-7.21.0.tgz#12af61f27ab6ece10af2b20ffb355fb2ae227fb6" - integrity sha512-OYSQykXItCDXYGb9U8o85Snhmbe0k/nwVK6CmUNmgtOcfPevVB5ZXwA44eWOCvM+WdWYQsJAJoA7eCHKImQt8g== + version "7.21.1" + resolved "https://registry.yarnpkg.com/npm/-/npm-7.21.1.tgz#2ab886fc8b5eb044ca5b4e2f7570340fad9934eb" + integrity sha512-k7XQNHGHAp0VowMMUMRMtntxWatNad9hhYrelUKDPvZ++DBxvofA8QTNPiuMKtx8CBOFA8iJ4aizhbx6ZYVfzQ== dependencies: "@npmcli/arborist" "^2.8.2" "@npmcli/ci-detect" "^1.2.0" @@ -12610,7 +12595,7 @@ npm@^7.0.0: ansicolors "~0.3.2" ansistyles "~0.1.3" archy "~1.0.0" - cacache "^15.2.0" + cacache "^15.3.0" chalk "^4.1.2" chownr "^2.0.0" cli-columns "^3.1.2" @@ -12635,7 +12620,7 @@ npm@^7.0.0: libnpmsearch "^3.1.1" libnpmteam "^2.0.3" libnpmversion "^1.2.1" - make-fetch-happen "^9.0.5" + make-fetch-happen "^9.1.0" minipass "^3.1.3" minipass-pipeline "^1.2.4" mkdirp "^1.0.4" @@ -12655,13 +12640,13 @@ npm@^7.0.0: parse-conflict-json "^1.1.1" qrcode-terminal "^0.12.0" read "~1.0.7" - read-package-json "^4.0.0" + read-package-json "^4.0.1" read-package-json-fast "^2.0.3" readdir-scoped-modules "^1.1.0" rimraf "^3.0.2" semver "^7.3.5" ssri "^8.0.1" - tar "^6.1.10" + tar "^6.1.11" text-table "~0.2.0" tiny-relative-date "^1.3.0" treeverse "^1.0.4" @@ -12733,12 +12718,7 @@ object-inspect@^1.11.0, object-inspect@^1.9.0: resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.11.0.tgz#9dceb146cedd4148a0d9e51ab88d34cf509922b1" integrity sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg== -object-inspect@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.7.0.tgz#f4f6bd181ad77f006b5ece60bd0b6f398ff74a67" - integrity sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw== - -object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.1.1: +object-keys@^1.0.12, object-keys@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== @@ -12750,17 +12730,7 @@ object-visit@^1.0.0: dependencies: isobject "^3.0.0" -object.assign@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" - integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== - dependencies: - define-properties "^1.1.2" - function-bind "^1.1.1" - has-symbols "^1.0.0" - object-keys "^1.0.11" - -object.assign@^4.1.2: +object.assign@^4.1.0, object.assign@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940" integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ== @@ -12771,12 +12741,13 @@ object.assign@^4.1.2: object-keys "^1.1.1" object.getownpropertydescriptors@^2.0.3: - version "2.1.0" - resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz#369bf1f9592d8ab89d712dced5cb81c7c5352649" - integrity sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg== + version "2.1.2" + resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.2.tgz#1bd63aeacf0d5d2d2f31b5e393b03a7c601a23f7" + integrity sha512-WtxeKSzfBjlzL+F9b7M7hewDzMwy+C8NRssHd1YrNlzHzIDrXcXiNOMrezdAEM4UXixgV+vvnyBeN7Rygl2ttQ== dependencies: + call-bind "^1.0.2" define-properties "^1.1.3" - es-abstract "^1.17.0-next.1" + es-abstract "^1.18.0-next.2" object.pick@^1.3.0: version "1.3.0" @@ -13842,10 +13813,10 @@ read-package-json-fast@^2.0.1, read-package-json-fast@^2.0.2, read-package-json- normalize-package-data "^2.0.0" npm-normalize-package-bin "^1.0.0" -read-package-json@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/read-package-json/-/read-package-json-4.0.0.tgz#b555a9f749bf5eb9b8f053806b32f17001914e90" - integrity sha512-EBQiek1udd0JKvUzaViAWHYVQRuQZ0IP0LWUOqVCJaZIX92ZO86dOpvsTOO3esRIQGgl7JhFBaGqW41VI57KvQ== +read-package-json@^4.0.0, read-package-json@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/read-package-json/-/read-package-json-4.0.1.tgz#da88a38c410344fecb7d840d35f27635e848ea54" + integrity sha512-czqCcYfkEl6sIFJVOND/5/Goseu7cVw1rcDUATq6ED0jLGjMm9/HOPmFmEZMvRu9yl272YERaMUcOlvcNU9InQ== dependencies: glob "^7.1.1" json-parse-even-better-errors "^2.3.0" @@ -14863,10 +14834,10 @@ snapdragon@^0.8.1: source-map-resolve "^0.5.0" use "^3.1.0" -socket.io-adapter@~2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-2.3.1.tgz#a442720cb09a4823cfb81287dda1f9b52d4ccdb2" - integrity sha512-8cVkRxI8Nt2wadkY6u60Y4rpW3ejA1rxgcK2JuyIhmF+RMNpTy1QRtkHIDUOf3B4HlQwakMsWbKftMv/71VMmw== +socket.io-adapter@~2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-2.3.2.tgz#039cd7c71a52abad984a6d57da2c0b7ecdd3c289" + integrity sha512-PBZpxUPYjmoogY0aoaTmo1643JelsaS1CiAwNjRVdrI0X9Seuc19Y2Wife8k88avW6haG8cznvwbubAZwH4Mtg== socket.io-parser@~4.0.4: version "4.0.4" @@ -14878,18 +14849,18 @@ socket.io-parser@~4.0.4: debug "~4.3.1" socket.io@^4.1.2: - version "4.1.3" - resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-4.1.3.tgz#d114328ef27ab31b889611792959c3fa6d502500" - integrity sha512-tLkaY13RcO4nIRh1K2hT5iuotfTaIQw7cVIe0FUykN3SuQi0cm7ALxuyT5/CtDswOMWUzMGTibxYNx/gU7In+Q== + version "4.2.0" + resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-4.2.0.tgz#9e1c09d3ea647e24963a2e7ba8ea5c847778e2ed" + integrity sha512-sjlGfMmnaWvTRVxGRGWyhd9ctpg4APxWAxu85O/SxekkxHhfxmePWZbaYCkeX5QQX0z1YEnKOlNt6w82E4Nzug== dependencies: - "@types/cookie" "^0.4.0" - "@types/cors" "^2.8.10" + "@types/cookie" "^0.4.1" + "@types/cors" "^2.8.12" "@types/node" ">=10.0.0" accepts "~1.3.4" base64id "~2.0.0" - debug "~4.3.1" - engine.io "~5.1.1" - socket.io-adapter "~2.3.1" + debug "~4.3.2" + engine.io "~5.2.0" + socket.io-adapter "~2.3.2" socket.io-parser "~4.0.4" socks-proxy-agent@^4.0.0: @@ -15301,7 +15272,7 @@ string.prototype.padend@^3.0.0: define-properties "^1.1.3" es-abstract "^1.18.0-next.2" -string.prototype.trimend@^1.0.3, string.prototype.trimend@^1.0.4: +string.prototype.trimend@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz#e75ae90c2942c63504686c18b287b4a0b1a45f80" integrity sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A== @@ -15309,25 +15280,7 @@ string.prototype.trimend@^1.0.3, string.prototype.trimend@^1.0.4: call-bind "^1.0.2" define-properties "^1.1.3" -string.prototype.trimleft@^2.1.1: - version "2.1.3" - resolved "https://registry.yarnpkg.com/string.prototype.trimleft/-/string.prototype.trimleft-2.1.3.tgz#dee305118117d0a1843c1fc0d38d5d0754d83c60" - integrity sha512-699Ibssmj/awVzvdNk4g83/Iu8U9vDohzmA/ly2BrQWGhamuY4Tlvs5XKmKliDt3ky6SKbE1bzPhASKCFlx9Sg== - dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - string.prototype.trimstart "^1.0.3" - -string.prototype.trimright@^2.1.1: - version "2.1.3" - resolved "https://registry.yarnpkg.com/string.prototype.trimright/-/string.prototype.trimright-2.1.3.tgz#dc16a21d7456cbc8b2c54d47fe01f06d9efe94eb" - integrity sha512-hoOq56oRFnnfDuXNy2lGHiwT77MehHv9d0zGfRZ8QdC+4zjrkFB9vd5i/zYTd/ymFBd4YxtbdgHt3U6ksGeuBw== - dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - string.prototype.trimend "^1.0.3" - -string.prototype.trimstart@^1.0.3, string.prototype.trimstart@^1.0.4: +string.prototype.trimstart@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz#b36399af4ab2999b4c9c648bd7a3fb2bb26feeed" integrity sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw== @@ -15539,10 +15492,10 @@ tar@^4.4.10, tar@^4.4.12, tar@^4.4.19: safe-buffer "^5.2.1" yallist "^3.1.1" -tar@^6.0.2, tar@^6.1.0, tar@^6.1.10: - version "6.1.10" - resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.10.tgz#8a320a74475fba54398fa136cd9883aa8ad11175" - integrity sha512-kvvfiVvjGMxeUNB6MyYv5z7vhfFRwbwCXJAeL0/lnbrttBVqcMOnpHUf0X42LrPMR8mMpgapkJMchFH4FSHzNA== +tar@^6.0.2, tar@^6.1.0, tar@^6.1.11: + version "6.1.11" + resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.11.tgz#6760a38f003afa1b2ffd0ffe9e9abbd0eab3d621" + integrity sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA== dependencies: chownr "^2.0.0" fs-minipass "^2.0.0" @@ -16694,9 +16647,9 @@ ws@^6.1.0: async-limiter "~1.0.0" ws@^7.4.6: - version "7.5.3" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.3.tgz#160835b63c7d97bfab418fc1b8a9fced2ac01a74" - integrity sha512-kQ/dHIzuLrS6Je9+uv81ueZomEwH0qVYstcAQ4/Z93K8zeko9gtAbttJWzoC5ukqXY1PpoouV3+VSOqEAFt5wg== + version "7.5.4" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.4.tgz#56bfa20b167427e138a7795de68d134fe92e21f9" + integrity sha512-zP9z6GXm6zC27YtspwH99T3qTG7bBFv2VIkeHstMLrLlDJuzA7tQ5ls3OJ1hOGGCzTQPniNJoHXIAOS0Jljohg== ws@~7.4.2: version "7.4.6" From b6b4ea9b463dc093a3a527096ebecfe776b24ec1 Mon Sep 17 00:00:00 2001 From: Christian Zosel Date: Mon, 30 Aug 2021 15:34:39 +0200 Subject: [PATCH 3/5] feat: add option to hide entries in main nav --- README.md | 42 +++++++++++++++++++++++ addon/components/nav/item.hbs | 12 ++++--- addon/components/nav/item.js | 8 +++++ tests/dummy/app/services/emeis-options.js | 1 + 4 files changed, 58 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 5170363b..8244642e 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,48 @@ export default class App extends Application { ``` ## Configuration + +### Emeis options + +Basic configuration of ember-emeis can be done via the `emeis-options` service. To generate it, run `ember g service emeis-options` and add it to the dependencies in `app/app.js`: + +```js +export default class App extends Application { + // ... + + this.engines = { + emberEmeis: { + dependencies: { + services: ["store", "intl", "notification", "router", "emeis-options"], + }, + }, + }; +} +}); +``` + +The config service supports the following options: + +```js +import Service from "@ember/service"; + +export default class EmeisOptionsService extends Service { + // number of items in list views + pageSize = 10; + + // hide "username" field + emailAsUsername = false; + + // show only a subset of the "additional" fields on the user model + additionalUserFields = ["phone", "language", "address", "city", "zip"]; + + // show only a subset of the main navigation entries + navigationEntries = ["users", "scopes"]; +} +``` + +### Emeis store + If you need to customize your store service passed to emeis, use: `ember g emeis-store ` diff --git a/addon/components/nav/item.hbs b/addon/components/nav/item.hbs index 144314f7..f0e4c90c 100644 --- a/addon/components/nav/item.hbs +++ b/addon/components/nav/item.hbs @@ -1,5 +1,7 @@ -
  • - - {{yield}} - -
  • +{{#if this.isVisible}} +
  • + + {{yield}} + +
  • +{{/if}} diff --git a/addon/components/nav/item.js b/addon/components/nav/item.js index 3c3a97eb..80dde0de 100644 --- a/addon/components/nav/item.js +++ b/addon/components/nav/item.js @@ -3,8 +3,16 @@ import Component from "@glimmer/component"; export default class NavItemComponent extends Component { @service router; + @service emeisOptions; get isActive() { return this.router.currentRoute.name.includes(this.args.route); } + + get isVisible() { + return ( + !this.emeisOptions.navigationEntries || + this.emeisOptions.navigationEntries.includes(this.args.route) + ); + } } diff --git a/tests/dummy/app/services/emeis-options.js b/tests/dummy/app/services/emeis-options.js index b1169d25..649b0c97 100644 --- a/tests/dummy/app/services/emeis-options.js +++ b/tests/dummy/app/services/emeis-options.js @@ -4,4 +4,5 @@ export default class EmeisOptionsService extends Service { emailAsUsername = false; pageSize = 10; // additionalUserFields = ["phone", "language"]; + // navigationEntries = ["users", "scopes"]; } From 5ef81c9d3db03791da44dd05cf624dd612dd99e2 Mon Sep 17 00:00:00 2001 From: Christian Zosel Date: Mon, 30 Aug 2021 16:01:24 +0200 Subject: [PATCH 4/5] feat: add config option for optional user fields --- README.md | 8 +++++- addon/controllers/users/edit/index.js | 27 ++++++++++------- addon/templates/users/edit/index.hbs | 23 ++++++++------- tests/acceptance/users-test.js | 35 ++++++++++++++++++++++- tests/dummy/app/services/emeis-options.js | 5 +++- 5 files changed, 75 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 8244642e..a4977a10 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,13 @@ export default class EmeisOptionsService extends Service { emailAsUsername = false; // show only a subset of the "additional" fields on the user model - additionalUserFields = ["phone", "language", "address", "city", "zip"]; + additionalUserFields = { + "phone": "required", + "language": "required", + "address": "optional", + "city": "optional", + "zip": "optional" + ]; // show only a subset of the main navigation entries navigationEntries = ["users", "scopes"]; diff --git a/addon/controllers/users/edit/index.js b/addon/controllers/users/edit/index.js index ed343808..5424c14f 100644 --- a/addon/controllers/users/edit/index.js +++ b/addon/controllers/users/edit/index.js @@ -2,6 +2,8 @@ import Controller from "@ember/controller"; import { action } from "@ember/object"; import { inject as service } from "@ember/service"; +const ALL_ADDITIONAL_FIELDS = ["phone", "language", "address", "city", "zip"]; + export default class UsersEditIndexController extends Controller { @service intl; @service emeisOptions; @@ -31,15 +33,20 @@ export default class UsersEditIndexController extends Controller { return this.emeisOptions.emailAsUsername; } - get additionalUserFields() { - return ( - this.emeisOptions.additionalUserFields || [ - "phone", - "language", - "address", - "city", - "zip", - ] - ); + get visibleFields() { + if (!this.emeisOptions.additionalUserFields) { + return ALL_ADDITIONAL_FIELDS; + } + + return Object.keys(this.emeisOptions.additionalUserFields); + } + + get requiredFields() { + if (!this.emeisOptions.additionalUserFields) { + return ALL_ADDITIONAL_FIELDS; + } + return Object.entries(this.emeisOptions.additionalUserFields, {}) + .filter(([, value]) => value === "required") + .map(([key]) => key); } } diff --git a/addon/templates/users/edit/index.hbs b/addon/templates/users/edit/index.hbs index 69bef182..368a20cd 100644 --- a/addon/templates/users/edit/index.hbs +++ b/addon/templates/users/edit/index.hbs @@ -50,14 +50,14 @@ />
    - {{#if (includes "phone" this.additionalUserFields)}} + {{#if (includes "phone" this.visibleFields)}} @@ -68,9 +68,12 @@ {{/if}} - {{#if (includes "language" this.additionalUserFields)}} + {{#if (includes "language" this.visibleFields)}} - @@ -83,40 +86,40 @@ {{/if}} - {{#if (includes "address" this.additionalUserFields)}} + {{#if (includes "address" this.visibleFields)}} {{/if}} - {{#if (includes "city" this.additionalUserFields)}} + {{#if (includes "city" this.visibleFields)}} {{/if}} - {{#if (includes "zip" this.additionalUserFields)}} + {{#if (includes "zip" this.visibleFields)}} diff --git a/tests/acceptance/users-test.js b/tests/acceptance/users-test.js index 2aa44e5f..f86a2e2e 100644 --- a/tests/acceptance/users-test.js +++ b/tests/acceptance/users-test.js @@ -1,3 +1,4 @@ +import Service from "@ember/service"; import { visit, currentURL, @@ -13,6 +14,13 @@ import { module, test } from "qunit"; import setupRequestAssertions from "./../helpers/assert-request"; +class EmeisOptionsStub extends Service { + additionalUserFields = { + phone: "optional", + language: "required", + }; +} + module("Acceptance | users", function (hooks) { setupApplicationTest(hooks); setupMirage(hooks); @@ -40,8 +48,27 @@ module("Acceptance | users", function (hooks) { .hasAttribute("href", `/users/${user.id}`); }); + test("can hide fields via config", async function (assert) { + this.owner.register("service:emeis-options", EmeisOptionsStub); + + const user = this.server.create("user", { + isActive: true, + }); + this.intl.locale = ["en", "de"]; + + await visit(`/users/${user.id}`); + await settled(); + + assert.dom('[name="address"]').doesNotExist(); + assert.dom('[name="city"]').doesNotExist(); + assert.dom('[name="zip"]').doesNotExist(); + + assert.dom('[name="phone"]').isNotRequired(); + assert.dom('[name="language"]').isRequired(); + }); + test("detail view /users/:id", async function (assert) { - assert.expect(22); + assert.expect(27); const user = this.server.create("user", { isActive: true, @@ -63,6 +90,12 @@ module("Acceptance | users", function (hooks) { assert.dom('[name="city"]').hasValue(user.city.en); assert.dom('[name="zip"]').hasValue(user.zip.toString()); + assert.dom('[name="phone"]').isRequired(); + assert.dom('[name="language"]').isRequired(); + assert.dom('[name="address"]').isRequired(); + assert.dom('[name="city"]').isRequired(); + assert.dom('[name="zip"]').isRequired(); + assert.dom('[name="isActive"]').isChecked(); const username = "newusername", diff --git a/tests/dummy/app/services/emeis-options.js b/tests/dummy/app/services/emeis-options.js index 649b0c97..844b3159 100644 --- a/tests/dummy/app/services/emeis-options.js +++ b/tests/dummy/app/services/emeis-options.js @@ -3,6 +3,9 @@ import Service from "@ember/service"; export default class EmeisOptionsService extends Service { emailAsUsername = false; pageSize = 10; - // additionalUserFields = ["phone", "language"]; + // additionalUserFields = { + // phone: "optional", + // language: "optional", + // }; // navigationEntries = ["users", "scopes"]; } From e0ca148a18c91204ad27b3f9d46f6fc57c762214 Mon Sep 17 00:00:00 2001 From: Christian Zosel Date: Mon, 30 Aug 2021 19:05:09 +0200 Subject: [PATCH 5/5] fix: make scope description optional --- addon/templates/scopes/edit.hbs | 1 - 1 file changed, 1 deletion(-) diff --git a/addon/templates/scopes/edit.hbs b/addon/templates/scopes/edit.hbs index 4bc5ef35..7ebc0f8f 100644 --- a/addon/templates/scopes/edit.hbs +++ b/addon/templates/scopes/edit.hbs @@ -17,7 +17,6 @@ name="description" placeholder="{{t "emeis.scopes.headings.description"}}..." value={{@model.description}} - required >