diff --git a/.env.example b/.env.example index 9f53a4c5009..f9ff622d3a4 100644 --- a/.env.example +++ b/.env.example @@ -1,3 +1,3 @@ GOOGLE_API_KEY="Sample Key" -API_HOST=http://127.0.0.1:5000 +API_HOST=https://open-event-api-dev.herokuapp.com FASTBOOT_DISABLED=true diff --git a/.travis.yml b/.travis.yml index 44cbe53bd7d..bc9bbcccbe3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,7 +39,7 @@ script: - ROOT_URL=open-event-frontend ember build -prod after_success: - - bash <(curl -s https://codecov.io/bash) + - 'bash <(curl -s https://codecov.io/bash)' - bash kubernetes/travis/docker-deploy.sh # - bash kubernetes/travis/k8s-deploy.sh diff --git a/README.md b/README.md index 6f560d24545..e54a1d88b6d 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ It consumes the API exposed by master branch deployment of open event server, ho **Development branch** -The **development** branch of open-event-frontend gets deployed at [https://opev-event-fe.netlify.com](https://opev-event-fe.netlify.com) +The **development** branch of open-event-frontend gets deployed at [https://open-event-fe.netlify.com](https://open-event-fe.netlify.com) It consumes the API exposed by development branch of open event server, hosted at [https://open-event-api-dev.herokuapp.com](https://open-event-api-dev.herokuapp.com) diff --git a/app/components/forms/admin/settings/billing.js b/app/components/forms/admin/settings/billing.js index 49f84a97feb..a0ddfe306b0 100644 --- a/app/components/forms/admin/settings/billing.js +++ b/app/components/forms/admin/settings/billing.js @@ -1,8 +1,9 @@ import Component from '@ember/component'; import FormMixin from 'open-event-frontend/mixins/form'; import { validPhoneNumber } from 'open-event-frontend/utils/validators'; +import { action } from '@ember/object'; -export default Component.extend(FormMixin, { +export default class extends Component.extend(FormMixin) { getValidationRules() { return { inline : true, @@ -99,13 +100,12 @@ export default Component.extend(FormMixin, { } } }; - }, + } - actions: { - submit() { - this.onValid(() => { - this.save(); - }); - } + @action + submit() { + this.onValid(() => { + this.save(); + }); } -}); +} diff --git a/app/components/forms/user-payment-info-form.js b/app/components/forms/user-payment-info-form.js index 34783dd0751..fabfb18036f 100644 --- a/app/components/forms/user-payment-info-form.js +++ b/app/components/forms/user-payment-info-form.js @@ -2,14 +2,14 @@ import Component from '@ember/component'; import FormMixin from 'open-event-frontend/mixins/form'; import { validPhoneNumber } from 'open-event-frontend/utils/validators'; import { pick, orderBy } from 'lodash-es'; -import { computed } from '@ember/object'; +import { action, computed } from '@ember/object'; import { countries } from 'open-event-frontend/utils/dictionary/demography'; -export default Component.extend(FormMixin, { +export default class extends Component.extend(FormMixin) { didInsertElement() { - this._super(...arguments); + super.didInsertElement(...arguments); this.set('userBillingInfo', pick(this.authManager.currentUser, ['billingContactName', 'billingCity', 'billingPhone', 'company', 'billingTaxInfo', 'billingCountry', 'billingState', 'billingAddress', 'billingZipCode', 'billingAdditionalInfo'])); - }, + } getValidationRules() { return { @@ -88,30 +88,30 @@ export default Component.extend(FormMixin, { } } }; - }, + } - countries: computed(function() { + @computed() + get countries() { return orderBy(countries, 'name'); - }), + } - actions: { - submit() { - this.onValid(async() => { - this.set('isLoading', true); - try { - this.authManager.currentUser.setProperties(this.userBillingInfo); - await this.authManager.currentUser.save(); - this.notify.success(this.l10n.t('Your billing details has been updated'), { - id: 'bill_det_updated' - }); - } catch (error) { - this.authManager.currentUser.rollbackAttributes(); - this.notify.error(this.l10n.t('An unexpected error occurred'), { - id: 'bill_det_unexpect' - }); - } - this.set('isLoading', false); - }); - } + @action + submit() { + this.onValid(async() => { + this.set('isLoading', true); + try { + this.authManager.currentUser.setProperties(this.userBillingInfo); + await this.authManager.currentUser.save(); + this.notify.success(this.l10n.t('Your billing details has been updated'), { + id: 'bill_det_updated' + }); + } catch (error) { + this.authManager.currentUser.rollbackAttributes(); + this.notify.error(this.l10n.t('An unexpected error occurred'), { + id: 'bill_det_unexpect' + }); + } + this.set('isLoading', false); + }); } -}); +} diff --git a/app/components/forms/wizard/basic-details-step.js b/app/components/forms/wizard/basic-details-step.js index debf4547433..e072c97e98a 100644 --- a/app/components/forms/wizard/basic-details-step.js +++ b/app/components/forms/wizard/basic-details-step.js @@ -168,7 +168,7 @@ export default Component.extend(FormMixin, EventWizardMixin, { }, { type : 'checkDates', - prompt : this.l10n.t('Start date & time should be after End date and time') + prompt : this.l10n.t('Start date & time should be before End date and time') } ] }, @@ -185,7 +185,7 @@ export default Component.extend(FormMixin, EventWizardMixin, { }, { type : 'checkDates', - prompt : this.l10n.t('Start date & time should be after End date and time') + prompt : this.l10n.t('Start date & time should be before End date and time') } ] }, diff --git a/app/components/forms/wizard/sessions-speakers-step.js b/app/components/forms/wizard/sessions-speakers-step.js index 8c7e8436ee3..a1ba6e59dca 100644 --- a/app/components/forms/wizard/sessions-speakers-step.js +++ b/app/components/forms/wizard/sessions-speakers-step.js @@ -128,6 +128,10 @@ export default Component.extend(EventWizardMixin, FormMixin, { return this.get('data.event.microlocations').filterBy('isDeleted', false); }), + complexCustomForms: computed('data.customForms.@each.isComplex', function() { + return this.data.customForms.filterBy('isComplex', true); + }), + fieldChanged(field) { if (!field.get('isIncluded')) { field.set('isRequired', false); @@ -174,6 +178,12 @@ export default Component.extend(EventWizardMixin, FormMixin, { break; } }, + addCustomField() { + this.data.customForms.addObject(this.store.createRecord('customForm', { + event : this.data.event, + isComplex : true + })); + }, onChange() { this.onValid(() => {}); } diff --git a/app/components/tables/utilities/search-box.js b/app/components/tables/utilities/search-box.js index 7822b3c17a3..98a300f08fd 100644 --- a/app/components/tables/utilities/search-box.js +++ b/app/components/tables/utilities/search-box.js @@ -1,5 +1,18 @@ import Component from '@ember/component'; +import { debounce } from '@ember/runloop'; +import { action } from '@ember/object'; export default class extends Component { + debouncePeriod = 1000 // 1 second + + setSearchQueryLazily(value) { + this.set('searchQuery', value); + } + + @action + setSearchQuery(value) { + debounce(this, this.setSearchQueryLazily, value, this.debouncePeriod); + } + } diff --git a/app/controllers/account/password.js b/app/controllers/account/password.js index 6abab1d81b6..0dd585508c6 100644 --- a/app/controllers/account/password.js +++ b/app/controllers/account/password.js @@ -13,13 +13,22 @@ export default Controller.extend({ this.loader .post('/auth/change-password', payload) .then(() => { - this.notify.success(this.l10n.t('Password updated successfully')); + this.notify.success(this.l10n.t('Password updated successfully'), + { + id: 'pass_upd_succ' + }); }) .catch(error => { if (error.errors) { - this.notify.error(this.l10n.t(`${error.errors[0].detail}`)); + this.notify.error(this.l10n.t(`${error.errors[0].detail}`), + { + id: 'err_pass_ser' + }); } else { - this.notify.error(this.l10n.t('Unexpected error. Password did not change.')); + this.notify.error(this.l10n.t('Unexpected error. Password did not change.'), + { + id: 'err_unex_pass' + }); } }) .finally(() => { diff --git a/app/controllers/account/profile.js b/app/controllers/account/profile.js index 6069ce99243..a8fbe05c058 100644 --- a/app/controllers/account/profile.js +++ b/app/controllers/account/profile.js @@ -6,9 +6,15 @@ export default Controller.extend({ this.set('isLoading', true); try { await this.model.save(); - this.notify.success(this.l10n.t('Your Contact Info has been updated')); + this.notify.success(this.l10n.t('Your Contact Info has been updated'), + { + id: 'cont_info_upd' + }); } catch (error) { - this.notify.error(this.l10n.t(error.message)); + this.notify.error(this.l10n.t(error.message), + { + id: 'cont_upd_error' + }); } this.set('isLoading', false); } diff --git a/app/controllers/admin/content/events.js b/app/controllers/admin/content/events.js index 7536a8c05e3..d43cf197bd1 100644 --- a/app/controllers/admin/content/events.js +++ b/app/controllers/admin/content/events.js @@ -14,7 +14,10 @@ export default Controller.extend({ this.set('disableEventSubtopic', false); this.set('currentTopicSelected', topic); } catch (e) { - this.notify.error(this.l10n.t('An unexpected error has occurred. SubTopics not loaded.')); + this.notify.error(this.l10n.t('An unexpected error has occurred. SubTopics not loaded.'), + { + id: 'subtop_error' + }); } finally { this.set('isLoading', false); } @@ -32,10 +35,16 @@ export default Controller.extend({ eventProp.destroyRecord() .then(() => { this.get(`model.${modelName}s`).removeObject(eventProp); - this.notify.success(this.l10n.t('This Event Property has been deleted successfully.')); + this.notify.success(this.l10n.t('This Event Property has been deleted successfully.'), + { + id: 'event_prop_del' + }); }) .catch(() => { - this.notify.error(this.l10n.t('An unexpected error has occurred. Event Type was not deleted.')); + this.notify.error(this.l10n.t('An unexpected error has occurred. Event Type was not deleted.'), + { + id: 'event_type_error' + }); }) .finally(() => { this.set('isLoading', false); @@ -47,10 +56,16 @@ export default Controller.extend({ modelInstance.save() .then(() => { this.get(`model.${camelCasedValue}s`).addObject(modelInstance); - this.notify.success(this.l10n.t(`${startCase(camelCasedValue)} has been added successfully.`)); + this.notify.success(this.l10n.t(`${startCase(camelCasedValue)} has been added successfully.`), + { + id: 'mode_add_succ' + }); }) .catch(() => { - this.notify.error(this.l10n.t(`An unexpected error has occurred. ${startCase(camelCasedValue)} not saved.`)); + this.notify.error(this.l10n.t(`An unexpected error has occurred. ${startCase(camelCasedValue)} not saved.`), + { + id: 'mode_err_succ' + }); }) .finally(() => { this.set('isLoading', false); diff --git a/app/controllers/admin/content/index.js b/app/controllers/admin/content/index.js index 9eab3c2fc75..3c9ebd712e6 100644 --- a/app/controllers/admin/content/index.js +++ b/app/controllers/admin/content/index.js @@ -7,10 +7,16 @@ export default Controller.extend({ let settings = this.model; settings.save() .then(() => { - this.notify.success(this.l10n.t('Social links have been saved successfully.')); + this.notify.success(this.l10n.t('Social links have been saved successfully.'), + { + id: 'social_link_upd' + }); }) .catch(() => { - this.notify.error(this.l10n.t('An unexpected error has occurred. Social links not saved.')); + this.notify.error(this.l10n.t('An unexpected error has occurred. Social links not saved.'), + { + id: 'unex_social_error' + }); }) .finally(() => { this.set('isLoading', false); diff --git a/app/controllers/admin/content/pages.js b/app/controllers/admin/content/pages.js index 5837541c278..09ac7cebeda 100644 --- a/app/controllers/admin/content/pages.js +++ b/app/controllers/admin/content/pages.js @@ -23,10 +23,16 @@ export default Controller.extend({ if (this.isCreate) { this.set('isFormOpen', false); } - this.notify.success(this.l10n.t('Page details have been saved successfully.')); + this.notify.success(this.l10n.t('Page details have been saved successfully.'), + { + id: 'page_detail_succ' + }); }) .catch(() => { - this.notify.error(this.l10n.t('An unexpected error has occurred. Page Details not saved.')); + this.notify.error(this.l10n.t('An unexpected error has occurred. Page Details not saved.'), + { + id: 'page_detail_del' + }); }); } } diff --git a/app/controllers/admin/content/translations.js b/app/controllers/admin/content/translations.js index 87a1d27e5dd..3214042fefa 100644 --- a/app/controllers/admin/content/translations.js +++ b/app/controllers/admin/content/translations.js @@ -14,10 +14,16 @@ export default class extends Controller { anchor.href = URL.createObjectURL(new Blob([result], { type: 'octet/stream' })); anchor.download = 'Translations.zip'; anchor.click(); - this.notify.success(this.l10n.t('Translations Zip generated successfully.')); + this.notify.success(this.l10n.t('Translations Zip generated successfully.'), + { + id: 'zip_generated_succ' + }); } catch (e) { console.warn(e); - this.notify.error(this.l10n.t('Unexpected error occurred.')); + this.notify.error(this.l10n.t('Unexpected error occurred.'), + { + id: 'zip_error' + }); } this.set('isLoading', false); } diff --git a/app/controllers/admin/events/list.js b/app/controllers/admin/events/list.js index a1aa88e6c65..9f713b83f4f 100644 --- a/app/controllers/admin/events/list.js +++ b/app/controllers/admin/events/list.js @@ -35,22 +35,18 @@ export default class extends Controller.extend(EmberTableControllerMixin) { valuePath : 'startsAt', isSortable : true, headerComponent : 'tables/headers/sort', + extraValuePaths : ['timezone'], cellComponent : 'ui-table/cell/cell-simple-date', - width : 65, - options : { - dateFormat: 'MMMM DD, YYYY - hh:mm A' - } + width : 75 }, { name : 'Ends At', valuePath : 'endsAt', isSortable : true, + extraValuePaths : ['timezone'], headerComponent : 'tables/headers/sort', cellComponent : 'ui-table/cell/cell-simple-date', - width : 65, - options : { - dateFormat: 'MMMM DD, YYYY - hh:mm A' - } + width : 75 }, { name : 'State', @@ -79,11 +75,6 @@ export default class extends Controller.extend(EmberTableControllerMixin) { cellComponent : 'ui-table/cell/cell-speakers-dashboard', width : 90 }, - { - name : 'Tickets', - valuePath : 'tickets', - cellComponent : 'ui-table/cell/cell-tickets' - }, { name : 'Public URL', valuePath : 'url', @@ -129,10 +120,16 @@ export default class extends Controller.extend(EmberTableControllerMixin) { try { let event = this.store.peekRecord('event', this.eventId, { backgroundReload: false }); await event.destroyRecord(); - this.notify.success(this.l10n.t('Event has been deleted successfully.')); + this.notify.success(this.l10n.t('Event has been deleted successfully.'), + { + id: 'event_del_succ' + }); } catch (e) { console.warn(e); - this.notify.error(this.l10n.t('An unexpected error has occurred.')); + this.notify.error(this.l10n.t('An unexpected error has occurred.'), + { + id: 'event_delete_error' + }); } this.setProperties({ isLoading : false, @@ -146,10 +143,16 @@ export default class extends Controller.extend(EmberTableControllerMixin) { let event = this.store.peekRecord('event', event_id, { backgroundReload: false }); event.set('deletedAt', null); await event.save({ adapterOptions: { getTrashed: true } }); - this.notify.success(this.l10n.t('Event has been restored successfully.')); + this.notify.success(this.l10n.t('Event has been restored successfully.'), + { + id: 'event_restored' + }); } catch (e) { console.warn(e); - this.notify.error(this.l10n.t('An unexpected error has occurred.')); + this.notify.error(this.l10n.t('An unexpected error has occurred.'), + { + id: 'restore_error' + }); } this.set('isLoading', false); } @@ -161,11 +164,17 @@ export default class extends Controller.extend(EmberTableControllerMixin) { let event = this.store.peekRecord('event', event_id, { backgroundReload: false }); event.toggleProperty('isFeatured'); await event.save(); - this.notify.success(this.l10n.t('Event details modified successfully')); + this.notify.success(this.l10n.t('Event details modified successfully'), + { + id: 'event_detail_changed' + }); } catch (e) { console.warn(e); - this.notify.error(this.l10n.t('An unexpected error has occurred.')); + this.notify.error(this.l10n.t('An unexpected error has occurred.'), + { + id: 'event_det_error' + }); } this.set('isLoading', false); } diff --git a/app/controllers/admin/messages.js b/app/controllers/admin/messages.js index 5632970dd54..e76fc4e662a 100644 --- a/app/controllers/admin/messages.js +++ b/app/controllers/admin/messages.js @@ -9,9 +9,15 @@ export default Controller.extend({ systemMessages.forEach(systemMessage => { systemMessage.save(); }); - this.notify.success(this.l10n.t('Changes have been saved successfully')); + this.notify.success(this.l10n.t('Changes have been saved successfully'), + { + id: 'message_success' + }); } catch (e) { - this.notify.error(this.l10n.t(e.errors[0].detail)); + this.notify.error(this.l10n.t(e.errors[0].detail), + { + id: 'change_error_message' + }); } } } diff --git a/app/controllers/admin/modules.js b/app/controllers/admin/modules.js index c6904d7a3a4..7aeb623d733 100644 --- a/app/controllers/admin/modules.js +++ b/app/controllers/admin/modules.js @@ -7,10 +7,16 @@ export default Controller.extend({ let modules = this.model; modules.save() .then(() => { - this.notify.success(this.l10n.t('Settings have been saved successfully.')); + this.notify.success(this.l10n.t('Settings have been saved successfully.'), + { + id: 'setting_change' + }); }) .catch(() => { - this.notify.error(this.l10n.t('An unexpected error has occurred. Settings not saved.')); + this.notify.error(this.l10n.t('An unexpected error has occurred. Settings not saved.'), + { + id: 'setting_not_change' + }); }) .finally(() => { this.set('isLoading', false); diff --git a/app/controllers/admin/permissions/event-roles.js b/app/controllers/admin/permissions/event-roles.js index ae55868d545..0716f9ade99 100644 --- a/app/controllers/admin/permissions/event-roles.js +++ b/app/controllers/admin/permissions/event-roles.js @@ -12,10 +12,16 @@ export default Controller.extend({ this.set('isLoading', true); this.get('model.permissions').save() .then(() => { - this.notify.success(this.l10n.t('Admin Event role permissions have been saved successfully.')); + this.notify.success(this.l10n.t('Admin Event role permissions have been saved successfully.'), + { + id: 'admin_event_succ' + }); }) .catch(err => { - this.notify.error(this.l10n.t(err)); + this.notify.error(this.l10n.t(err), + { + id: 'admin_event_error' + }); }) .finally(() => { this.set('isLoading', false); diff --git a/app/controllers/admin/permissions/system-roles.js b/app/controllers/admin/permissions/system-roles.js index efd8663212d..9c6b88afc80 100644 --- a/app/controllers/admin/permissions/system-roles.js +++ b/app/controllers/admin/permissions/system-roles.js @@ -30,10 +30,16 @@ export default Controller.extend({ this.set('isLoading', true); role.destroyRecord() .then(() => { - this.notify.success(this.l10n.t('System role has been deleted successfully.')); + this.notify.success(this.l10n.t('System role has been deleted successfully.'), + { + id: 'system_role_update' + }); }) .catch(() => { - this.notify.error(this.l10n.t('An unexpected error has occurred. System role was not deleted.')); + this.notify.error(this.l10n.t('An unexpected error has occurred. System role was not deleted.'), + { + id: 'system_role_error' + }); }) .finally(() => { this.set('isLoading', false); @@ -51,16 +57,25 @@ export default Controller.extend({ } }); if (!this.get('role.panelPermissions').length) { - this.notify.error(this.l10n.t('Please select atleast one panel.')); + this.notify.error(this.l10n.t('Please select atleast one panel.'), + { + id: 'select_panel' + }); this.set('isLoading', false); } else { this.role.save() .then(() => { this.set('isAddSystemRoleModalOpen', false); - this.notify.success(this.l10n.t('System role have been saved successfully.')); + this.notify.success(this.l10n.t('System role have been saved successfully.'), + { + id: 'system_role_save' + }); }) .catch(() => { - this.notify.error(this.l10n.t('An unexpected error has occurred. System role not saved.')); + this.notify.error(this.l10n.t('An unexpected error has occurred. System role not saved.'), + { + id: 'system_save_role_error' + }); }) .finally(() => { this.set('isLoading', false); @@ -71,10 +86,16 @@ export default Controller.extend({ this.set('isLoading', true); this.get('model.userPermissions').save() .then(() => { - this.notify.success(this.l10n.t('User permissions have been saved successfully.')); + this.notify.success(this.l10n.t('User permissions have been saved successfully.'), + { + id: 'user_permission_save' + }); }) .catch(() => { - this.notify.error(this.l10n.t('An unexpected error has occurred. User permissions not saved.')); + this.notify.error(this.l10n.t('An unexpected error has occurred. User permissions not saved.'), + { + id: 'user_error_permission' + }); }) .finally(() => { this.set('isLoading', false); diff --git a/app/controllers/admin/sessions/list.js b/app/controllers/admin/sessions/list.js index 7713632e0ac..252cb04f8fd 100644 --- a/app/controllers/admin/sessions/list.js +++ b/app/controllers/admin/sessions/list.js @@ -77,10 +77,16 @@ export default class extends Controller.extend(EmberTableControllerMixin) { try { let session = this.store.peekRecord('session', session_id, { backgroundReload: false }); await session.destroyRecord(); - this.notify.success(this.l10n.t('Session has been deleted successfully.')); + this.notify.success(this.l10n.t('Session has been deleted successfully.'), + { + id: 'session_deleted_succ' + }); } catch (e) { console.warn(e); - this.notify.error(this.l10n.t('An unexpected error has occurred.')); + this.notify.error(this.l10n.t('An unexpected error has occurred.'), + { + id: 'unexpected_session_error' + }); } this.set('isLoading', false); } diff --git a/app/controllers/admin/settings/analytics.js b/app/controllers/admin/settings/analytics.js index 71f90573c46..858b7a5901a 100644 --- a/app/controllers/admin/settings/analytics.js +++ b/app/controllers/admin/settings/analytics.js @@ -7,10 +7,16 @@ export default Controller.extend({ let settings = this.model; settings.save() .then(() => { - this.notify.success(this.l10n.t('Settings have been saved successfully.')); + this.notify.success(this.l10n.t('Settings have been saved successfully.'), + { + id: 'setting_analytic_save' + }); }) .catch(() => { - this.notify.error(this.l10n.t('An unexpected error has occurred. Settings not saved.')); + this.notify.error(this.l10n.t('An unexpected error has occurred. Settings not saved.'), + { + id: 'setting_analytic_error' + }); }) .finally(() => { this.set('isLoading', false); diff --git a/app/controllers/admin/settings/billing.js b/app/controllers/admin/settings/billing.js index 70d36c8c4c6..66cd5fc0b28 100644 --- a/app/controllers/admin/settings/billing.js +++ b/app/controllers/admin/settings/billing.js @@ -19,9 +19,15 @@ export default class extends Controller { this.set('isLoading', true); try { await this.model.save(); - this.notify.success(this.l10n.t('Admin Billing info has been saved successfully')); + this.notify.success(this.l10n.t('Admin Billing info has been saved successfully'), + { + id: 'admin_billing_save' + }); } catch (error) { - this.notify.error(this.l10n.t('An unexpected error has occurred. Settings not saved.')); + this.notify.error(this.l10n.t('An unexpected error has occurred. Settings not saved.'), + { + id: 'admin_billing_error' + }); } this.set('isLoading', false); } diff --git a/app/controllers/admin/settings/images.js b/app/controllers/admin/settings/images.js index 2aa4a2c26b1..f5613294d16 100644 --- a/app/controllers/admin/settings/images.js +++ b/app/controllers/admin/settings/images.js @@ -8,14 +8,23 @@ export default Controller.extend({ .then(() => { this.get('model.speakerImageSize').save() .then(() => { - this.notify.success(this.l10n.t('Image sizes have been saved successfully.')); + this.notify.success(this.l10n.t('Image sizes have been saved successfully.'), + { + id: 'image_size_save' + }); }) .catch(() => { - this.notify.error(this.l10n.t('An unexpected error has occurred. Image sizes not saved.')); + this.notify.error(this.l10n.t('An unexpected error has occurred. Image sizes not saved.'), + { + id: 'image_size_error' + }); }); }) .catch(() => { - this.notify.error(this.l10n.t('An unexpected error has occurred. Image sizes not saved.')); + this.notify.error(this.l10n.t('An unexpected error has occurred. Image sizes not saved.'), + { + id: 'image_size_error_unex' + }); }) .finally(() => { this.set('isLoading', false); diff --git a/app/controllers/admin/settings/index.js b/app/controllers/admin/settings/index.js index 71f90573c46..d3ebdaae365 100644 --- a/app/controllers/admin/settings/index.js +++ b/app/controllers/admin/settings/index.js @@ -7,10 +7,16 @@ export default Controller.extend({ let settings = this.model; settings.save() .then(() => { - this.notify.success(this.l10n.t('Settings have been saved successfully.')); + this.notify.success(this.l10n.t('Settings have been saved successfully.'), + { + id: 'setting_index_save' + }); }) .catch(() => { - this.notify.error(this.l10n.t('An unexpected error has occurred. Settings not saved.')); + this.notify.error(this.l10n.t('An unexpected error has occurred. Settings not saved.'), + { + id: 'setting_index_error' + }); }) .finally(() => { this.set('isLoading', false); diff --git a/app/controllers/admin/settings/microservices.js b/app/controllers/admin/settings/microservices.js index 71f90573c46..50efd0d8736 100644 --- a/app/controllers/admin/settings/microservices.js +++ b/app/controllers/admin/settings/microservices.js @@ -7,10 +7,16 @@ export default Controller.extend({ let settings = this.model; settings.save() .then(() => { - this.notify.success(this.l10n.t('Settings have been saved successfully.')); + this.notify.success(this.l10n.t('Settings have been saved successfully.'), + { + id: 'setting_microservice_save' + }); }) .catch(() => { - this.notify.error(this.l10n.t('An unexpected error has occurred. Settings not saved.')); + this.notify.error(this.l10n.t('An unexpected error has occurred. Settings not saved.'), + { + id: 'setting_microservice_error' + }); }) .finally(() => { this.set('isLoading', false); diff --git a/app/controllers/admin/settings/payment-gateway.js b/app/controllers/admin/settings/payment-gateway.js index 71f90573c46..4220f8ac550 100644 --- a/app/controllers/admin/settings/payment-gateway.js +++ b/app/controllers/admin/settings/payment-gateway.js @@ -7,10 +7,16 @@ export default Controller.extend({ let settings = this.model; settings.save() .then(() => { - this.notify.success(this.l10n.t('Settings have been saved successfully.')); + this.notify.success(this.l10n.t('Settings have been saved successfully.'), + { + id: 'setting_payment_save' + }); }) .catch(() => { - this.notify.error(this.l10n.t('An unexpected error has occurred. Settings not saved.')); + this.notify.error(this.l10n.t('An unexpected error has occurred. Settings not saved.'), + { + id: 'setting_payment_error' + }); }) .finally(() => { this.set('isLoading', false); diff --git a/app/controllers/admin/settings/ticket-fees.js b/app/controllers/admin/settings/ticket-fees.js index a2954cc5c49..99e52db10e1 100644 --- a/app/controllers/admin/settings/ticket-fees.js +++ b/app/controllers/admin/settings/ticket-fees.js @@ -9,15 +9,24 @@ export default Controller.extend({ return (!setting.get('currency') || !setting.get('country')); }); if (incorrect_settings.length > 0) { - this.notify.error(this.l10n.t('Please fill the required fields.')); + this.notify.error(this.l10n.t('Please fill the required fields.'), + { + id: 'fill_req_field' + }); this.set('isLoading', false); } else { settings.save() .then(() => { - this.notify.success(this.l10n.t('Ticket Fee settings have been saved successfully.')); + this.notify.success(this.l10n.t('Ticket Fee settings have been saved successfully.'), + { + id: 'ticket_fee_save' + }); }) .catch(() => { - this.notify.error(this.l10n.t('An unexpected error has occurred. Settings not saved.')); + this.notify.error(this.l10n.t('An unexpected error has occurred. Settings not saved.'), + { + id: 'ticket_fee_error' + }); }) .finally(() => { this.set('isLoading', false); diff --git a/app/controllers/admin/users/list.js b/app/controllers/admin/users/list.js index d843bd58697..305e89f07dd 100644 --- a/app/controllers/admin/users/list.js +++ b/app/controllers/admin/users/list.js @@ -12,10 +12,12 @@ export default class extends Controller.extend(EmberTableControllerMixin) { return [ { name : 'Name', - valuePath : 'id', - extraValuePaths : ['firstName', 'deletedAt'], + valuePath : 'firstName', + extraValuePaths : ['deletedAt', 'id', 'isSuperAdmin'], cellComponent : 'ui-table/cell/admin/users/cell-first-name', width : 155, + isSortable : true, + headerComponent : 'tables/headers/sort', options : { hasRestorePrivileges: this.hasRestorePrivileges }, @@ -27,9 +29,11 @@ export default class extends Controller.extend(EmberTableControllerMixin) { } }, { - name : 'Email', - valuePath : 'email', - width : 160 + name : 'Email', + valuePath : 'email', + width : 175, + isSortable : true, + headerComponent : 'tables/headers/sort' }, { name : 'Status', @@ -59,15 +63,19 @@ export default class extends Controller.extend(EmberTableControllerMixin) { cellComponent : 'ui-table/cell/admin/users/cell-user-links' }, { - name : 'Member Since', - valuePath : 'createdAt', - cellComponent : 'ui-table/cell/admin/users/cell-created-at' + name : 'Member Since', + valuePath : 'createdAt', + cellComponent : 'ui-table/cell/admin/users/cell-created-at', + isSortable : true, + headerComponent : 'tables/headers/sort' }, { - name : 'Last Accessed', - valuePath : 'lastAccessedAt', - cellComponent : 'ui-table/cell/cell-simple-date', - options : { + name : 'Last Accessed', + valuePath : 'lastAccessedAt', + isSortable : true, + headerComponent : 'tables/headers/sort', + cellComponent : 'ui-table/cell/cell-simple-date', + options : { dateFormat: 'MMMM DD, YYYY - hh:mm A' } } @@ -78,17 +86,25 @@ export default class extends Controller.extend(EmberTableControllerMixin) { moveToUserDetails(id) { this.transitionToRoute('admin.users.view', id); } + @action async deleteUser(user_id) { this.set('isLoading', true); try { let user = this.store.peekRecord('user', user_id, { backgroundReload: false }); await user.destroyRecord(); - this.notify.success(this.l10n.t('User has been deleted successfully.')); + this.notify.success(this.l10n.t('User has been deleted successfully.'), + { + id: 'user_delete_succ' + }); } catch (e) { - this.notify.error(this.l10n.t('An unexpected error has occurred.')); + this.notify.error(this.l10n.t('An unexpected error has occurred.'), + { + id: 'user_delete_error' + }); } + this.set('isLoading', false); } @@ -108,11 +124,18 @@ export default class extends Controller.extend(EmberTableControllerMixin) { let user = this.store.peekRecord('user', user_id, { backgroundReload: false }); user.set('deletedAt', null); user.save({ adapterOptions: { getTrashed: true } }); - this.notify.success(this.l10n.t('User has been restored successfully.')); + this.notify.success(this.l10n.t('User has been restored successfully.'), + { + id: 'user_restore' + }); } catch (e) { - this.notify.error(this.l10n.t('An unexpected error has occurred.')); + this.notify.error(this.l10n.t('An unexpected error has occurred.'), + { + id: 'user_restore_error' + }); console.warn(e); } + this.set('isLoading', false); } } diff --git a/app/controllers/admin/users/view/events/list.js b/app/controllers/admin/users/view/events/list.js index 46283be95aa..2ee97d9e2ad 100644 --- a/app/controllers/admin/users/view/events/list.js +++ b/app/controllers/admin/users/view/events/list.js @@ -34,6 +34,7 @@ export default class extends Controller.extend(EmberTableControllerMixin) { valuePath : 'startsAt', extraValuePaths : ['endsAt'], isSortable : true, + width : 170, headerComponent : 'tables/headers/sort', cellComponent : 'ui-table/cell/cell-event-date' @@ -50,14 +51,6 @@ export default class extends Controller.extend(EmberTableControllerMixin) { valuePath : 'eventStatisticsGeneral', cellComponent : 'ui-table/cell/cell-speakers-dashboard', isSortable : false - - }, - { - name : 'Tickets', - valuePath : 'tickets', - cellComponent : 'ui-table/cell/cell-tickets', - isSortable : false - }, { name : 'Public URL', diff --git a/app/controllers/event-invoice/paid.js b/app/controllers/event-invoice/paid.js index 48b9f96d4d5..6a9eae18492 100644 --- a/app/controllers/event-invoice/paid.js +++ b/app/controllers/event-invoice/paid.js @@ -13,11 +13,17 @@ export default class extends Controller { anchor.download = `${eventName}-EventInvoice-${orderId}.pdf`; document.body.appendChild(anchor); anchor.click(); - this.notify.success(this.l10n.t('Here is your Event Invoice')); + this.notify.success(this.l10n.t('Here is your Event Invoice'), + { + id: 'here_event_invoice' + }); document.body.removeChild(anchor); } catch (e) { console.warn(e); - this.notify.error(this.l10n.t('Unexpected error occurred.')); + this.notify.error(this.l10n.t('Unexpected error occurred.'), + { + id: 'event_here_error' + }); } this.set('isLoading', false); } diff --git a/app/controllers/events/list.js b/app/controllers/events/list.js index afa779eaf9d..6a390cbad08 100644 --- a/app/controllers/events/list.js +++ b/app/controllers/events/list.js @@ -27,8 +27,9 @@ export default class extends Controller.extend(EmberTableControllerMixin) { { name : 'Date', valuePath : 'startsAt', - extraValuePaths : ['endsAt'], + extraValuePaths : ['endsAt', 'timezone'], isSortable : true, + width : 180, headerComponent : 'tables/headers/sort', cellComponent : 'ui-table/cell/cell-event-date' @@ -50,11 +51,6 @@ export default class extends Controller.extend(EmberTableControllerMixin) { valuePath : 'eventStatisticsGeneral', cellComponent : 'ui-table/cell/cell-speakers-dashboard' }, - { - name : 'Tickets', - valuePath : 'tickets', - cellComponent : 'ui-table/cell/cell-tickets' - }, { name : 'Public URL', valuePath : 'url', @@ -96,10 +92,16 @@ export default class extends Controller.extend(EmberTableControllerMixin) { try { const event = this.store.peekRecord('event', this.eventId, { backgroundReload: false }); await event.destroyRecord(); - this.notify.success(this.l10n.t('Event has been deleted successfully.')); + this.notify.success(this.l10n.t('Event has been deleted successfully.'), + { + id: 'event_del_succ' + }); this.send('refreshRoute'); } catch (e) { - this.notify.error(this.l10n.t('An unexpected error has occurred.')); + this.notify.error(this.l10n.t('An unexpected error has occurred.'), + { + id: 'event_del_unex' + }); } this.setProperties({ isLoading : false, diff --git a/app/controllers/events/view.js b/app/controllers/events/view.js index dca42afdc76..38b9d7e1ecd 100644 --- a/app/controllers/events/view.js +++ b/app/controllers/events/view.js @@ -8,7 +8,10 @@ export default Controller.extend({ }, togglePublishState() { if (isEmpty(this.get('model.locationName'))) { - this.notify.error(this.l10n.t('Your event must have a location before it can be published.')); + this.notify.error(this.l10n.t('Your event must have a location before it can be published.'), + { + id: 'event_location' + }); return; } this.set('isLoading', true); @@ -17,14 +20,23 @@ export default Controller.extend({ this.model.save() .then(() => { if (state === 'draft') { - this.notify.success(this.l10n.t('Your event has been published successfully.')); + this.notify.success(this.l10n.t('Your event has been published successfully.'), + { + id: 'event_publish' + }); } else { - this.notify.success(this.l10n.t('Your event has been unpublished.')); + this.notify.success(this.l10n.t('Your event has been unpublished.'), + { + id: 'event_unpublish' + }); } }) .catch(() => { this.set('model.state', state); - this.notify.error(this.l10n.t('An unexpected error has occurred.')); + this.notify.error(this.l10n.t('An unexpected error has occurred.'), + { + id: 'event_publish_error' + }); }) .finally(() => { this.set('isLoading', false); @@ -35,10 +47,16 @@ export default Controller.extend({ this.model.destroyRecord() .then(() => { this.transitionToRoute('events'); - this.notify.success(this.l10n.t('Event has been deleted successfully.')); + this.notify.success(this.l10n.t('Event has been deleted successfully.'), + { + id: 'event_deleted_succ' + }); }) .catch(() => { - this.notify.error(this.l10n.t('An unexpected error has occurred.')); + this.notify.error(this.l10n.t('An unexpected error has occurred.'), + { + id: 'event_deleted_error' + }); }) .finally(() => { this.set('isLoading', false); @@ -51,10 +69,16 @@ export default Controller.extend({ .post(`events/${this.get('model.id')}/copy`, {}) .then(copiedEvent => { this.transitionToRoute('events.view.edit', copiedEvent.identifier); - this.notify.success(this.l10n.t('Event copied successfully')); + this.notify.success(this.l10n.t('Event copied successfully'), + { + id: 'event_copy_succ' + }); }) .catch(() => { - this.notify.error(this.l10n.t('Copying of event failed')); + this.notify.error(this.l10n.t('Copying of event failed'), + { + id: 'event_copy_fail' + }); }) .finally(() => { this.set('isCopying', false); diff --git a/app/controllers/events/view/edit/attendee.js b/app/controllers/events/view/edit/attendee.js index 79e01f44067..55dfae876f9 100644 --- a/app/controllers/events/view/edit/attendee.js +++ b/app/controllers/events/view/edit/attendee.js @@ -17,7 +17,10 @@ export default Controller.extend(EventWizardMixin, { ['tickets'] ); } catch (error) { - this.notify.error(this.l10n.t(error.message)); + this.notify.error(this.l10n.t(error.message), + { + id: 'attendee_error_serv' + }); } }, async move(direction, data) { @@ -28,7 +31,10 @@ export default Controller.extend(EventWizardMixin, { ['tickets'] ); } catch (error) { - this.notify.error(this.l10n.t(error.message)); + this.notify.error(this.l10n.t(error.message), + { + id: 'attendee_move_error' + }); } } } diff --git a/app/controllers/events/view/export.js b/app/controllers/events/view/export.js index d131897563d..85d0d0917d3 100644 --- a/app/controllers/events/view/export.js +++ b/app/controllers/events/view/export.js @@ -19,19 +19,31 @@ export default Controller.extend({ this.set('isDownloadDisabled', false); this.set('eventDownloadUrl', exportJobStatus.result.download_url); this.set('eventExportStatus', exportJobStatus.state); - this.notify.success(this.l10n.t('Event exported.')); + this.notify.success(this.l10n.t('Event exported.'), + { + id: 'event_export_succ' + }); } else if (exportJobStatus.state === 'WAITING') { this.requestLoop(exportJobInfo); this.set('eventExportStatus', exportJobStatus.state); - this.notify.alert(this.l10n.t('Event export is going on.')); + this.notify.alert(this.l10n.t('Event export is going on.'), + { + id: 'event_export_inprog' + }); } else { this.set('eventExportStatus', exportJobStatus.state); - this.notify.error(this.l10n.t('Event export failed.')); + this.notify.error(this.l10n.t('Event export failed.'), + { + id: 'export_fail' + }); } }) .catch(() => { this.set('eventExportStatus', 'FAILURE'); - this.notify.error(this.l10n.t('Event export failed.')); + this.notify.error(this.l10n.t('Event export failed.'), + { + id: 'event_exp_fail' + }); }) .finally(() => { this.set('isLoading', false); @@ -49,7 +61,10 @@ export default Controller.extend({ }) .catch(() => { this.set('isLoading', false); - this.notify.error(this.l10n.t('Unexpected error occurred.')); + this.notify.error(this.l10n.t('Unexpected error occurred.'), + { + id: 'event_error_export' + }); }); } } diff --git a/app/controllers/events/view/index.js b/app/controllers/events/view/index.js index cb4d9b4a1e8..74061185446 100644 --- a/app/controllers/events/view/index.js +++ b/app/controllers/events/view/index.js @@ -47,11 +47,17 @@ export default class extends Controller.extend(EmberTableControllerMixin) { let sponsor = this.store.peekRecord('sponsor', sponsor_id, { backgroundReload: false }); sponsor.destroyRecord() .then(() => { - this.notify.success(this.l10n.t('Sponsor has been deleted successfully.')); + this.notify.success(this.l10n.t('Sponsor has been deleted successfully.'), + { + id: 'spons_deleted' + }); this.refreshModel.bind(this)(); }) .catch(() => { - this.notify.error(this.l10n.t('An unexpected error has occurred.')); + this.notify.error(this.l10n.t('An unexpected error has occurred.'), + { + id: 'spons_deleted_error' + }); }) .finally(() => { this.set('isLoading', false); diff --git a/app/controllers/events/view/scheduler.js b/app/controllers/events/view/scheduler.js index 3b7545dbf96..c6e9b1209f1 100644 --- a/app/controllers/events/view/scheduler.js +++ b/app/controllers/events/view/scheduler.js @@ -48,7 +48,10 @@ export default Controller.extend({ return this.loader .patch(`sessions/${sessionId}`, JSON.stringify(payload), config) .then(() => { - this.notify.success('Changes have been made successfully'); + this.notify.success('Changes have been made successfully', + { + id: 'schedu_change' + }); }) .catch(reason => { this.set('error', reason); @@ -90,11 +93,17 @@ export default Controller.extend({ event.set('schedulePublishedOn', publishedAt); event.save() .then(() => { - this.notify.success(`The schedule has been ${action} successfully`); + this.notify.success(`The schedule has been ${action} successfully`, + { + id: 'schedule_change_succ' + }); }) .catch(reason => { this.set('error', reason); - this.notify.error(`Error: ${reason}`); + this.notify.error(`Error: ${reason}`, + { + id: 'error_reason_scheduler' + }); }) .finally(() => { this.set('isLoading', false); diff --git a/app/controllers/events/view/sessions.js b/app/controllers/events/view/sessions.js index f9b4b67a5ad..8cda99636aa 100644 --- a/app/controllers/events/view/sessions.js +++ b/app/controllers/events/view/sessions.js @@ -21,7 +21,10 @@ export default Controller.extend({ }) .catch(() => { this.set('isLoading', false); - this.notify.error(this.l10n.t('An unexpected error has occurred.')); + this.notify.error(this.l10n.t('An unexpected error has occurred.'), + { + id: 'session_unexp_error' + }); }); } }, @@ -33,16 +36,28 @@ export default Controller.extend({ .then(exportJobStatus => { if (exportJobStatus.state === 'SUCCESS') { window.location = exportJobStatus.result.download_url; - this.notify.success(this.l10n.t('Download Ready')); + this.notify.success(this.l10n.t('Download Ready'), + { + id: 'download_ready' + }); } else if (exportJobStatus.state === 'WAITING') { this.requestLoop(exportJobInfo); - this.notify.alert(this.l10n.t('Task is going on.')); + this.notify.alert(this.l10n.t('Task is going on.'), + { + id: 'task_going' + }); } else { - this.notify.error(this.l10n.t('CSV Export has failed.')); + this.notify.error(this.l10n.t('CSV Export has failed.'), + { + id: 'csv_fail' + }); } }) .catch(() => { - this.notify.error(this.l10n.t('CSV Export has failed.')); + this.notify.error(this.l10n.t('CSV Export has failed.'), + { + id: 'csv_export_fail' + }); }) .finally(() => { this.set('isLoading', false); diff --git a/app/controllers/events/view/sessions/create.js b/app/controllers/events/view/sessions/create.js index 7856f30d369..b25843facdb 100644 --- a/app/controllers/events/view/sessions/create.js +++ b/app/controllers/events/view/sessions/create.js @@ -2,7 +2,6 @@ import Controller from '@ember/controller'; export default Controller.extend({ actions: { async save() { - let _this = this; await this.get('model.session').save(); if (this.addNewSpeaker) { let newSpeaker = this.get('model.speaker'); @@ -11,21 +10,30 @@ export default Controller.extend({ } newSpeaker.save() .then(() => { - newSpeaker.sessions.pushObject(_this.get('model.session')); - _this.get('model.session').save() + newSpeaker.sessions.pushObject(this.model.session); + this.model.session.save() .then(() => { - _this.get('notify').success(_this.get('l10n').t('Your session has been saved')); - _this.transitionToRoute('events.view.sessions', _this.get('model.event.id')); + this.notify.success(this.l10n.t('Your session has been saved'), + { + id: 'session_save_dash' + }); + this.transitionToRoute('events.view.sessions', this.model.event.id); }) .catch(() => { - _this.get('notify').error(this.l10n.t('Oops something went wrong. Please try again')); + this.notify.error(this.l10n.t('Oops something went wrong. Please try again'), + { + id: 'session_crea_some_error' + }); }) .finally(() => { - _this.set('isLoading', false); + this.set('isLoading', false); }); }) .catch(() => { - this.notify.error(this.l10n.t('Oops something went wrong. Please try again')); + this.notify.error(this.l10n.t('Oops something went wrong. Please try again'), + { + id: 'error_unexp_session' + }); }) .finally(() => { this.set('isLoading', false); @@ -33,11 +41,17 @@ export default Controller.extend({ } else { this.get('model.session').save() .then(() => { - this.notify.success(this.l10n.t('Your session has been saved')); + this.notify.success(this.l10n.t('Your session has been saved'), + { + id: 'session_save' + }); this.transitionToRoute('events.view.sessions', this.get('model.event.id')); }) .catch(() => { - this.notify.error(this.l10n.t('Oops something went wrong. Please try again')); + this.notify.error(this.l10n.t('Oops something went wrong. Please try again'), + { + id: 'session_error_wrong' + }); }) .finally(() => { this.set('isLoading', false); diff --git a/app/controllers/events/view/sessions/edit.js b/app/controllers/events/view/sessions/edit.js index c12eadb11db..4874a3fe982 100644 --- a/app/controllers/events/view/sessions/edit.js +++ b/app/controllers/events/view/sessions/edit.js @@ -4,7 +4,6 @@ export default Controller.extend({ actions: { save() { this.set('isLoading', true); - let _this = this; if (this.addNewSpeaker) { let newSpeaker = this.get('model.speaker'); if (newSpeaker.isEmailOverridden) { @@ -12,34 +11,49 @@ export default Controller.extend({ } newSpeaker.save() .then(() => { - newSpeaker.sessions.pushObject(_this.get('model.session')); - _this.get('model.session').save() + newSpeaker.sessions.pushObject(this.model.session); + this.model.session.save() .then(() => { - _this.get('notify').success(_this.get('l10n').t('Your session has been saved')); - _this.transitionToRoute('events.view.sessions', _this.get('model.event.id')); + this.notify.success(this.l10n.t('Your session has been saved'), + { + id: 'session_edit_save' + }); + this.transitionToRoute('events.view.sessions', this.model.event.id); }) .catch(() => { - _this.get('notify').error(this.l10n.t('Oops something went wrong. Please try again')); + this.notify.error(this.l10n.t('Oops something went wrong. Please try again'), + { + id: 'session_edit_error' + }); }) .finally(() => { - _this.set('isLoading', false); + this.set('isLoading', false); }); }) .catch(() => { - this.notify.error(this.l10n.t('Oops something went wrong. Please try again')); + this.notify.error(this.l10n.t('Oops something went wrong. Please try again'), + { + id: 'session_edit_wrong' + }); }) .finally(() => { this.set('isLoading', false); }); } else { - this.get('model.speaker').deleteRecord(); - this.get('model.session').save() + this.model.speaker.deleteRecord(); + this.model.session.save() .then(() => { - this.notify.success(this.l10n.t('Your session has been saved')); - this.transitionToRoute('events.view.sessions', this.get('model.event.id')); + this.notify.success(this.l10n.t('Your session has been saved'), + { + id: 'session_saved' + }); + this.transitionToRoute('events.view.sessions', this.model.event.id); }) .catch(() => { - this.notify.error(this.l10n.t('Oops something went wrong. Please try again')); + this.notify.error(this.l10n.t('Oops something went wrong. Please try again'), + { + id: 'session_edit_error' + }); }) .finally(() => { this.set('isLoading', false); diff --git a/app/controllers/events/view/sessions/list.js b/app/controllers/events/view/sessions/list.js index 4e615d45c4c..03cadbbebcc 100644 --- a/app/controllers/events/view/sessions/list.js +++ b/app/controllers/events/view/sessions/list.js @@ -117,11 +117,17 @@ export default class extends Controller.extend(EmberTableControllerMixin) { let session = this.store.peekRecord('session', session_id, { backgroundReload: false }); session.destroyRecord() .then(() => { - this.notify.success(this.l10n.t('Session has been deleted successfully.')); + this.notify.success(this.l10n.t('Session has been deleted successfully.'), + { + id: 'session_del_tab' + }); this.refreshModel.bind(this)(); }) .catch(() => { - this.notify.error(this.l10n.t('An unexpected error has occurred.')); + this.notify.error(this.l10n.t('An unexpected error has occurred.'), + { + id: 'session_unex_del' + }); }) .finally(() => { this.set('isLoading', false); @@ -145,11 +151,17 @@ export default class extends Controller.extend(EmberTableControllerMixin) { this.set('isLoading', true); session.save() .then(() => { - this.notify.success(this.l10n.t('Session has been locked successfully.')); + this.notify.success(this.l10n.t('Session has been locked successfully.'), + { + id: 'session_locked' + }); this.refreshModel.bind(this)(); }) .catch(() => { - this.notify.error(this.l10n.t('An unexpected error has occurred.')); + this.notify.error(this.l10n.t('An unexpected error has occurred.'), + { + id: 'session_lock_error' + }); }) .finally(() => { this.set('isLoading', false); @@ -163,11 +175,17 @@ export default class extends Controller.extend(EmberTableControllerMixin) { this.set('isLoading', true); session.save() .then(() => { - this.notify.success(this.l10n.t('Session has been unlocked successfully.')); + this.notify.success(this.l10n.t('Session has been unlocked successfully.'), + { + id: 'session_unlock' + }); this.refreshModel.bind(this)(); }) .catch(() => { - this.notify.error(this.l10n.t('An unexpected error has occurred.')); + this.notify.error(this.l10n.t('An unexpected error has occurred.'), + { + id: 'session_unexpected_unlock' + }); }) .finally(() => { this.set('isLoading', false); @@ -185,12 +203,21 @@ export default class extends Controller.extend(EmberTableControllerMixin) { this.set('isLoading', true); session.save() .then(() => { - sendEmail ? this.notify.success(this.l10n.t('Session has been accepted and speaker has been notified via email.')) - : this.notify.success(this.l10n.t('Session has been accepted')); + sendEmail ? this.notify.success(this.l10n.t('Session has been accepted and speaker has been notified via email.'), + { + id: 'session_accep_email' + }) + : this.notify.success(this.l10n.t('Session has been accepted'), + { + id: 'session_accep' + }); this.refreshModel.bind(this)(); }) .catch(() => { - this.notify.error(this.l10n.t('An unexpected error has occurred.')); + this.notify.error(this.l10n.t('An unexpected error has occurred.'), + { + id: 'session_unex_error' + }); }) .finally(() => { this.set('isLoading', false); @@ -208,12 +235,21 @@ export default class extends Controller.extend(EmberTableControllerMixin) { this.set('isLoading', true); session.save() .then(() => { - sendEmail ? this.notify.success(this.l10n.t('Session has been confirmed and speaker has been notified via email.')) - : this.notify.success(this.l10n.t('Session has been confirmed')); + sendEmail ? this.notify.success(this.l10n.t('Session has been confirmed and speaker has been notified via email.'), + { + id: 'session_confirm_email' + }) + : this.notify.success(this.l10n.t('Session has been confirmed'), + { + id: 'session_confirm' + }); this.refreshModel.bind(this)(); }) .catch(() => { - this.notify.error(this.l10n.t('An unexpected error has occurred.')); + this.notify.error(this.l10n.t('An unexpected error has occurred.'), + { + id: 'session_confirm_unexpected' + }); }) .finally(() => { this.set('isLoading', false); @@ -231,12 +267,21 @@ export default class extends Controller.extend(EmberTableControllerMixin) { this.set('isLoading', true); session.save() .then(() => { - sendEmail ? this.notify.success(this.l10n.t('Session has been rejected and speaker has been notified via email.')) - : this.notify.success(this.l10n.t('Session has been rejected')); + sendEmail ? this.notify.success(this.l10n.t('Session has been rejected and speaker has been notified via email.'), + { + id: 'session_reject_email' + }) + : this.notify.success(this.l10n.t('Session has been rejected'), + { + id: 'session_rejected' + }); this.refreshModel.bind(this)(); }) .catch(() => { - this.notify.error(this.l10n.t('An unexpected error has occurred.')); + this.notify.error(this.l10n.t('An unexpected error has occurred.'), + { + id: 'session_reject_error' + }); }) .finally(() => { this.set('isLoading', false); @@ -250,11 +295,17 @@ export default class extends Controller.extend(EmberTableControllerMixin) { feedback.set('rating', rating); feedback.save() .then(() => { - this.notify.success(this.l10n.t('Session feedback has been updated successfully.')); + this.notify.success(this.l10n.t('Session feedback has been updated successfully.'), + { + id: 'session_feedback' + }); this.refreshModel.bind(this)(); }) .catch(() => { - this.notify.error(this.l10n.t('An unexpected error has occurred.')); + this.notify.error(this.l10n.t('An unexpected error has occurred.'), + { + id: 'session_feedback_error' + }); }) .finally(() => { this.set('isLoading', false); @@ -262,11 +313,17 @@ export default class extends Controller.extend(EmberTableControllerMixin) { } else { feedback.destroyRecord() .then(() => { - this.notify.success(this.l10n.t('Session feedback has been updated successfully.')); + this.notify.success(this.l10n.t('Session feedback has been updated successfully.'), + { + id: 'session_feed_update' + }); this.refreshModel.bind(this)(); }) .catch(() => { - this.notify.error(this.l10n.t('An unexpected error has occurred.')); + this.notify.error(this.l10n.t('An unexpected error has occurred.'), + { + id: 'session_feed_error' + }); }) .finally(() => { this.set('isLoading', false); @@ -286,11 +343,17 @@ export default class extends Controller.extend(EmberTableControllerMixin) { }); feedback.save() .then(() => { - this.notify.success(this.l10n.t('Session feedback has been created successfully.')); + this.notify.success(this.l10n.t('Session feedback has been created successfully.'), + { + id: 'session_feed_created' + }); this.refreshModel.bind(this)(); }) .catch(() => { - this.notify.error(this.l10n.t('An unexpected error has occurred.')); + this.notify.error(this.l10n.t('An unexpected error has occurred.'), + { + id: 'session_feed_error_created' + }); }) .finally(() => { this.set('isLoading', false); diff --git a/app/controllers/events/view/speakers/list.js b/app/controllers/events/view/speakers/list.js index fa2d749ce99..0755852034a 100644 --- a/app/controllers/events/view/speakers/list.js +++ b/app/controllers/events/view/speakers/list.js @@ -14,12 +14,16 @@ export default class extends Controller.extend(EmberTableControllerMixin) { cellComponent : 'ui-table/cell/events/view/speakers/speaker-logo' }, { - name : 'Name', - valuePath : 'name' + name : 'Name', + valuePath : 'name', + isSortable : true, + headerComponent : 'tables/headers/sort' }, { - name : 'Email', - valuePath : 'email' + name : 'Email', + valuePath : 'email', + isSortable : true, + headerComponent : 'tables/headers/sort' }, { name : 'Phone', diff --git a/app/controllers/events/view/tickets/attendees/list.js b/app/controllers/events/view/tickets/attendees/list.js index 2cf25b805f2..041066527b0 100644 --- a/app/controllers/events/view/tickets/attendees/list.js +++ b/app/controllers/events/view/tickets/attendees/list.js @@ -10,35 +10,42 @@ export default class extends Controller.extend(EmberTableControllerMixin) { return [ { name : 'Order', + width : 190, valuePath : 'order', extraValuePaths : ['user', 'status', 'paidVia', 'completedAt', 'createdAt'], cellComponent : 'ui-table/cell/events/view/tickets/attendees/cell-order' }, { name : 'Ticket Name', + width : 110, valuePath : 'ticket.name' }, { name : 'Ticket Price', valuePath : 'ticket.price', + width : 100, extraValuePaths : ['event', 'discountCode'], cellComponent : 'ui-table/cell/events/view/tickets/attendees/cell-price' }, { name : 'First Name', - valuePath : 'firstname' + valuePath : 'firstname', + width : 100 }, { name : 'Last Name', - valuePath : 'lastname' + valuePath : 'lastname', + width : 90 }, { name : 'Email', - valuePath : 'email' + valuePath : 'email', + width : 160 }, { name : 'Actions', valuePath : 'id', + width : 130, extraValuePaths : ['order', 'isCheckedIn'], cellComponent : 'ui-table/cell/events/view/tickets/attendees/cell-action', actions : { diff --git a/app/controllers/events/view/tickets/discount-codes/list.js b/app/controllers/events/view/tickets/discount-codes/list.js index 3ada0ded4fb..beb81222f00 100644 --- a/app/controllers/events/view/tickets/discount-codes/list.js +++ b/app/controllers/events/view/tickets/discount-codes/list.js @@ -9,33 +9,39 @@ export default class extends Controller.extend(EmberTableControllerMixin) { return [ { name : 'Discount code', + width : 100, valuePath : 'code' }, { name : 'Discount code URL', valuePath : 'discountUrl', + width : 220, cellComponent : 'ui-table/cell/events/view/tickets/discount-codes/cell-url' }, { name : 'Discount Per Ticket', valuePath : 'value', + width : 90, extraValuePaths : ['type', 'event'], cellComponent : 'ui-table/cell/events/view/tickets/discount-codes/cell-value' }, { name : 'Validity', valuePath : 'validTill', + width : 120, cellComponent : 'ui-table/cell/events/view/tickets/discount-codes/cell-validity' }, { name : 'Status', valuePath : 'isActive', + width : 100, extraValuePaths : ['isExpired'], cellComponent : 'ui-table/cell/events/view/tickets/discount-codes/cell-status' }, { name : 'Actions', valuePath : 'id', + width : 170, extraValuePaths : ['isActive', 'isExpired'], cellComponent : 'ui-table/cell/events/view/tickets/discount-codes/cell-actions', actions : { @@ -88,6 +94,4 @@ export default class extends Controller.extend(EmberTableControllerMixin) { editDiscountCode(id) { this.transitionToRoute('events.view.tickets.discount-codes.edit', id); } - - } diff --git a/app/controllers/index.js b/app/controllers/index.js index ad8d2a6446c..5bebdd68d12 100644 --- a/app/controllers/index.js +++ b/app/controllers/index.js @@ -7,7 +7,7 @@ export default Controller.extend({ start_date : null, end_date : null, location : null, - name : null, + event_name : null, filterDate : null, callForSpeakersEvents: computed('filteredEvents.[]', function() { diff --git a/app/controllers/my-sessions/view.js b/app/controllers/my-sessions/view.js index 2d6b24793d7..91f80b095f0 100644 --- a/app/controllers/my-sessions/view.js +++ b/app/controllers/my-sessions/view.js @@ -1,34 +1,44 @@ import Controller from '@ember/controller'; -import { computed } from '@ember/object'; +import { computed, action } from '@ember/object'; import moment from 'moment'; -export default Controller.extend({ - isUpcoming: computed('model.endsAt', function() { +export default class extends Controller { + + @computed('model.endsAt') + get isUpcoming() { let endAt = this.get('model.endsAt'); if (endAt < moment()) { return false; } + return true; - }), + } - actions: { - openProposalDeleteModal() { - this.set('isProposalDeleteModalOpen', true); - }, - deleteProposal() { - this.set('isLoading', true); - this.model.destroyRecord() - .then(() => { - this.transitionToRoute('my-sessions.index'); - this.notify.success(this.l10n.t('Proposal has been deleted successfully.')); - }) - .catch(() => { - this.notify.error(this.l10n.t('An unexpected error has occurred.')); - }) - .finally(() => { - this.set('isLoading', false); - this.set('isProposalDeleteModalOpen', false); - }); - } + @action + openProposalDeleteModal() { + this.set('isProposalDeleteModalOpen', true); + } + + @action + deleteProposal() { + this.set('isLoading', true); + this.model.destroyRecord() + .then(() => { + this.transitionToRoute('my-sessions.index'); + this.notify.success(this.l10n.t('Proposal has been deleted successfully.'), + { + id: 'prop_del' + }); + }) + .catch(() => { + this.notify.error(this.l10n.t('An unexpected error has occurred.'), + { + id: 'view_unex_error' + }); + }) + .finally(() => { + this.set('isLoading', false); + this.set('isProposalDeleteModalOpen', false); + }); } -}); +} \ No newline at end of file diff --git a/app/controllers/my-tickets/past.js b/app/controllers/my-tickets/past.js index 13f0454968f..9fc93d64fda 100644 --- a/app/controllers/my-tickets/past.js +++ b/app/controllers/my-tickets/past.js @@ -1,9 +1,10 @@ import Controller from '@ember/controller'; -export default Controller.extend({ - actions: { - shareEvent(event) { - this.set('eventToShare', event); - this.set('isShareModalOpen', true); - } +import { action } from '@ember/object'; + +export default class extends Controller { + @action + shareEvent(event) { + this.set('eventToShare', event); + this.set('isShareModalOpen', true); } -}); +} diff --git a/app/controllers/my-tickets/upcoming.js b/app/controllers/my-tickets/upcoming.js index 13f0454968f..9fc93d64fda 100644 --- a/app/controllers/my-tickets/upcoming.js +++ b/app/controllers/my-tickets/upcoming.js @@ -1,9 +1,10 @@ import Controller from '@ember/controller'; -export default Controller.extend({ - actions: { - shareEvent(event) { - this.set('eventToShare', event); - this.set('isShareModalOpen', true); - } +import { action } from '@ember/object'; + +export default class extends Controller { + @action + shareEvent(event) { + this.set('eventToShare', event); + this.set('isShareModalOpen', true); } -}); +} diff --git a/app/controllers/notifications.js b/app/controllers/notifications.js index d22f8b7e397..399f28be0ce 100644 --- a/app/controllers/notifications.js +++ b/app/controllers/notifications.js @@ -11,10 +11,16 @@ export default Controller.extend({ item.save(); } }); - this.notify.success(this.l10n.t('All notifications marked read successfully')); + this.notify.success(this.l10n.t('All notifications marked read successfully'), + { + id: 'mark_read' + }); }) .catch(() => { - this.notify.error(this.l10n.t('An unexpected error occurred.')); + this.notify.error(this.l10n.t('An unexpected error occurred.'), + { + id: 'mark_read_error' + }); }); } } diff --git a/app/controllers/orders/new.js b/app/controllers/orders/new.js index 50caa935ea2..2d7bf76ca3d 100644 --- a/app/controllers/orders/new.js +++ b/app/controllers/orders/new.js @@ -26,23 +26,35 @@ export default Controller.extend({ await order.save() .then(order => { if (order.status === 'pending') { - this.notify.success(this.l10n.t('Order details saved. Please fill the payment details')); + this.notify.success(this.l10n.t('Order details saved. Please fill the payment details'), + { + id: 'order_det_save' + }); this.transitionToRoute('orders.pending', order.identifier); } else if (order.status === 'completed' || order.status === 'placed') { - this.notify.success(this.l10n.t('Order details saved. Your order is successful')); + this.notify.success(this.l10n.t('Order details saved. Your order is successful'), + { + id: 'order_succ' + }); this.transitionToRoute('orders.view', order.identifier); } }) .catch(e => { order.set('status', 'initializing'); - this.notify.error(this.l10n.t(` ${e} Oops something went wrong. Please try again`)); + this.notify.error(this.l10n.t(` ${e} Oops something went wrong. Please try again`), + { + id: 'order_stat_error' + }); }) .finally(() => { this.set('isLoading', false); }); } catch (e) { this.set('isLoading', false); - this.notify.error(this.l10n.t('Oops something went wrong. Please try again')); + this.notify.error(this.l10n.t('Oops something went wrong. Please try again'), + { + id: 'some_error' + }); } } } diff --git a/app/controllers/orders/pending.js b/app/controllers/orders/pending.js index 738a7c34368..5ce16df1a34 100644 --- a/app/controllers/orders/pending.js +++ b/app/controllers/orders/pending.js @@ -45,7 +45,10 @@ export default Controller.extend({ async alipayCheckout(order_identifier) { try { const res = await this.loader.load(`alipay/create_source/${order_identifier}`); - this.notify.success(this.l10n.t('Payment has succeeded')); + this.notify.success(this.l10n.t('Payment has succeeded'), + { + id: 'payment_succ' + }); window.location.replace(res.link); } catch (error) { this.notify.error(this.l10n.t(error.error)); @@ -127,7 +130,10 @@ export default Controller.extend({ }) .catch(e => { console.warn(e); - this.notify.error(this.l10n.t('An unexpected error has occurred')); + this.notify.error(this.l10n.t('An unexpected error has occurred'), + { + id: 'unexpected_error_occur' + }); }) .finally(() => { this.set('isLoading', false); diff --git a/app/controllers/orders/view.js b/app/controllers/orders/view.js index 5e30bf22352..1f4fea12139 100644 --- a/app/controllers/orders/view.js +++ b/app/controllers/orders/view.js @@ -17,7 +17,10 @@ export default Controller.extend({ anchor.download = `${eventName}-Invoice-${orderId}.pdf`; document.body.appendChild(anchor); anchor.click(); - this.notify.success(this.l10n.t('Here is your Order Invoice')); + this.notify.success(this.l10n.t('Here is your Order Invoice'), + { + id: 'order_invoi' + }); document.body.removeChild(anchor); }) .catch(e => { @@ -46,12 +49,18 @@ export default Controller.extend({ anchor.download = `${eventName}-Tickets-${orderId}.pdf`; document.body.appendChild(anchor); anchor.click(); - this.notify.success(this.l10n.t('Here are your tickets')); + this.notify.success(this.l10n.t('Here are your tickets'), + { + id: 'tick_pdf' + }); document.body.removeChild(anchor); }) .catch(e => { console.warn(e); - this.notify.error(this.l10n.t('An unexpected Error occurred')); + this.notify.error(this.l10n.t('An unexpected Error occurred'), + { + id: 'unexpected_occur' + }); }) .finally(() => { this.set('isLoadingTickets', false); diff --git a/app/controllers/public/cfs/edit-session.js b/app/controllers/public/cfs/edit-session.js index 1cab8edf640..c9407684f3e 100644 --- a/app/controllers/public/cfs/edit-session.js +++ b/app/controllers/public/cfs/edit-session.js @@ -6,11 +6,17 @@ export default Controller.extend({ this.set('isLoading', true); this.get('model.session').save() .then(() => { - this.notify.success(this.l10n.t('Session details have been saved')); + this.notify.success(this.l10n.t('Session details have been saved'), + { + id: 'session_save' + }); this.transitionToRoute('public.cfs'); }) .catch(() => { - this.notify.error(this.l10n.t('Oops something went wrong. Please try again')); + this.notify.error(this.l10n.t('Oops something went wrong. Please try again'), + { + id: 'sess_error' + }); }) .finally(() => { this.set('isLoading', false); diff --git a/app/controllers/public/cfs/edit-speaker.js b/app/controllers/public/cfs/edit-speaker.js index bd24ff29f24..5a480d313f4 100644 --- a/app/controllers/public/cfs/edit-speaker.js +++ b/app/controllers/public/cfs/edit-speaker.js @@ -6,11 +6,17 @@ export default Controller.extend({ this.set('isLoading', true); this.get('model.speaker').save() .then(() => { - this.notify.success(this.l10n.t('Speaker details have been saved')); + this.notify.success(this.l10n.t('Speaker details have been saved'), + { + id: 'speaker_det_save' + }); this.transitionToRoute('public.cfs.index'); }) .catch(() => { - this.notify.error(this.l10n.t('Oops something went wrong. Please try again')); + this.notify.error(this.l10n.t('Oops something went wrong. Please try again'), + { + id: 'some_error' + }); }) .finally(() => { this.set('isLoading', false); diff --git a/app/controllers/public/cfs/new-session.js b/app/controllers/public/cfs/new-session.js index bc432bfbe83..84db21b8439 100644 --- a/app/controllers/public/cfs/new-session.js +++ b/app/controllers/public/cfs/new-session.js @@ -7,7 +7,10 @@ export default Controller.extend({ await this.get('model.session').save(); speakerDetails.sessions.pushObject(this.get('model.session')); await this.get('model.session').save(); - this.notify.success(this.l10n.t('Your session has been saved')); + this.notify.success(this.l10n.t('Your session has been saved'), + { + id: 'sess_save_succ' + }); this.transitionToRoute('public.cfs.index'); } catch (e) { this.notify.error(this.l10n.t('Oops something went wrong. Please try again')); diff --git a/app/controllers/public/cfs/new-speaker.js b/app/controllers/public/cfs/new-speaker.js index bd24ff29f24..552c535a1ac 100644 --- a/app/controllers/public/cfs/new-speaker.js +++ b/app/controllers/public/cfs/new-speaker.js @@ -6,7 +6,10 @@ export default Controller.extend({ this.set('isLoading', true); this.get('model.speaker').save() .then(() => { - this.notify.success(this.l10n.t('Speaker details have been saved')); + this.notify.success(this.l10n.t('Speaker details have been saved'), + { + id: 'speaker_det_save' + }); this.transitionToRoute('public.cfs.index'); }) .catch(() => { diff --git a/app/helpers/general-date.js b/app/helpers/general-date.js new file mode 100644 index 00000000000..ded0c1af026 --- /dev/null +++ b/app/helpers/general-date.js @@ -0,0 +1,9 @@ +import Helper from '@ember/component/helper'; +import moment from 'moment'; + +export function generalDate(params) { + let timezone = params[1] ? params[1] : moment.tz.guess(); + return `${moment(params[0]).tz(timezone).format('h:mm A , MMMM Do YYYY')} (${moment.tz(params[0], timezone).zoneAbbr()})`; +} + +export default Helper.helper(generalDate); diff --git a/app/helpers/header-date.js b/app/helpers/header-date.js index 8df0fae1b8d..961a1d64b4c 100644 --- a/app/helpers/header-date.js +++ b/app/helpers/header-date.js @@ -6,4 +6,4 @@ export function headerDate(params) { return `${moment(params[0]).tz(timezone).format('dddd, MMMM Do YYYY, h:mm A')} (${moment.tz(params[0], timezone).zoneAbbr()})`; } -export default Helper.helper(headerDate); +export default Helper.helper(headerDate); \ No newline at end of file diff --git a/app/models/custom-form.js b/app/models/custom-form.js index 6e005c4814d..1716ed427d5 100644 --- a/app/models/custom-form.js +++ b/app/models/custom-form.js @@ -84,14 +84,15 @@ export default ModelBase.extend({ name: computed('fieldIdentifier', 'form', function() { let name = this.fieldIdentifier; - if (this.form === 'session') { - name = this.get(`session.${name}`); - } else if (this.form === 'speaker') { - name = this.get(`speaker.${name}`); - } else { - name = this.get(`attendee.${name}`); + if (!this.isComplex) { + if (this.form === 'session') { + name = this.get(`session.${name}`); + } else if (this.form === 'speaker') { + name = this.get(`speaker.${name}`); + } else { + name = this.get(`attendee.${name}`); + } } - return name; }), diff --git a/app/routes/admin/events/list.js b/app/routes/admin/events/list.js index e1d7f3b9d60..a2ae545be6f 100644 --- a/app/routes/admin/events/list.js +++ b/app/routes/admin/events/list.js @@ -117,10 +117,9 @@ export default class extends Route.extend(EmberTableRouteMixin) { } filterOptions = this.applySearchFilters(filterOptions, params, searchField); - let queryString = { get_trashed : true, - include : 'tickets,sessions,speakers,owner,organizers,coorganizers,track-organizers,registrars,moderators', + include : 'owner,organizers,coorganizers,track-organizers,registrars,moderators', filter : filterOptions, 'page[size]' : params.per_page || 10, 'page[number]' : params.page || 1 diff --git a/app/routes/admin/users/view/events/list.js b/app/routes/admin/users/view/events/list.js index 7a345b3d968..cf5321dd9c0 100644 --- a/app/routes/admin/users/view/events/list.js +++ b/app/routes/admin/users/view/events/list.js @@ -100,7 +100,6 @@ export default class extends Route.extend(EmberTableRouteMixin) { filterOptions = this.applySearchFilters(filterOptions, params, searchField); let queryString = { get_trashed : true, - include : 'tickets,sessions,speakers', filter : filterOptions, 'page[size]' : params.per_page || 10, 'page[number]' : params.page || 1 diff --git a/app/routes/events/list.js b/app/routes/events/list.js index b42f1254e50..28aeaddfdc5 100644 --- a/app/routes/events/list.js +++ b/app/routes/events/list.js @@ -83,7 +83,7 @@ export default class extends Route.extend(EmberTableRouteMixin) { } filterOptions = this.applySearchFilters(filterOptions, params, searchField); let queryString = { - include : 'tickets,sessions,speakers,owner,organizers,coorganizers,track-organizers,registrars,moderators', + include : 'owner,organizers,coorganizers,track-organizers,registrars,moderators', filter : filterOptions, 'page[size]' : params.per_page || 10, 'page[number]' : params.page || 4 diff --git a/app/routes/events/view.js b/app/routes/events/view.js index 0bb17514dff..c49d52120ce 100644 --- a/app/routes/events/view.js +++ b/app/routes/events/view.js @@ -10,7 +10,7 @@ export default Route.extend({ model(params) { return this.store.findRecord('event', params.event_id, { - include: 'event-topic,event-sub-topic,event-type,event-copyright,tax,owner,stripe-authorization' + include: 'event-topic,event-sub-topic,event-type,event-copyright,tax,owner,organizers,coorganizers,track-organizers,registrars,moderators,stripe-authorization' }); }, diff --git a/app/routes/events/view/edit.js b/app/routes/events/view/edit.js index d79494367c7..17dcf37d54f 100644 --- a/app/routes/events/view/edit.js +++ b/app/routes/events/view/edit.js @@ -12,6 +12,14 @@ export default Route.extend(AuthenticatedRouteMixin, EventWizardMixin, { if (transition.targetName === 'events.view.edit.index') { this.transitionTo('events.view.edit.basic-details'); } + + let event = this.modelFor('events.view'); + let { currentUser } = this.authManager; + if (!(currentUser.isAnAdmin || currentUser.email === event.owner.get('email') || event.organizers.includes(currentUser) + || event.coorganizers.includes(currentUser) || event.trackOrganizers.includes(currentUser) + || event.registrars.includes(currentUser) || event.moderators.includes(currentUser))) { + this.transitionTo('index'); + } }, async model() { diff --git a/app/routes/public/cfs/new-speaker.js b/app/routes/public/cfs/new-speaker.js index cade50e6f84..c471a5f131d 100644 --- a/app/routes/public/cfs/new-speaker.js +++ b/app/routes/public/cfs/new-speaker.js @@ -16,7 +16,7 @@ export default Route.extend({ event : eventDetails, forms : await eventDetails.query('customForms', { sort : 'id', - 'page[size]' : 50 + 'page[size]' : 0 }), speaker: await this.store.createRecord('speaker', { email : currentUser.email, diff --git a/app/templates/components/event-card.hbs b/app/templates/components/event-card.hbs index 76ebd7a0c2e..90decdd265d 100644 --- a/app/templates/components/event-card.hbs +++ b/app/templates/components/event-card.hbs @@ -20,7 +20,7 @@ {{/smart-overflow}}
- {{moment-format event.startsAt 'ddd, MMM DD h:mm A'}} + {{general-date event.startsAt event.timezone}}
{{#smart-overflow class='description'}} diff --git a/app/templates/components/events/view/overview/general-info.hbs b/app/templates/components/events/view/overview/general-info.hbs index c7fe503017d..231f2378035 100644 --- a/app/templates/components/events/view/overview/general-info.hbs +++ b/app/templates/components/events/view/overview/general-info.hbs @@ -36,11 +36,11 @@ {{t 'Start time'}} - {{moment-format data.event.startsAt 'h:mm A, MMMM Do YYYY'}} + {{general-date data.event.startsAt data.event.timezone}} {{t 'End time'}} - {{moment-format data.event.endsAt 'h:mm A, MMMM Do YYYY'}} + {{general-date data.event.endsAt data.event.timezone}} {{t 'Session types'}} diff --git a/app/templates/components/forms/admin/settings/system/mail-settings/test-email-form.hbs b/app/templates/components/forms/admin/settings/system/mail-settings/test-email-form.hbs index d9a312aff25..ed38728f75e 100644 --- a/app/templates/components/forms/admin/settings/system/mail-settings/test-email-form.hbs +++ b/app/templates/components/forms/admin/settings/system/mail-settings/test-email-form.hbs @@ -4,13 +4,15 @@ {{t 'Send Test Email'}} -
-
- {{input type="text" placeholder=(t 'Recipient E-mail') name='test_email' value=recipientEmail }} -
- {{t 'Test'}} +
+
+
+ {{input type="text" placeholder=(t 'Recipient E-mail') name='test_email' value=recipientEmail }} +
+ {{t 'Test'}} +
{{/ui-accordion}} -
\ No newline at end of file +
diff --git a/app/templates/components/forms/session-speaker-form.hbs b/app/templates/components/forms/session-speaker-form.hbs index 8762d94ade6..b09d5cf11f7 100644 --- a/app/templates/components/forms/session-speaker-form.hbs +++ b/app/templates/components/forms/session-speaker-form.hbs @@ -362,7 +362,6 @@ - diff --git a/app/templates/components/forms/wizard/basic-details-step.hbs b/app/templates/components/forms/wizard/basic-details-step.hbs index ff91dda95c3..10230309d8f 100644 --- a/app/templates/components/forms/wizard/basic-details-step.hbs +++ b/app/templates/components/forms/wizard/basic-details-step.hbs @@ -189,14 +189,14 @@ {{/if}}
- - + --}}
{{/ui-dropdown}} diff --git a/app/templates/components/modals/cfs-proposal-modal.hbs b/app/templates/components/modals/cfs-proposal-modal.hbs index e52026cbd09..839acbd19cc 100644 --- a/app/templates/components/modals/cfs-proposal-modal.hbs +++ b/app/templates/components/modals/cfs-proposal-modal.hbs @@ -41,7 +41,7 @@ {{/if}} {{#unless isNewSpeaker}} {{#link-to 'public.cfs.new-session' invokeAction=(action 'toggleView')}} - + {{/link-to}} {{/unless}} diff --git a/app/templates/components/public/ticket-list.hbs b/app/templates/components/public/ticket-list.hbs index bb54a4eefd6..70dfe2a82af 100644 --- a/app/templates/components/public/ticket-list.hbs +++ b/app/templates/components/public/ticket-list.hbs @@ -1,3 +1,4 @@ +{{!-- Removed `Currency Symbol` helper from the `paymentCurrency` since some currency are not getting rendered. Hotfix until a permanent solution found --}}
@@ -28,18 +29,18 @@ {{#if ticket.discount}} @@ -107,7 +108,7 @@ diff --git a/app/templates/components/side-bar.hbs b/app/templates/components/side-bar.hbs index 147ef9e2459..922d23e24fb 100644 --- a/app/templates/components/side-bar.hbs +++ b/app/templates/components/side-bar.hbs @@ -2,11 +2,13 @@ {{#link-to 'explore' class='item' activeClass=''}}{{t 'Browse Events'}}{{/link-to}} {{#if session.isAuthenticated}}
- {{widgets/safe-image isAvatar=true class='ui avatar round image side-bar' src=(if authManager.currentUser.avatarUrl authManager.currentUser.avatarUrl - '/images/placeholders/avatar.png')}} - {{if authManager.currentUser - (if authManager.currentUser.firstName authManager.currentUser.firstName authManager.currentUser.email) - 'Welcome'}} + + {{widgets/safe-image isAvatar=true class='ui avatar round image side-bar' src=(if authManager.currentUser.avatarUrl authManager.currentUser.avatarUrl + '/images/placeholders/avatar.png')}} + {{if authManager.currentUser + (if authManager.currentUser.firstName authManager.currentUser.firstName authManager.currentUser.email) + 'Welcome'}} +
{{t 'My Tickets'}}{{t 'My Sessions'}} diff --git a/app/templates/components/tables/utilities/search-box.hbs b/app/templates/components/tables/utilities/search-box.hbs index 242533d3881..9d235ab82a5 100644 --- a/app/templates/components/tables/utilities/search-box.hbs +++ b/app/templates/components/tables/utilities/search-box.hbs @@ -1,4 +1,4 @@ -
- {{input type="text" value=searchQuery placeholder="Search ..." }} + diff --git a/app/templates/components/ui-table.hbs b/app/templates/components/ui-table.hbs index 031b1b7af39..4092ff547b2 100644 --- a/app/templates/components/ui-table.hbs +++ b/app/templates/components/ui-table.hbs @@ -13,7 +13,7 @@ {{/if}}
-
+
- {{currency-symbol eventCurrency}} {{format-number ticket.price}} + {{eventCurrency}} {{format-number ticket.price}}
- {{currency-symbol eventCurrency}} {{format-number (sub ticket.price ticket.discount)}} + {{eventCurrency}} {{format-number (sub ticket.price ticket.discount)}} {{#if taxInfo}} {{#if showTaxIncludedMessage}} - {{t 'includes'}} {{currency-symbol eventCurrency}} {{format-number ticket.includedTaxAmount}} + {{t 'includes'}} {{eventCurrency}} {{format-number ticket.includedTaxAmount}} {{else}} - + {{currency-symbol eventCurrency}} {{format-number (add (sub ticket.ticketPriceWithTax ticket.price) ticket.discount)}} + + {{eventCurrency}} {{format-number (add (sub ticket.ticketPriceWithTax ticket.price) ticket.discount)}} {{/if}}
@@ -55,16 +56,16 @@ {{input type='number' name=ticket.id placeholder=(t 'Enter Donation') min=ticket.minPrice max=ticket.maxPrice value=ticket.price}}
{{else}} - {{currency-symbol eventCurrency}} {{format-number ticket.price}} + {{eventCurrency}} {{format-number ticket.price}} {{/if}} {{#if (and taxInfo (not-eq ticket.type 'free'))}} {{#if showTaxIncludedMessage}} - {{t 'includes'}} {{currency-symbol eventCurrency}} {{format-number ticket.includedTaxAmount}} + {{t 'includes'}} {{eventCurrency}} {{format-number ticket.includedTaxAmount}} {{else}} - + {{currency-symbol eventCurrency}} {{format-number (sub ticket.ticketPriceWithTax ticket.price)}} + + {{eventCurrency}} {{format-number (sub ticket.ticketPriceWithTax ticket.price)}} {{/if}}
@@ -90,9 +91,9 @@
{{#if taxInfo}} - {{currency-symbol eventCurrency}} {{format-number (mult (sub ticket.ticketPriceWithTax ticket.discount) ticket.orderQuantity)}} + {{eventCurrency}} {{format-number (mult (sub ticket.ticketPriceWithTax ticket.discount) ticket.orderQuantity)}} {{else}} - {{currency-symbol eventCurrency}} {{format-number (mult (sub ticket.price ticket.discount) ticket.orderQuantity)}} + {{eventCurrency}} {{format-number (mult (sub ticket.price ticket.discount) ticket.orderQuantity)}} {{/if}}
- {{t 'Total'}}: {{currency-symbol eventCurrency}} {{format-number total}} + {{t 'Total'}}: {{eventCurrency}} {{format-number total}}
{{#if groupedHeaders.length}} diff --git a/app/templates/components/ui-table/cell/admin/users/cell-first-name.hbs b/app/templates/components/ui-table/cell/admin/users/cell-first-name.hbs index aabac0fa433..61f1b2565d5 100644 --- a/app/templates/components/ui-table/cell/admin/users/cell-first-name.hbs +++ b/app/templates/components/ui-table/cell/admin/users/cell-first-name.hbs @@ -1,21 +1,21 @@ -{{extraRecords.firstName}} +{{record}}
- {{#ui-popup tagName='a' click=(action props.actions.moveToUserDetails record) content=(t 'View') class='ui icon button'}} + {{#ui-popup tagName='a' click=(action props.actions.moveToUserDetails extraRecords.id) content=(t 'View') class='ui icon button'}} {{/ui-popup}} - {{#unless record.isSuperAdmin}} - {{#if (not record.deletedAt)}} - {{#ui-popup content=(t 'Edit') click=(action props.actions.openEditModal record) class='ui icon button'}} + {{#unless extraRecords.isSuperAdmin}} + {{#if (not extraRecords.deletedAt)}} + {{#ui-popup content=(t 'Edit') click=(action props.actions.openEditModal extraRecords.id) class='ui icon button'}} {{/ui-popup}} {{/if}} {{#if (and props.options.hasRestorePrivileges extraRecords.deletedAt)}} - {{#ui-popup content=(t 'Restore') click=(action props.actions.restoreUser record) class='ui icon button' position='left center'}} + {{#ui-popup content=(t 'Restore') click=(action props.actions.restoreUser extraRecords.id) class='ui icon button' position='left center'}} {{/ui-popup}} {{else}} - {{#ui-popup content=(t 'Delete') click=(action (confirm (t 'Are you sure you would like to delete this user?') (action props.actions.deleteUser record))) class='ui icon button'}} + {{#ui-popup content=(t 'Delete') click=(action (confirm (t 'Are you sure you would like to delete this user?') (action props.actions.deleteUser extraRecords.id))) class='ui icon button'}} {{/ui-popup}} {{/if}} diff --git a/app/templates/components/ui-table/cell/cell-event-date.hbs b/app/templates/components/ui-table/cell/cell-event-date.hbs index 34d8224a01d..cf0a4d01b6c 100644 --- a/app/templates/components/ui-table/cell/cell-event-date.hbs +++ b/app/templates/components/ui-table/cell/cell-event-date.hbs @@ -1,11 +1,11 @@ {{#if record}} {{#if extraRecords.endsAt}}
- {{moment-format record 'MMMM DD, YYYY - hh:mm A'}} + {{general-date record extraRecords.timezone}}
(to)
- {{moment-format extraRecords.endsAt 'MMMM DD, YYYY - hh:mm A'}} + {{general-date extraRecords.endsAt extraRecords.timezone}}
{{else}} diff --git a/app/templates/components/ui-table/cell/cell-simple-buttons.hbs b/app/templates/components/ui-table/cell/cell-simple-buttons.hbs index 008a71e9383..ccb1ac4e20b 100644 --- a/app/templates/components/ui-table/cell/cell-simple-buttons.hbs +++ b/app/templates/components/ui-table/cell/cell-simple-buttons.hbs @@ -1,4 +1,4 @@ -
+
{{#ui-popup content=(t 'View Session') class='ui icon button' click=(action props.actions.viewSession record) position='left center'}} {{/ui-popup}} diff --git a/app/templates/components/ui-table/cell/cell-simple-date.hbs b/app/templates/components/ui-table/cell/cell-simple-date.hbs index 15cc338b0cf..db359ea1483 100644 --- a/app/templates/components/ui-table/cell/cell-simple-date.hbs +++ b/app/templates/components/ui-table/cell/cell-simple-date.hbs @@ -1,9 +1,9 @@ -{{#if record}} +{{#if extraRecords.timezone}} - {{moment-format record (if props.options.dateFormat props.options.dateFormat 'MMMM DD, YYYY - HH:mm A')}} + {{general-date record extraRecords.timezone}} -{{else}} +{{else if record}} - {{t 'No dates available.'}} + {{moment-format record (if props.options.dateFormat props.options.dateFormat 'MMMM DD, YYYY - HH:mm A')}} {{/if}} diff --git a/app/templates/events/view/tickets/index.hbs b/app/templates/events/view/tickets/index.hbs index e02b9b01673..36bdc1401ad 100644 --- a/app/templates/events/view/tickets/index.hbs +++ b/app/templates/events/view/tickets/index.hbs @@ -10,7 +10,7 @@

-
+
{{t 'Order Summary'}} @@ -121,7 +121,7 @@

-
+
diff --git a/app/templates/index.hbs b/app/templates/index.hbs index 3a449bedc08..f9212b1dfea 100644 --- a/app/templates/index.hbs +++ b/app/templates/index.hbs @@ -27,11 +27,13 @@ {{/each}} -
-
- {{#link-to "explore" (query-params cfs='open') class='ui blue button'}}{{t 'Show more calls for speakers'}}{{/link-to}} + {{#if (gt callForSpeakersEvents.length 3)}} +
+
+ {{#link-to "explore" (query-params cfs='open') class='ui blue button'}}{{t 'Show more calls for speakers'}}{{/link-to}} +
-
+ {{/if}} {{/if}} {{modals/event-share-modal isOpen=isShareModalOpen event=eventToShare}} diff --git a/app/templates/my-sessions/view.hbs b/app/templates/my-sessions/view.hbs index 45f72181e16..d90d9e9b068 100644 --- a/app/templates/my-sessions/view.hbs +++ b/app/templates/my-sessions/view.hbs @@ -1,7 +1,7 @@
{{#if (not model.isLocked)}} - {{#link-to 'events.view.sessions.edit' model.event.id model.id}} + {{#link-to 'public.cfs.edit-session' model.event.id model.id}} {{#if device.isMobile}} @@ -10,7 +10,7 @@ {{/if}} {{#each model.speakers as |speaker|}} {{#if (eq speaker.email authManager.currentUser.email)}} - {{#link-to 'events.view.speakers.edit' model.event.id speaker.id}} + {{#link-to 'public.cfs.edit-speaker' model.event.id speaker.id}} {{#if device.isMobile}} diff --git a/app/templates/orders/view.hbs b/app/templates/orders/view.hbs index 65bd36798f5..713b056f1bf 100644 --- a/app/templates/orders/view.hbs +++ b/app/templates/orders/view.hbs @@ -30,8 +30,8 @@ {{t 'Download Tickets'}}
diff --git a/app/utils/computed-helpers.js b/app/utils/computed-helpers.js index 0bf1851b9c5..a4ec5530111 100644 --- a/app/utils/computed-helpers.js +++ b/app/utils/computed-helpers.js @@ -47,13 +47,23 @@ export const computedSegmentedLink = function(property) { export const computedDateTimeSplit = function(property, segmentFormat, endProperty) { return computed(property, { get() { - return moment(this.get(property)).format(getFormat(segmentFormat)); + let momentDate = moment(this.get(property)); + if (this.constructor.modelName === 'event') { + momentDate = momentDate.tz(this.timezone); + } + return momentDate.format(getFormat(segmentFormat)); }, set(key, value) { - const newDate = moment(value, getFormat(segmentFormat)); + let newDate = moment(value, getFormat(segmentFormat)); + if (this.constructor.modelName === 'event') { + newDate = newDate.tz(this.timezone, true); + } let oldDate = newDate; if (this.get(property)) { oldDate = moment(this.get(property), segmentFormat === 'date' ? FORM_DATE_FORMAT : FORM_TIME_FORMAT); + if (this.constructor.modelName === 'event') { + oldDate = oldDate.tz(this.timezone, true); + } } else { oldDate = newDate; } diff --git a/app/utils/validators.js b/app/utils/validators.js index dadcbbb8e67..2595b5c9f08 100644 --- a/app/utils/validators.js +++ b/app/utils/validators.js @@ -20,12 +20,14 @@ export const compulsoryProtocolValidUrlPattern = new RegExp('^(https?:\\/\\/)' / export const protocolLessValidUrlPattern = new RegExp( '^' + // localhost inclusion + + '(?:(?:localhost)(:\\d{2,5})?|' // user:pass authentication + '(?:\\S+(?::\\S*)?@)?' + '(?:' // IP address exclusion // private & local networks - + '(?!(?:10|127)(?:\\.\\d{1,3}){3})' + + '(?!(?:10)(?:\\.\\d{1,3}){3})' + '(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})' + '(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})' // IP address dotted notation octets @@ -49,7 +51,7 @@ export const protocolLessValidUrlPattern = new RegExp( // port number + '(?::\\d{2,5})?' // resource path - + '(?:[/?#]\\S*)?' + + '(?:[/?#]\\S*)?)' + '$', 'i' ); diff --git a/docs/installation/local.md b/docs/installation/local.md index e426ab059de..bcb674af1a8 100644 --- a/docs/installation/local.md +++ b/docs/installation/local.md @@ -34,7 +34,7 @@ brew reinstall gettext brew link --force gettext ``` -- By default, the `.env.example` file specifies the `API_HOST` as `localhost:5000` and assumes, that the [open-event-server](https://github.com/fossasia/open-event-server) is already up and running. If you intend to work on issues which involve both the frontend, and the backend, please install and set it up first before proceeding to run the frontend. **If however, you intend to work on just the frontend, please change the URL for `API_HOST` to `https://open-event-api-dev.herokuapp.com` which is a test deployment of the open-event-server.** +- By default, the `.env.example` file specifies the `API_HOST` as `https://open-event-api-dev.herokuapp.com` which is a test deployment of the open-event-server. If you intend to work on just the frontend, this is sufficient. **If however, you intend to work on issues which involve both the frontend and the backend, you must have the [open-event-server](https://github.com/fossasia/open-event-server) already up and running. Please install and set it up first before changing the URL for `API_HOST` to `localhost:5000` and proceeding to run the frontend.** ## Running / Development * `ember serve` diff --git a/tests/integration/helpers/general-date-test.js b/tests/integration/helpers/general-date-test.js new file mode 100644 index 00000000000..c3210fd1228 --- /dev/null +++ b/tests/integration/helpers/general-date-test.js @@ -0,0 +1,16 @@ +import { module, test } from 'qunit'; +import { setupIntegrationTest } from 'open-event-frontend/tests/helpers/setup-integration-test'; +import hbs from 'htmlbars-inline-precompile'; +import { render } from '@ember/test-helpers'; +import moment from 'moment'; + +module('Integration | Helper | general date', function(hooks) { + setupIntegrationTest(hooks); + + test('it renders', async function(assert) { + this.set('inputMomentValue', moment('2019-05-01T03:30:00+09:00')); + this.set('inputTimezoneValue', 'Japan'); + await render(hbs`{{general-date inputMomentValue inputTimezoneValue}}`); + assert.equal(this.element.innerHTML.trim(), '3:30 AM , May 1st 2019 (JST)'); + }); +}); diff --git a/tests/integration/helpers/header-date-test.js b/tests/integration/helpers/header-date-test.js index ace4f6143cb..1589550b39e 100644 --- a/tests/integration/helpers/header-date-test.js +++ b/tests/integration/helpers/header-date-test.js @@ -8,7 +8,7 @@ module('Integration | Helper | header date', function(hooks) { setupIntegrationTest(hooks); test('it renders', async function(assert) { - this.set('inputMomentValue', moment('2019-04-30T18:30:00+00:00')); + this.set('inputMomentValue', moment('2019-05-01T03:30:00+09:00')); this.set('inputTimezoneValue', 'Japan'); await render(hbs`{{header-date inputMomentValue inputTimezoneValue}}`); assert.equal(this.element.innerHTML.trim(), 'Wednesday, May 1st 2019, 3:30 AM (JST)'); diff --git a/yarn.lock b/yarn.lock index feb4b1b36eb..f42ba528505 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3916,9 +3916,10 @@ caniuse-api@^3.0.0: lodash.memoize "^4.1.2" lodash.uniq "^4.5.0" -caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000805, caniuse-lite@^1.0.30000967: - version "1.0.30000969" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000969.tgz#7664f571f2072657bde70b00a1fc1ba41f1942a9" +caniuse-lite@^1.0.30000967, caniuse-lite@^1.0.30001006: + version "1.0.30001006" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001006.tgz#5b6e8288792cfa275f007b2819a00ccad7112655" + integrity sha512-MXnUVX27aGs/QINz+QG1sWSLDr3P1A3Hq5EUWoIt0T7K24DuvMxZEnh3Y5aHlJW6Bz2aApJdSewdYLd8zQnUuw== capture-exit@^1.2.0: version "1.2.0"