From a9805f19c6d6b8225eda646c2bafecf09acd0834 Mon Sep 17 00:00:00 2001 From: Sachin Chauhan Date: Fri, 23 Oct 2020 16:39:11 +0530 Subject: [PATCH 1/5] align-modal fix-all-modals-crpper chore(deps-dev): bump @sentry/tracing from 5.27.0 to 5.27.1 (#5372) Bumps [@sentry/tracing](https://github.com/getsentry/sentry-javascript) from 5.27.0 to 5.27.1. - [Release notes](https://github.com/getsentry/sentry-javascript/releases) - [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md) - [Commits](https://github.com/getsentry/sentry-javascript/compare/5.27.0...5.27.1) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> chore(deps-dev): bump mini-css-extract-plugin from 1.1.2 to 1.2.0 (#5371) Bumps [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin) from 1.1.2 to 1.2.0. - [Release notes](https://github.com/webpack-contrib/mini-css-extract-plugin/releases) - [Changelog](https://github.com/webpack-contrib/mini-css-extract-plugin/blob/master/CHANGELOG.md) - [Commits](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v1.1.2...v1.2.0) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- app/components/modals/modal-base.js | 79 ++++++++++++++++++- app/components/modals/tax-info-modal.js | 3 - app/styles/partials/overrides.scss | 5 ++ .../components/modals/tax-info-modal.hbs | 1 + package.json | 4 +- yarn.lock | 55 ++++++++++--- 6 files changed, 128 insertions(+), 19 deletions(-) diff --git a/app/components/modals/modal-base.js b/app/components/modals/modal-base.js index d4bc44a492c..64ef470dbab 100644 --- a/app/components/modals/modal-base.js +++ b/app/components/modals/modal-base.js @@ -7,12 +7,50 @@ import { isTesting } from 'open-event-frontend/utils/testing'; export default UiModal.extend({ tagName : 'div', + classNames : ['centered-modal'], classNameBindings : ['isFullScreen:fullscreen', 'isSmall:small', 'isLarge:large'], openObserver: observer('isOpen', function() { const $element = $(this.element); if (this.isOpen) { - $element.modal('show'); + $element.modal({ + centered : false, + duration : isTesting ? 0 : 200, + dimmerSettings : { + dimmerName : `${this.elementId}-modal-dimmer`, + variation : 'inverted' + }, + onHide: () => { + this.set('isOpen', false); + if (this.onHide) { + this.onHide(); + } + }, + onDeny: () => { + if (this.onDeny) { + this.onDeny(); + } + return true; + }, + onApprove: () => { + if (this.onApprove) { + this.onApprove(); + } + return true; + }, + + onVisible: () => { + this.set('isOpen', true); + const $element = $(this.element); + $element.modal('refresh'); + $element.find('[data-content]').popup({ + inline: true + }); + if (this.onVisible) { + this.onVisible(); + } + } + }).modal('show'); } else { $element.modal('hide'); } @@ -91,7 +129,44 @@ export default UiModal.extend({ didInitSemantic() { if (this.isOpen) { - $(this.element).modal('show'); + $(this.element).modal({ + centered : false, + duration : isTesting ? 0 : 200, + dimmerSettings : { + dimmerName : `${this.elementId}-modal-dimmer`, + variation : 'inverted' + }, + onHide: () => { + this.set('isOpen', false); + if (this.onHide) { + this.onHide(); + } + }, + onDeny: () => { + if (this.onDeny) { + this.onDeny(); + } + return true; + }, + onApprove: () => { + if (this.onApprove) { + this.onApprove(); + } + return true; + }, + + onVisible: () => { + this.set('isOpen', true); + const $element = $(this.element); + $element.modal('refresh'); + $element.find('[data-content]').popup({ + inline: true + }); + if (this.onVisible) { + this.onVisible(); + } + } + }).modal('show'); } } }); diff --git a/app/components/modals/tax-info-modal.js b/app/components/modals/tax-info-modal.js index 7c6069c2ea1..6a585c473a5 100644 --- a/app/components/modals/tax-info-modal.js +++ b/app/components/modals/tax-info-modal.js @@ -7,9 +7,6 @@ import { orderBy } from 'lodash-es'; export default ModalBase.extend(FormMixin, { isSmall : false, - options : { - closable: false - }, autoScrollToErrors : true, isTaxIncludedInPrice : 'include', diff --git a/app/styles/partials/overrides.scss b/app/styles/partials/overrides.scss index 65ef4d81129..1fdc217ede6 100644 --- a/app/styles/partials/overrides.scss +++ b/app/styles/partials/overrides.scss @@ -76,3 +76,8 @@ body.dimmable.undetached.dimmed { } } } + +.centered-modal { + margin-left: auto !important; + margin-top: auto !important; +} \ No newline at end of file diff --git a/app/templates/components/modals/tax-info-modal.hbs b/app/templates/components/modals/tax-info-modal.hbs index eb3b26cbb7f..ab9770ecbf1 100644 --- a/app/templates/components/modals/tax-info-modal.hbs +++ b/app/templates/components/modals/tax-info-modal.hbs @@ -1,3 +1,4 @@ +
{{t 'Add tax information'}}
diff --git a/package.json b/package.json index 9c98632ecb9..c63fba039cc 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "@open-event/theme": "^0.2.2", "@sentry/browser": "^5.27.0", "@sentry/integrations": "^5.27.0", - "@sentry/tracing": "^5.27.0", + "@sentry/tracing": "^5.27.1", "@types/ember": "^3.16.1", "@types/ember-data": "^3.16.6", "@types/ember-qunit": "^3.4.12", @@ -139,7 +139,7 @@ "http-status": "^1.4.2", "loader.js": "^4.7.0", "lodash-es": "^4.17.15", - "mini-css-extract-plugin": "^1.1.2", + "mini-css-extract-plugin": "^1.2.0", "moment-timezone": "^0.5.31", "npm-run-all": "^4.1.5", "object-to-formdata": "^4.1.0", diff --git a/yarn.lock b/yarn.lock index bab636ff0a4..1088087f85e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1755,6 +1755,15 @@ "@sentry/utils" "5.27.0" tslib "^1.9.3" +"@sentry/hub@5.27.1": + version "5.27.1" + resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.27.1.tgz#c95faaf18257c365acc09246fafd27276bfd6a2f" + integrity sha512-RBHo3T92s6s4Ian1pZcPlmNtFqB+HAP6xitU+ZNA48bYUK+R1vvqEcI8Xs83FyNaRGCgclp9erDFQYyAuxY4vw== + dependencies: + "@sentry/types" "5.27.1" + "@sentry/utils" "5.27.1" + tslib "^1.9.3" + "@sentry/integrations@^5.27.0": version "5.27.0" resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-5.27.0.tgz#8760bd0827db07fc72f90026d64df88e653a9e28" @@ -1774,15 +1783,24 @@ "@sentry/types" "5.27.0" tslib "^1.9.3" -"@sentry/tracing@^5.27.0": - version "5.27.0" - resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-5.27.0.tgz#133b03a02640a0d63d11f341a00e96315c9d0303" - integrity sha512-h82VmO4loeWd5bMFgNWBO+eY6bEpPt5iRc1YZouC10fouhlzw2O4p2A4n1/rVQ+eIKAsfkkgsjEuKBnTPxDAsw== +"@sentry/minimal@5.27.1": + version "5.27.1" + resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-5.27.1.tgz#d6ce881ba3c262db29520177a4c1f0e0f5388697" + integrity sha512-MHXCeJdA1NAvaJuippcM8nrWScul8iTN0Q5nnFkGctGIGmmiZHTXAYkObqJk7H3AK+CP7r1jqN2aQj5Nd9CtyA== dependencies: - "@sentry/hub" "5.27.0" - "@sentry/minimal" "5.27.0" - "@sentry/types" "5.27.0" - "@sentry/utils" "5.27.0" + "@sentry/hub" "5.27.1" + "@sentry/types" "5.27.1" + tslib "^1.9.3" + +"@sentry/tracing@^5.27.1": + version "5.27.1" + resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-5.27.1.tgz#198cd97514363369d29eef9b597be9332ab170c4" + integrity sha512-GBmdR8Ky/nv4KOa6+DEnOSBkFOFhM+asR8Y/gw2qSUWCwzKuWHh9BEnDwxtSI8CMvgUwOIZ5wiiqJGc1unYfCw== + dependencies: + "@sentry/hub" "5.27.1" + "@sentry/minimal" "5.27.1" + "@sentry/types" "5.27.1" + "@sentry/utils" "5.27.1" tslib "^1.9.3" "@sentry/types@5.27.0": @@ -1790,6 +1808,11 @@ resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.27.0.tgz#cea288d02c727ef83541768b8738e6a829dfc831" integrity sha512-coB2bMDxmzTwIWcXbzbnE2JtEqDkvmK9+KyZZNI/Mk3wwabFYqL7hOnqXB45/+hx+6l9/siWmB1l5um3tzqdOw== +"@sentry/types@5.27.1": + version "5.27.1" + resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.27.1.tgz#031480a4cf8f0b6e6337fb03ee884deedcef6f40" + integrity sha512-g1aX0V0fz5BTo0mjgSVY9XmPLGZ6p+8OEzq3ubKzDUf59VHl+Vt8viZ8VXw/vsNtfAjBHn7BzSuzJo7cXJJBtA== + "@sentry/utils@5.27.0": version "5.27.0" resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.27.0.tgz#21c15401b43041b1208521465c09c64eafc2e0ff" @@ -1798,6 +1821,14 @@ "@sentry/types" "5.27.0" tslib "^1.9.3" +"@sentry/utils@5.27.1": + version "5.27.1" + resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.27.1.tgz#0ed9d9685aae6f4ef9eb6b9ebb81e361fd1c5452" + integrity sha512-VIzK8utuvFO9EogZcKJPgmLnlJtYbaPQ0jCw7od9HRw1ckrSBc84sA0uuuY6pB6KSM+7k6EjJ5IdIBaCz5ep/A== + dependencies: + "@sentry/types" "5.27.1" + tslib "^1.9.3" + "@simple-dom/document@^1.4.0": version "1.4.0" resolved "https://registry.yarnpkg.com/@simple-dom/document/-/document-1.4.0.tgz#af60855f957f284d436983798ef1006cca1a1678" @@ -11973,10 +12004,10 @@ min-document@^2.19.0: dependencies: dom-walk "^0.1.0" -mini-css-extract-plugin@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-1.1.2.tgz#34877f631eb4bc8f9d99f0ade2ccacadb0317def" - integrity sha512-tIq578wiGzmo9Ll+JOgHPssV4eoMDTcj3MKkjPbzgooaakMklViJG1qbT0zcwoogUKKliFy/kKjUJaFb4DBHxQ== +mini-css-extract-plugin@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-1.2.0.tgz#f1bdfa7bb6f6a238bc327f813f204283ea33ee36" + integrity sha512-iBZokjaIjHvI4N0AURx5aPBawcmxB/d2NYikxZ4J57Lg5sDShUPyWvuSWl1dueI5oCs7nz8V7qtOCaLjB7AYPw== dependencies: loader-utils "^2.0.0" schema-utils "^3.0.0" From 7afde0a71da59ecc68ee0483bde164e4781ab9fc Mon Sep 17 00:00:00 2001 From: Sachin Chauhan Date: Sat, 24 Oct 2020 17:18:58 +0530 Subject: [PATCH 2/5] remove-duplicacy --- app/components/modals/modal-base.js | 85 ++--------------------------- 1 file changed, 6 insertions(+), 79 deletions(-) diff --git a/app/components/modals/modal-base.js b/app/components/modals/modal-base.js index 64ef470dbab..6c0547058b5 100644 --- a/app/components/modals/modal-base.js +++ b/app/components/modals/modal-base.js @@ -13,44 +13,8 @@ export default UiModal.extend({ openObserver: observer('isOpen', function() { const $element = $(this.element); if (this.isOpen) { - $element.modal({ - centered : false, - duration : isTesting ? 0 : 200, - dimmerSettings : { - dimmerName : `${this.elementId}-modal-dimmer`, - variation : 'inverted' - }, - onHide: () => { - this.set('isOpen', false); - if (this.onHide) { - this.onHide(); - } - }, - onDeny: () => { - if (this.onDeny) { - this.onDeny(); - } - return true; - }, - onApprove: () => { - if (this.onApprove) { - this.onApprove(); - } - return true; - }, - - onVisible: () => { - this.set('isOpen', true); - const $element = $(this.element); - $element.modal('refresh'); - $element.find('[data-content]').popup({ - inline: true - }); - if (this.onVisible) { - this.onVisible(); - } - } - }).modal('show'); + console.log(this.defaultOptions); + $element.modal({...this.defaultOptions}).modal('show'); } else { $element.modal('hide'); } @@ -84,8 +48,8 @@ export default UiModal.extend({ willInitSemantic(settings) { this._super(...arguments); - const defaultOptions = { - detachable : false, + this.defaultOptions = { + centered : false, duration : isTesting ? 0 : 200, dimmerSettings : { dimmerName : `${this.elementId}-modal-dimmer`, @@ -123,50 +87,13 @@ export default UiModal.extend({ } }; - const options = this.options ? merge(defaultOptions, this.options) : defaultOptions; + const options = this.options ? merge(this.defaultOptions, this.options) : this.defaultOptions; assign(settings, options); }, didInitSemantic() { if (this.isOpen) { - $(this.element).modal({ - centered : false, - duration : isTesting ? 0 : 200, - dimmerSettings : { - dimmerName : `${this.elementId}-modal-dimmer`, - variation : 'inverted' - }, - onHide: () => { - this.set('isOpen', false); - if (this.onHide) { - this.onHide(); - } - }, - onDeny: () => { - if (this.onDeny) { - this.onDeny(); - } - return true; - }, - onApprove: () => { - if (this.onApprove) { - this.onApprove(); - } - return true; - }, - - onVisible: () => { - this.set('isOpen', true); - const $element = $(this.element); - $element.modal('refresh'); - $element.find('[data-content]').popup({ - inline: true - }); - if (this.onVisible) { - this.onVisible(); - } - } - }).modal('show'); + $(this.element).modal({...this.defaultOptions}).modal('show'); } } }); From 1a68049548eaa2d6c589369a253c6aa012d6fae8 Mon Sep 17 00:00:00 2001 From: Sachin Chauhan Date: Sat, 24 Oct 2020 17:25:37 +0530 Subject: [PATCH 3/5] final --- app/components/modals/modal-base.js | 1 - 1 file changed, 1 deletion(-) diff --git a/app/components/modals/modal-base.js b/app/components/modals/modal-base.js index 6c0547058b5..1f12a89e8b6 100644 --- a/app/components/modals/modal-base.js +++ b/app/components/modals/modal-base.js @@ -13,7 +13,6 @@ export default UiModal.extend({ openObserver: observer('isOpen', function() { const $element = $(this.element); if (this.isOpen) { - console.log(this.defaultOptions); $element.modal({...this.defaultOptions}).modal('show'); } else { $element.modal('hide'); From b17fc089d4dd199f204f81d0c07e92946a7b5490 Mon Sep 17 00:00:00 2001 From: Sachin Chauhan Date: Sat, 24 Oct 2020 17:42:24 +0530 Subject: [PATCH 4/5] remove spread --- app/components/modals/modal-base.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/components/modals/modal-base.js b/app/components/modals/modal-base.js index 1f12a89e8b6..772f8ba611a 100644 --- a/app/components/modals/modal-base.js +++ b/app/components/modals/modal-base.js @@ -13,7 +13,7 @@ export default UiModal.extend({ openObserver: observer('isOpen', function() { const $element = $(this.element); if (this.isOpen) { - $element.modal({...this.defaultOptions}).modal('show'); + $element.modal(this.defaultOptions).modal('show'); } else { $element.modal('hide'); } @@ -92,7 +92,7 @@ export default UiModal.extend({ didInitSemantic() { if (this.isOpen) { - $(this.element).modal({...this.defaultOptions}).modal('show'); + $(this.element).modal(this.defaultOptions).modal('show'); } } }); From 6c5946cac91d8b8fbf514634644d92bc5b97a8fb Mon Sep 17 00:00:00 2001 From: Areeb Jamal Date: Sat, 24 Oct 2020 20:39:53 +0530 Subject: [PATCH 5/5] Update overrides.scss --- app/styles/partials/overrides.scss | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/styles/partials/overrides.scss b/app/styles/partials/overrides.scss index 1fdc217ede6..8265f10cc56 100644 --- a/app/styles/partials/overrides.scss +++ b/app/styles/partials/overrides.scss @@ -76,8 +76,9 @@ body.dimmable.undetached.dimmed { } } } - + .centered-modal { margin-left: auto !important; margin-top: auto !important; -} \ No newline at end of file + left: auto !important; +}