From b3c8072df3c994bbfad8e4a347f8e59e017e2e39 Mon Sep 17 00:00:00 2001 From: schefbi Date: Tue, 19 Oct 2021 12:02:48 +0200 Subject: [PATCH 01/14] setParameterByName if index ? < # --- app/framework/url-helpers.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/framework/url-helpers.js b/app/framework/url-helpers.js index c47ffc41..ecbb33a8 100644 --- a/app/framework/url-helpers.js +++ b/app/framework/url-helpers.js @@ -43,14 +43,20 @@ export function setParameterByName(name,value, url) { let params = decodeURI(url).split('?')[1]; if(params !== undefined) { + if(params.indexOf(name) >= 0) { params = params.replace(name + '=' + getParameterByName(name,url), name +'='+ value); - } else { + } + else if (url.indexOf('?') < url.indexOf('#')) { + params = params + '?' + name +'='+ value; + } + else { params = params + '&' + name +'='+ value; } } else { params = name +'='+ value; } + window.location.href = encodeURI(url.split('?')[0] + '?' + params); } From bcadfcac087fd217f2d0dd07dab617af5d7ed2a8 Mon Sep 17 00:00:00 2001 From: schefbi Date: Tue, 19 Oct 2021 13:28:21 +0200 Subject: [PATCH 02/14] more then 1 params work --- app/framework/url-helpers.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/app/framework/url-helpers.js b/app/framework/url-helpers.js index ecbb33a8..265889e0 100644 --- a/app/framework/url-helpers.js +++ b/app/framework/url-helpers.js @@ -41,22 +41,21 @@ export function setParameterByName(name,value, url) { return url; } - let params = decodeURI(url).split('?')[1]; + let params = decodeURI(url).split('?'); + params = params.length === 3 ? params[1] + '?' + params[2] : params[1]; + if(params !== undefined) { if(params.indexOf(name) >= 0) { params = params.replace(name + '=' + getParameterByName(name,url), name +'='+ value); } - else if (url.indexOf('?') < url.indexOf('#')) { - params = params + '?' + name +'='+ value; - } - else { + else { params = params + '&' + name +'='+ value; } } else { params = name +'='+ value; } - - window.location.href = encodeURI(url.split('?')[0] + '?' + params); + + window.location.href = encodeURI(url.split('?')[0] + '?' + params); } From 26ecce8e9bad3ca2ca30f5375a9b960539788433 Mon Sep 17 00:00:00 2001 From: schefbi Date: Tue, 19 Oct 2021 14:45:47 +0200 Subject: [PATCH 03/14] params error on first load --- app/framework/url-helpers.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/framework/url-helpers.js b/app/framework/url-helpers.js index 265889e0..79acfcfb 100644 --- a/app/framework/url-helpers.js +++ b/app/framework/url-helpers.js @@ -42,6 +42,7 @@ export function setParameterByName(name,value, url) { } let params = decodeURI(url).split('?'); + let paramsLength = params.length; params = params.length === 3 ? params[1] + '?' + params[2] : params[1]; if(params !== undefined) { @@ -50,7 +51,16 @@ export function setParameterByName(name,value, url) { params = params.replace(name + '=' + getParameterByName(name,url), name +'='+ value); } else { - params = params + '&' + name +'='+ value; + let newParam = '&'; + if (paramsLength > 2 && params.indexOf('?') > -1) { + newParam = '&'; + } else if (paramsLength > 2 && params.indexOf('?') === -1) { + newParam = '?'; + } else if (paramsLength === 2 && params.indexOf('#') > -1) { + newParam = '?'; + } + + params = params + newParam + name +'='+ value; } } else { From 9ebd4d6d5aa04c903d7b40c84fd7909dc637b5d4 Mon Sep 17 00:00:00 2001 From: schefbi Date: Thu, 21 Oct 2021 15:28:25 +0200 Subject: [PATCH 04/14] #124 fix StayPermit property data send --- app/components/subscription-form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/components/subscription-form.js b/app/components/subscription-form.js index 05c41381..6f0eb845 100644 --- a/app/components/subscription-form.js +++ b/app/components/subscription-form.js @@ -178,7 +178,7 @@ function setProperties(data, element) { // skip if there is no selection if (text === '') return; - data[element.name] = text; + data[element.name] = element.name === 'StayPermit' ? parseInt(element.value) : text; data[element.name + 'Id'] = parseInt(element.value); return; } From 0ba034045c1bfd58643fbb9f06e8637d1ee7cce5 Mon Sep 17 00:00:00 2001 From: schefbi Date: Fri, 22 Oct 2021 15:09:50 +0200 Subject: [PATCH 05/14] =?UTF-8?q?#125=20Anmeldedetail=20Sichtbarkeit=20ist?= =?UTF-8?q?=20abh=C3=A4ngig=20von=20aus=20NG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/input/input-checkbox.js | 6 ++ app/components/input/input-date.js | 7 ++- app/components/input/input-dropdown.js | 15 +++++ app/components/input/input-file.js | 6 +- .../input/input-freeform-dropdown.js | 7 +++ app/components/input/input-number.js | 6 ++ app/components/input/input-string.js | 9 ++- app/components/input/input-textarea.js | 6 ++ app/framework/api.js | 8 +++ app/framework/form-helpers.js | 61 +++++++++++++++++++ app/routes/list/category/event/subscribe.js | 32 ++++++++-- app/templates/components/input-base.hbs | 7 ++- .../components/input/input-checkbox.hbs | 2 +- app/templates/components/input/input-date.hbs | 2 +- .../components/input/input-dropdown.hbs | 4 +- .../components/input/input-email.hbs | 2 +- .../input/input-freeform-dropdown.hbs | 2 +- .../components/input/input-number.hbs | 2 +- .../components/input/input-string.hbs | 2 +- .../components/input/input-telephone.hbs | 2 +- .../components/input/input-textarea.hbs | 2 +- public/locale/de-CH.js | 5 ++ public/locale/fr-CH.js | 5 ++ 23 files changed, 180 insertions(+), 20 deletions(-) diff --git a/app/components/input/input-checkbox.js b/app/components/input/input-checkbox.js index bb93d73f..7655ae81 100644 --- a/app/components/input/input-checkbox.js +++ b/app/components/input/input-checkbox.js @@ -1,4 +1,10 @@ import Component from '@ember/component'; +import { vssDependency } from 'kursausschreibung/framework/form-helpers'; export default Component.extend({ + change(){ + let field = this.get('field'); + let currentValue = document.getElementById('vss'+field.id).checked; + vssDependency(currentValue,field); + } }); diff --git a/app/components/input/input-date.js b/app/components/input/input-date.js index 985ff148..66e1c72b 100644 --- a/app/components/input/input-date.js +++ b/app/components/input/input-date.js @@ -1,6 +1,6 @@ import Component from '@ember/component'; import { dateGreaterNow } from 'kursausschreibung/framework/date-helpers'; -import { formFieldError } from 'kursausschreibung/framework/form-helpers'; +import { formFieldError, vssDependency } from 'kursausschreibung/framework/form-helpers'; export default Component.extend({ change() { @@ -8,4 +8,9 @@ export default Component.extend({ formFieldError(this.element.children[0], dateGreaterNow(this.element.children[0].value)); } }, + focusOut() { + let field = this.get('field'); + let currentValue = document.getElementById('vss'+field.id).value; + vssDependency(currentValue,field); + } }); diff --git a/app/components/input/input-dropdown.js b/app/components/input/input-dropdown.js index bb93d73f..03b5f1d8 100644 --- a/app/components/input/input-dropdown.js +++ b/app/components/input/input-dropdown.js @@ -1,4 +1,19 @@ import Component from '@ember/component'; +import { vssDependency } from 'kursausschreibung/framework/form-helpers'; export default Component.extend({ + change(){ + let field = this.get('field'); + let currentValue = null; + + document.getElementsByName(field.id).forEach(input => { + if(field.options.showAsRadioButtons) { + currentValue = input.checked ? input.value : currentValue; + } else { + currentValue = input.value; + } + }); + + vssDependency(currentValue,field); + } }); diff --git a/app/components/input/input-file.js b/app/components/input/input-file.js index dbc2e1c8..d18ad924 100644 --- a/app/components/input/input-file.js +++ b/app/components/input/input-file.js @@ -1,6 +1,6 @@ import Component from '@ember/component'; import { getString } from 'kursausschreibung/framework/translate'; -import { removeFile } from 'kursausschreibung/framework/form-helpers'; +import { removeFile, vssDependency } from 'kursausschreibung/framework/form-helpers'; import uikit from 'uikit'; import jQuery from 'jquery'; @@ -77,6 +77,10 @@ export default Component.extend({ uikit.notification({message: getString('UploadErfolgreich') + inputFile.name, pos: 'bottom-right', status:'success' }); + + let field = this.get('field'); + vssDependency(inputFile,field); + } }, actions: { diff --git a/app/components/input/input-freeform-dropdown.js b/app/components/input/input-freeform-dropdown.js index 7fd9fa4a..eec79f12 100644 --- a/app/components/input/input-freeform-dropdown.js +++ b/app/components/input/input-freeform-dropdown.js @@ -1,4 +1,5 @@ import Component from '@ember/component'; +import { vssDependency } from 'kursausschreibung/framework/form-helpers'; export default Component.extend({ didInsertElement() { @@ -27,5 +28,11 @@ export default Component.extend({ willDestroyElement() { this.$('.typeahead').typeahead('destroy'); this._super(...arguments); + }, + + focusOut() { + let field = this.get('field'); + let currentValue = document.getElementById('vss'+field.id).value; + vssDependency(currentValue,field); } }); diff --git a/app/components/input/input-number.js b/app/components/input/input-number.js index bb93d73f..d6ceaa80 100644 --- a/app/components/input/input-number.js +++ b/app/components/input/input-number.js @@ -1,4 +1,10 @@ import Component from '@ember/component'; +import { vssDependency } from 'kursausschreibung/framework/form-helpers'; export default Component.extend({ + focusOut() { + let field = this.get('field'); + let currentValue = document.getElementById('vss'+field.id).value; + vssDependency(currentValue,field); + } }); diff --git a/app/components/input/input-string.js b/app/components/input/input-string.js index c2c9393c..9712eedd 100644 --- a/app/components/input/input-string.js +++ b/app/components/input/input-string.js @@ -1,5 +1,5 @@ import Component from '@ember/component'; -import { helperSocialSecurityNumber } from 'kursausschreibung/framework/form-helpers'; +import { helperSocialSecurityNumber, vssDependency } from 'kursausschreibung/framework/form-helpers'; export default Component.extend({ change() { @@ -9,5 +9,10 @@ export default Component.extend({ }, keyUp() { this.change(); - } + }, + focusOut() { + let field = this.get('field'); + let currentValue = document.getElementById('vss'+field.id).value; + vssDependency(currentValue,field); +} }); diff --git a/app/components/input/input-textarea.js b/app/components/input/input-textarea.js index bb93d73f..b60714f4 100644 --- a/app/components/input/input-textarea.js +++ b/app/components/input/input-textarea.js @@ -1,4 +1,10 @@ import Component from '@ember/component'; +import { vssDependency } from 'kursausschreibung/framework/form-helpers'; export default Component.extend({ + focusOut() { + let field = this.get('field'); + let currentValue = document.getElementById('vss'+field.id).value; + vssDependency(currentValue,field); + } }); diff --git a/app/framework/api.js b/app/framework/api.js index 782d82ca..b1d89dff 100644 --- a/app/framework/api.js +++ b/app/framework/api.js @@ -117,6 +117,14 @@ export function getSubscriptionDetails(eventId) { return get('Events/' + eventId + '/SubscriptionDetails'); } +/** + * get subscriptionDetailDependencies of an event + * @param {number} eventId the id of the event + */ + export function getSubscriptionDetailDependencies(eventId) { + return get('SubscriptionDetailDependencies/?idEvent=' + eventId); +} + /** * get all eventTexts * @param {string} cultureInfo 'de-CH' for german and 'en-US' for french diff --git a/app/framework/form-helpers.js b/app/framework/form-helpers.js index 56c9e662..6bdf6baf 100644 --- a/app/framework/form-helpers.js +++ b/app/framework/form-helpers.js @@ -85,3 +85,64 @@ function ean13checkNumber(number) { } return false; } + + +/** +* Check if vssDependency available +* @param {string} formValue +* @param {object} field +*/ +export function vssDependency(formValue,field) { + +if(field.options.dependencyItems !== undefined) { + + let hiddenClass = 'uk-hidden'; + + if (field.options.dependencyItems.length > 0) { + + field.options.dependencyItems.forEach(element => { + let values = element.Values; + let operator = element.Operator; + + let vssId = element.IdVss; + let hidden = document.getElementById('hidden'+vssId); + let requiredElement = document.getElementById('file'+vssId) === null ? document.getElementById('vss'+vssId) : document.getElementById('file'+vssId); + + if(vssDependencyCheck(formValue,operator,values)) { + hidden.classList.remove(hiddenClass); + requiredElement.required = true; + } else { + hidden.classList.add(hiddenClass); + requiredElement.required = false; + } + + }); + +} + +} + +} + +/** + * Check if vssDependency true +* @param {string} formValue +* @param {number} operator +* @param {Array} values +*/ +function vssDependencyCheck(formValue, operator, values) { + + if(typeof formValue === 'boolean') { + formValue = formValue ? '1' : '0'; + } + + if (operator === 349) { //contains + return formValue.indexOf(values) > -1 ? true : false; + } else if (operator === 350) { //contains Not + return formValue.indexOf(values) === -1 ? true : false; + } else if (operator === 351) { //empty + return formValue === null || formValue === undefined || formValue.length === 0 ? true : false; + } else if (operator === 352) { //notEmpty + return formValue.length > 0 ? true : false; //formValue !== undefined || + } +} \ No newline at end of file diff --git a/app/routes/list/category/event/subscribe.js b/app/routes/list/category/event/subscribe.js index 42f714f1..7112e1f4 100644 --- a/app/routes/list/category/event/subscribe.js +++ b/app/routes/list/category/event/subscribe.js @@ -2,7 +2,7 @@ import { A } from '@ember/array'; import { get, set } from '@ember/object'; import Route from '@ember/routing/route'; import { - getDropDownItems, getSubscriptionDetails, getUserSettings, + getDropDownItems, getSubscriptionDetails, getSubscriptionDetailDependencies, getUserSettings, SUBSCRIPTION_DETAIL_ALLOW_MULTIPLE_PEOPLE } from 'kursausschreibung/framework/api'; import { autoCheckForLogin } from 'kursausschreibung/framework/login-helpers'; @@ -86,12 +86,34 @@ function getSubscriptionDetailFields(subscriptionDetails) { options: detail.DropdownItems, showAsRadioButtons: dataType === 'dropdown' ? detail.ShowAsRadioButtons : undefined, tooltip: detail.Tooltip, - disabled: detail.readOnly + disabled: detail.readOnly, + hidden: '', + dependencyItems: [] } }; }); } +function addSubscriptionDetailDependencies(subscriptionDetailDependencies,subscriptionDetails) { + + subscriptionDetails.map(item => { + + subscriptionDetailDependencies.find(dependency => { + + if (dependency.IdVss === item.id){ + item.options.hidden = 'uk-hidden'; + item.options.required = false; + } + if (dependency.IdVssInfluencer === item.id) { + item.options.dependencyItems.push(dependency); + } + }); + }); + + return subscriptionDetails; + +} + function addTranslations(fields) { fields.forEach(detail => { if (detail.label === undefined) @@ -138,8 +160,8 @@ export default Route.extend({ // make sure the session is still active return autoCheckForLogin() - .then(() => Promise.all([getUserSettings(), getSubscriptionDetails(model.Id)])) - .then(([userSettings, subscriptionDetails]) => { + .then(() => Promise.all([getUserSettings(), getSubscriptionDetails(model.Id), getSubscriptionDetailDependencies(model.Id)])) + .then(([userSettings, subscriptionDetails, subscriptionDetailDependencies]) => { // check if multiple people are allowed to subscribe at the same time let allowMultiplePeople = false; @@ -158,6 +180,8 @@ export default Route.extend({ set(model, 'userSettings', userSettings); set(model, 'subscriptionDetailFields', getSubscriptionDetailFields(A(subscriptionDetails).sortBy('Sort'))); + set(model, 'subscriptionDetailFields', addSubscriptionDetailDependencies(subscriptionDetailDependencies,getSubscriptionDetailFields(A(subscriptionDetails).sortBy('Sort'))) ); + if (userSettings.isLoggedIn === false) { let fields = getFormFields(settings, model.EventTypeId).addressFields; let additionalPeopleFields = getFormFields(settings, model.EventTypeId).additionalPeopleFields; diff --git a/app/templates/components/input-base.hbs b/app/templates/components/input-base.hbs index 3da25d84..3afc96db 100644 --- a/app/templates/components/input-base.hbs +++ b/app/templates/components/input-base.hbs @@ -1,10 +1,13 @@ {{#if field.isLegend}} - {{{field.label}}} + {{{field.label}}} {{else}} -
+
+ {{#if field.options.tooltip}} + + {{/if}} {{component componentType field=field}} {{#if field.options.showHint }}
{{{field.hint}}}
diff --git a/app/templates/components/input/input-checkbox.hbs b/app/templates/components/input/input-checkbox.hbs index 1fb41330..1fdc356c 100644 --- a/app/templates/components/input/input-checkbox.hbs +++ b/app/templates/components/input/input-checkbox.hbs @@ -1,2 +1,2 @@ - diff --git a/app/templates/components/input/input-date.hbs b/app/templates/components/input/input-date.hbs index 681a0964..30d51e32 100644 --- a/app/templates/components/input/input-date.hbs +++ b/app/templates/components/input/input-date.hbs @@ -1,3 +1,3 @@ - diff --git a/app/templates/components/input/input-dropdown.hbs b/app/templates/components/input/input-dropdown.hbs index b1ea48ce..c3b05281 100644 --- a/app/templates/components/input/input-dropdown.hbs +++ b/app/templates/components/input/input-dropdown.hbs @@ -1,13 +1,13 @@ {{#if field.options.showAsRadioButtons}}
{{#each field.options.options as |option|}} - {{/each}}
{{else}} - diff --git a/app/templates/components/input/input-freeform-dropdown.hbs b/app/templates/components/input/input-freeform-dropdown.hbs index 25c207ad..adf33b7c 100644 --- a/app/templates/components/input/input-freeform-dropdown.hbs +++ b/app/templates/components/input/input-freeform-dropdown.hbs @@ -1,2 +1,2 @@ - diff --git a/app/templates/components/input/input-number.hbs b/app/templates/components/input/input-number.hbs index d7d62f3f..6e77ea17 100644 --- a/app/templates/components/input/input-number.hbs +++ b/app/templates/components/input/input-number.hbs @@ -1,2 +1,2 @@ - diff --git a/app/templates/components/input/input-string.hbs b/app/templates/components/input/input-string.hbs index 578c363b..c7ef2697 100644 --- a/app/templates/components/input/input-string.hbs +++ b/app/templates/components/input/input-string.hbs @@ -1,2 +1,2 @@ - diff --git a/app/templates/components/input/input-telephone.hbs b/app/templates/components/input/input-telephone.hbs index 2a5d9a24..083d80d9 100644 --- a/app/templates/components/input/input-telephone.hbs +++ b/app/templates/components/input/input-telephone.hbs @@ -1,2 +1,2 @@ - diff --git a/app/templates/components/input/input-textarea.hbs b/app/templates/components/input/input-textarea.hbs index 02f18a45..844076af 100644 --- a/app/templates/components/input/input-textarea.hbs +++ b/app/templates/components/input/input-textarea.hbs @@ -1,3 +1,3 @@ - diff --git a/public/locale/de-CH.js b/public/locale/de-CH.js index b76033e6..af930eeb 100644 --- a/public/locale/de-CH.js +++ b/public/locale/de-CH.js @@ -85,6 +85,11 @@ window.kursausschreibung.locale["de-CH"] = { "formNationality": "Nationalität", "formNativeLanguage": "Muttersprache", "formSocialSecurityNumber": "Sozialversicherungsnummer", + "formFirstNamePlaceholder": "Max", + "formLastNamePlaceholder": "Muster", + "formAddressLine1Placeholder": "Musterstrasse 99", + "formZipPlaceholder": "3000", + "formLocationPlaceholder": "Bern", "duplicateEmailError": "Die E-Mail-Adresse muss unterschiedlich sein, ansonsten kann das Formular nicht übermittelt werden.", "addPerson": "Weitere Person anmelden", "removePerson": "Letzte Person entfernen", diff --git a/public/locale/fr-CH.js b/public/locale/fr-CH.js index 68531c44..9e1837ed 100644 --- a/public/locale/fr-CH.js +++ b/public/locale/fr-CH.js @@ -76,6 +76,11 @@ window.kursausschreibung.locale["fr-CH"] = { "formAddressLine1": "Adresse", "formZip": "NPA", "formLocation": "Lieu", + "formFirstNamePlaceholder": "Max", + "formLastNamePlaceholder": "Muster", + "formAddressLine1Placeholder": "Musterstrasse 99", + "formZipPlaceholder": "3000", + "formLocationPlaceholder": "Bern", "duplicateEmailError": "L'adresse e-mail doit être différente, sinon le formulaire ne peut pas être soumis.", "addPerson": "Inscrire une autre personne", "removePerson": "Enlever la dernière personne", From 9395149fd618c315cbf2797d0b6012250d20adc2 Mon Sep 17 00:00:00 2001 From: schefbi Date: Thu, 4 Nov 2021 11:58:22 +0100 Subject: [PATCH 06/14] npm audit fix --- package-lock.json | 289 +++------------------------------------------- 1 file changed, 15 insertions(+), 274 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8059b49f..5dfa25ae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9889,58 +9889,12 @@ } } }, - "lodash._basebind": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/lodash._basebind/-/lodash._basebind-2.3.0.tgz", - "integrity": "sha1-K1vEUqDhBhQ7IYafIzvbWHQX0kg=", - "dev": true, - "requires": { - "lodash._basecreate": "~2.3.0", - "lodash._setbinddata": "~2.3.0", - "lodash.isobject": "~2.3.0" - } - }, "lodash._basecopy": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", "integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=", "dev": true }, - "lodash._basecreate": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/lodash._basecreate/-/lodash._basecreate-2.3.0.tgz", - "integrity": "sha1-m4ioak3P97fzxh2Dovz8BnHsneA=", - "dev": true, - "requires": { - "lodash._renative": "~2.3.0", - "lodash.isobject": "~2.3.0", - "lodash.noop": "~2.3.0" - } - }, - "lodash._basecreatecallback": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/lodash._basecreatecallback/-/lodash._basecreatecallback-2.3.0.tgz", - "integrity": "sha1-N7KrF1kaM56YjbMln81GAZ16w2I=", - "dev": true, - "requires": { - "lodash._setbinddata": "~2.3.0", - "lodash.bind": "~2.3.0", - "lodash.identity": "~2.3.0", - "lodash.support": "~2.3.0" - } - }, - "lodash._basecreatewrapper": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/lodash._basecreatewrapper/-/lodash._basecreatewrapper-2.3.0.tgz", - "integrity": "sha1-qgxhrZYETDkzN2ExSDqXWcNlEkc=", - "dev": true, - "requires": { - "lodash._basecreate": "~2.3.0", - "lodash._setbinddata": "~2.3.0", - "lodash._slice": "~2.3.0", - "lodash.isobject": "~2.3.0" - } - }, "lodash._baseflatten": { "version": "3.1.4", "resolved": "https://registry.npmjs.org/lodash._baseflatten/-/lodash._baseflatten-3.1.4.tgz", @@ -9968,103 +9922,18 @@ "lodash.restparam": "^3.0.0" } }, - "lodash._createwrapper": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/lodash._createwrapper/-/lodash._createwrapper-2.3.0.tgz", - "integrity": "sha1-0arhEC2t9EDo4G/BM6bt1/4UYHU=", - "dev": true, - "requires": { - "lodash._basebind": "~2.3.0", - "lodash._basecreatewrapper": "~2.3.0", - "lodash.isfunction": "~2.3.0" - } - }, - "lodash._escapehtmlchar": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/lodash._escapehtmlchar/-/lodash._escapehtmlchar-2.3.0.tgz", - "integrity": "sha1-0D2mvYLu3zjcCltQPXQOzQ6JRZI=", - "dev": true, - "requires": { - "lodash._htmlescapes": "~2.3.0" - } - }, - "lodash._escapestringchar": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/lodash._escapestringchar/-/lodash._escapestringchar-2.3.0.tgz", - "integrity": "sha1-zOc65g/G2lXSv4oGecI8orqxSfw=", - "dev": true - }, "lodash._getnative": { "version": "3.9.1", "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=", "dev": true }, - "lodash._htmlescapes": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/lodash._htmlescapes/-/lodash._htmlescapes-2.3.0.tgz", - "integrity": "sha1-HKmIY8rfH6HYLITzXzHkBVagTzo=", - "dev": true - }, "lodash._isiterateecall": { "version": "3.0.9", "resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", "integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=", "dev": true }, - "lodash._objecttypes": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/lodash._objecttypes/-/lodash._objecttypes-2.3.0.tgz", - "integrity": "sha1-aj6jmH3W7rgCGy1cnDA1Scwrrh4=", - "dev": true - }, - "lodash._reinterpolate": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-2.3.0.tgz", - "integrity": "sha1-A+6dhcDlXL1ZDXFgiilb3aURKOw=", - "dev": true - }, - "lodash._renative": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/lodash._renative/-/lodash._renative-2.3.0.tgz", - "integrity": "sha1-d9jt1M7SbdWXH54Vpfdy5OMX+9M=", - "dev": true - }, - "lodash._reunescapedhtml": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/lodash._reunescapedhtml/-/lodash._reunescapedhtml-2.3.0.tgz", - "integrity": "sha1-25ILVax/P/glk5rOubosIxcT0k0=", - "dev": true, - "requires": { - "lodash._htmlescapes": "~2.3.0", - "lodash.keys": "~2.3.0" - } - }, - "lodash._setbinddata": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/lodash._setbinddata/-/lodash._setbinddata-2.3.0.tgz", - "integrity": "sha1-5WEEkKzRMnfVmFjZW18nJ/FQjwQ=", - "dev": true, - "requires": { - "lodash._renative": "~2.3.0", - "lodash.noop": "~2.3.0" - } - }, - "lodash._shimkeys": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/lodash._shimkeys/-/lodash._shimkeys-2.3.0.tgz", - "integrity": "sha1-YR+TFJ4+bHIQlrSHae8pU3rai6k=", - "dev": true, - "requires": { - "lodash._objecttypes": "~2.3.0" - } - }, - "lodash._slice": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/lodash._slice/-/lodash._slice-2.3.0.tgz", - "integrity": "sha1-FHGYEyhZly5GgMoppZkshVZpqlw=", - "dev": true - }, "lodash.assign": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-3.2.0.tgz", @@ -10095,17 +9964,6 @@ "integrity": "sha1-uo31+4QesKPoBEIysOJjqNxqKKI=", "dev": true }, - "lodash.bind": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/lodash.bind/-/lodash.bind-2.3.0.tgz", - "integrity": "sha1-wqjhi2jl7MFS4rFoJmEW/qWwFsw=", - "dev": true, - "requires": { - "lodash._createwrapper": "~2.3.0", - "lodash._renative": "~2.3.0", - "lodash._slice": "~2.3.0" - } - }, "lodash.castarray": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.castarray/-/lodash.castarray-4.4.0.tgz", @@ -10127,33 +9985,12 @@ "lodash._getnative": "^3.0.0" } }, - "lodash.defaults": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-2.3.0.tgz", - "integrity": "sha1-qDKwAfE487uXIcKBmip8xa4h7SU=", - "dev": true, - "requires": { - "lodash._objecttypes": "~2.3.0", - "lodash.keys": "~2.3.0" - } - }, "lodash.defaultsdeep": { "version": "4.6.1", "resolved": "https://registry.npmjs.org/lodash.defaultsdeep/-/lodash.defaultsdeep-4.6.1.tgz", "integrity": "sha512-3j8wdDzYuWO3lM3Reg03MuQR957t287Rpcxp1njpEa8oDrikb+FwGdW3n+FELh/A6qib6yPit0j/pv9G/yeAqA==", "dev": true }, - "lodash.escape": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/lodash.escape/-/lodash.escape-2.3.0.tgz", - "integrity": "sha1-hEw4xY+EThNi6+lnJhWbYs9fKlg=", - "dev": true, - "requires": { - "lodash._escapehtmlchar": "~2.3.0", - "lodash._reunescapedhtml": "~2.3.0", - "lodash.keys": "~2.3.0" - } - }, "lodash.find": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/lodash.find/-/lodash.find-4.6.0.tgz", @@ -10171,30 +10008,9 @@ } }, "lodash.foreach": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/lodash.foreach/-/lodash.foreach-2.3.0.tgz", - "integrity": "sha1-CDQEyR6EbudyRf3512UZxosq8Wg=", - "dev": true, - "requires": { - "lodash._basecreatecallback": "~2.3.0", - "lodash.forown": "~2.3.0" - } - }, - "lodash.forown": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/lodash.forown/-/lodash.forown-2.3.0.tgz", - "integrity": "sha1-JPtKr4ANRfwtxgv+w84EyDajrX8=", - "dev": true, - "requires": { - "lodash._basecreatecallback": "~2.3.0", - "lodash._objecttypes": "~2.3.0", - "lodash.keys": "~2.3.0" - } - }, - "lodash.identity": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/lodash.identity/-/lodash.identity-2.3.0.tgz", - "integrity": "sha1-awGiEMlIU1XCqRO0i2cRIZoXPe0=", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.foreach/-/lodash.foreach-4.5.0.tgz", + "integrity": "sha1-Gmo16s5AEoDH8G3d7DUWWrJ+PlM=", "dev": true }, "lodash.isarguments": { @@ -10209,44 +10025,12 @@ "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=", "dev": true }, - "lodash.isfunction": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/lodash.isfunction/-/lodash.isfunction-2.3.0.tgz", - "integrity": "sha1-aylz5HpkfPEucNZ2rqE2Q3BuUmc=", - "dev": true - }, - "lodash.isobject": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/lodash.isobject/-/lodash.isobject-2.3.0.tgz", - "integrity": "sha1-LhbT/Fg9qYMZaJU/LY5tc0NPZ5k=", - "dev": true, - "requires": { - "lodash._objecttypes": "~2.3.0" - } - }, - "lodash.keys": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-2.3.0.tgz", - "integrity": "sha1-s1D0+Syqn0WkouzwGEVM8vKK4lM=", - "dev": true, - "requires": { - "lodash._renative": "~2.3.0", - "lodash._shimkeys": "~2.3.0", - "lodash.isobject": "~2.3.0" - } - }, "lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, - "lodash.noop": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/lodash.noop/-/lodash.noop-2.3.0.tgz", - "integrity": "sha1-MFnWKNUbv5N80qC2/Dp/ISpmnCw=", - "dev": true - }, "lodash.omit": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.omit/-/lodash.omit-4.5.0.tgz", @@ -10259,15 +10043,6 @@ "integrity": "sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=", "dev": true }, - "lodash.support": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/lodash.support/-/lodash.support-2.3.0.tgz", - "integrity": "sha1-fq8DivTw1qq3drRKptz8gDNMm/0=", - "dev": true, - "requires": { - "lodash._renative": "~2.3.0" - } - }, "lodash.template": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.5.0.tgz", @@ -10295,16 +10070,6 @@ } } }, - "lodash.templatesettings": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-2.3.0.tgz", - "integrity": "sha1-MD0TLDQnEAQNWhjvqi1XL9A/jNw=", - "dev": true, - "requires": { - "lodash._reinterpolate": "~2.3.0", - "lodash.escape": "~2.3.0" - } - }, "lodash.uniq": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", @@ -10317,15 +10082,6 @@ "integrity": "sha1-2ZwHpmnp5tJOE2Lf4mbGdhavEwI=", "dev": true }, - "lodash.values": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/lodash.values/-/lodash.values-2.3.0.tgz", - "integrity": "sha1-ypb75gogsLDsK6K6X8anZb0Uo7o=", - "dev": true, - "requires": { - "lodash.keys": "~2.3.0" - } - }, "log-symbols": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", @@ -12525,14 +12281,14 @@ "dev": true }, "sourcemap-validator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/sourcemap-validator/-/sourcemap-validator-1.1.0.tgz", - "integrity": "sha512-Hmdu39KL+EoAAZ69OTk7RXXJdPRRizJvOZOWhCW9jLGfEQflCNPTlSoCXFPdKWFwwf0uzLcGR/fc7EP/PT8vRQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/sourcemap-validator/-/sourcemap-validator-1.1.1.tgz", + "integrity": "sha512-pq6y03Vs6HUaKo9bE0aLoksAcpeOo9HZd7I8pI6O480W/zxNZ9U32GfzgtPP0Pgc/K1JHna569nAbOk3X8/Qtw==", "dev": true, "requires": { "jsesc": "~0.3.x", - "lodash.foreach": "~2.3.x", - "lodash.template": "~2.3.x", + "lodash.foreach": "^4.5.0", + "lodash.template": "^4.5.0", "source-map": "~0.1.x" }, "dependencies": { @@ -12542,21 +12298,6 @@ "integrity": "sha1-G/XuY7RTn+LibQwemcJAuXpFeXI=", "dev": true }, - "lodash.template": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-2.3.0.tgz", - "integrity": "sha1-Tj4pxDO0z+pnXsg15vEjkcYf0is=", - "dev": true, - "requires": { - "lodash._escapestringchar": "~2.3.0", - "lodash._reinterpolate": "~2.3.0", - "lodash.defaults": "~2.3.0", - "lodash.escape": "~2.3.0", - "lodash.keys": "~2.3.0", - "lodash.templatesettings": "~2.3.0", - "lodash.values": "~2.3.0" - } - }, "source-map": { "version": "0.1.43", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", @@ -12983,9 +12724,9 @@ } }, "tmpl": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz", - "integrity": "sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE=", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", + "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", "dev": true }, "to-fast-properties": { @@ -13431,12 +13172,12 @@ } }, "wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", "dev": true, "requires": { - "string-width": "^1.0.2 || 2" + "string-width": "^1.0.2 || 2 || 3 || 4" } }, "wordwrap": { From 07ea5ded798e33aa5acf452e521367befccc4d20 Mon Sep 17 00:00:00 2001 From: schefbi Date: Thu, 4 Nov 2021 12:02:06 +0100 Subject: [PATCH 07/14] listCategory id set for css style --- app/templates/list/index.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/templates/list/index.hbs b/app/templates/list/index.hbs index 3f8bfaf5..575fa05e 100644 --- a/app/templates/list/index.hbs +++ b/app/templates/list/index.hbs @@ -1,2 +1,2 @@ -

{{translate "overview"}}

+

{{translate "overview"}}

{{event-list events=model.events page=page queryChanged=(action "queryChanged") route="list"}} From 6e22796434f8a795bc1fdb24768fcdd60124dd59 Mon Sep 17 00:00:00 2001 From: schefbi Date: Thu, 4 Nov 2021 15:01:09 +0100 Subject: [PATCH 08/14] #127 fix only show code to current list --- app/components/list-pagination.js | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/app/components/list-pagination.js b/app/components/list-pagination.js index ff8adc55..6f8c4b0f 100644 --- a/app/components/list-pagination.js +++ b/app/components/list-pagination.js @@ -59,14 +59,24 @@ export default Component.extend({ return pages; }), - filterCodes: computed('items', function () { - let filterCodes = this.get('items').filter(item => item.allfilterCodes instanceof Array); - return filterCodes.length === 0 ? null : filterCodes[0].allfilterCodes; - }), - itemsOnCurrentPage: computed('items', 'page', function () { let page = this.get('page'); let filter = this.get('items').filter(item => item.codes instanceof Array); return filter.length > 0 ? this.get('items') : this.get('items').slice(settings.itemsPerPage * (page - 1), settings.itemsPerPage * page); - }) + }), + + filterCodes: computed('items', function () { + let filterCodes = this.get('itemsOnCurrentPage').filter(item => item.allfilterCodes instanceof Array); + let eventfilterCodes = []; + filterCodes.forEach(event => { + let existsFilter = filterCodes[0].allfilterCodes.filter(filter => event.filter.indexOf(filter.id) > -1); + + if(eventfilterCodes.includes(existsFilter[0]) === false) { + eventfilterCodes.push(existsFilter[0]); + } + + }); + + return eventfilterCodes.length === 1 ? null : eventfilterCodes; + }), }); From 49b8d6cbebcbbb28b63a3ed219359f4c93fbfab5 Mon Sep 17 00:00:00 2001 From: schefbi Date: Thu, 4 Nov 2021 15:06:24 +0100 Subject: [PATCH 09/14] header list category --- app/templates/list/category/index.hbs | 2 +- app/templates/list/index.hbs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/templates/list/category/index.hbs b/app/templates/list/category/index.hbs index 4746bc5a..12f8a574 100644 --- a/app/templates/list/category/index.hbs +++ b/app/templates/list/category/index.hbs @@ -1,2 +1,2 @@ -

{{model.name}}

+

{{model.name}}

{{event-list events=model.events page=page queryChanged=(action "queryChanged") route="list.category"}} diff --git a/app/templates/list/index.hbs b/app/templates/list/index.hbs index 575fa05e..2287998d 100644 --- a/app/templates/list/index.hbs +++ b/app/templates/list/index.hbs @@ -1,2 +1,2 @@ -

{{translate "overview"}}

+

{{translate "overview"}}

{{event-list events=model.events page=page queryChanged=(action "queryChanged") route="list"}} From a85ef1302c7b31101178bd4c360e4446b4480b7c Mon Sep 17 00:00:00 2001 From: Aram Loosman Date: Tue, 9 Nov 2021 15:04:10 +0100 Subject: [PATCH 10/14] Bump Version to 3.3.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 063f64a6..b0a1c098 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "kursausschreibung", - "version": "3.1.0", + "version": "3.3.0", "private": true, "description": "Evento JS Module for online course announcement", "license": "MIT", From 24213a595c246639ba2973535fd0743be652a91d Mon Sep 17 00:00:00 2001 From: schefbi Date: Wed, 10 Nov 2021 17:25:51 +0100 Subject: [PATCH 11/14] #127 fix eventcodes works only with one code --- app/components/list-pagination.js | 10 +++++++--- app/framework/store.js | 7 +++++-- package-lock.json | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/app/components/list-pagination.js b/app/components/list-pagination.js index 6f8c4b0f..8c2a6a11 100644 --- a/app/components/list-pagination.js +++ b/app/components/list-pagination.js @@ -66,14 +66,18 @@ export default Component.extend({ }), filterCodes: computed('items', function () { + let filterCodes = this.get('itemsOnCurrentPage').filter(item => item.allfilterCodes instanceof Array); let eventfilterCodes = []; filterCodes.forEach(event => { + let existsFilter = filterCodes[0].allfilterCodes.filter(filter => event.filter.indexOf(filter.id) > -1); - if(eventfilterCodes.includes(existsFilter[0]) === false) { - eventfilterCodes.push(existsFilter[0]); - } + existsFilter.map(filter => { + if(eventfilterCodes.includes(filter) === false) { + eventfilterCodes.push(filter); + } + }); }); diff --git a/app/framework/store.js b/app/framework/store.js index 8f6ad00b..e07ecc64 100644 --- a/app/framework/store.js +++ b/app/framework/store.js @@ -208,9 +208,12 @@ function addLessonsToEvents(lessons) { return; } // add codes-array - eventsById[code.EventId].codes = []; - eventsById[code.EventId].codes.push(code); + if (eventsById[code.EventId].codes === undefined) { + eventsById[code.EventId].codes = []; + } + eventsById[code.EventId].codes.push(code); + // adds filter tag let filter = eventsById[code.EventId].filter; eventsById[code.EventId].filter = filter === undefined ? 'tag'+code.CodeId : filter + ' tag'+code.CodeId; diff --git a/package-lock.json b/package-lock.json index 5dfa25ae..c158c517 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "kursausschreibung", - "version": "3.1.0", + "version": "3.3.0", "lockfileVersion": 1, "requires": true, "dependencies": { From f08e7a21d54bd6f82c605a5c2982765066473fb4 Mon Sep 17 00:00:00 2001 From: schefbi Date: Thu, 11 Nov 2021 10:00:26 +0100 Subject: [PATCH 12/14] #130 fix expire date now correct --- app/framework/login-helpers.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/framework/login-helpers.js b/app/framework/login-helpers.js index 8ec5c7aa..111cd389 100644 --- a/app/framework/login-helpers.js +++ b/app/framework/login-helpers.js @@ -47,8 +47,7 @@ export function checkToken() { if (accessToken !== null) { // store token, refresh token and expiration let refreshToken = getParameterByName('refresh_token'); - let expire = parseInt(getParameterByName('expires_in')); - let tokenExpire = Date.now() + expire * 1000; + let tokenExpire = parseJWT(accessToken).exp * 1000; setAccessToken(accessToken); setRefreshToken(refreshToken); From d3fd144ccbc55a72dd1ab10d0930e3b0b53951a7 Mon Sep 17 00:00:00 2001 From: schefbi Date: Thu, 11 Nov 2021 10:02:00 +0100 Subject: [PATCH 13/14] app Version update --- README.md | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 32de3ab7..11799394 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# kursausschreibung 3.3.0 +# kursausschreibung 3.3.1 [![Build 🏭🚀](https://github.com/bkd-mba-fbi/kursausschreibung/actions/workflows/buildDeploy.yml/badge.svg)](https://github.com/bkd-mba-fbi/kursausschreibung/actions/workflows/buildDeploy.yml) ## Prerequisites diff --git a/package.json b/package.json index b0a1c098..3a477d97 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "kursausschreibung", - "version": "3.3.0", + "version": "3.3.1", "private": true, "description": "Evento JS Module for online course announcement", "license": "MIT", From feef2e778499354376e91d9fb500e0d6698758d4 Mon Sep 17 00:00:00 2001 From: schefbi Date: Thu, 11 Nov 2021 10:45:47 +0100 Subject: [PATCH 14/14] #Nationalities without BfsCode --- app/routes/list/category/event/subscribe.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/routes/list/category/event/subscribe.js b/app/routes/list/category/event/subscribe.js index 7112e1f4..3734398b 100644 --- a/app/routes/list/category/event/subscribe.js +++ b/app/routes/list/category/event/subscribe.js @@ -20,9 +20,12 @@ function loadDropdownItems(fields) { .then(options => { if(item.id === 'Nationality') { + options.forEach(element => { + element.Value = element.Value.split(':')[1].trim(); + }); let setDefaultLand = options; let defaultLand = options.findIndex(nationality => nationality.Key === 2008100); - setDefaultLand.splice(0,0,options[defaultLand]); + setDefaultLand.splice(0,0,options[defaultLand]); } if (item.options.options === undefined)