Skip to content

Commit 6a563e2

Browse files
kushthedudeabhinavk96
authored andcommitted
fix: notify services in files (#3438)
* fixing notify services in all components files * Resolving Conflicts * Using snake case
1 parent 2724eee commit 6a563e2

25 files changed

+173
-62
lines changed

app/adapters/application.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export const fixFilterQuery = query => {
1616
if (query.hasOwnProperty('filter')) {
1717
query.filter = JSON.stringify(query.filter);
1818
}
19+
1920
return query;
2021
};
2122

@@ -34,13 +35,15 @@ export default JSONAPIAdapter.extend(HasManyQueryAdapterMixin, AdapterFetch, Cac
3435
if (access_token) {
3536
headers[ENV['ember-simple-auth-token'].authorizationHeaderName] = ENV['ember-simple-auth-token'].authorizationPrefix + access_token;
3637
}
38+
3739
return headers;
3840
}),
3941

4042
isInvalid(statusCode) {
4143
if (statusCode !== 404 && statusCode !== 422 && statusCode !== 403 && statusCode !== 409) {
4244
this.notify.error('An unexpected error occurred.', {
43-
closeAfter: 5000
45+
closeAfter : 5000,
46+
id : 'serve_error'
4447
});
4548
}
4649
},

app/components/account/application-section.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,16 @@ export default Component.extend({
3030
);
3131
this.set('data', this.get('authManager.currentUser'));
3232
}
33+
3334
this.set('isLoading', false);
3435
});
3536
});
3637
});
3738
}
3839
} catch (error) {
39-
this.notify.error(this.l10n.t(error.message));
40+
this.notify.error(this.l10n.t(error.message), {
41+
id: 'error_message'
42+
});
4043
this.set('isLoading', false);
4144
}
4245
}

app/components/account/danger-zone.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,14 @@ export default Component.extend({
3333
.then(() => {
3434
this.authManager.logout();
3535
this.routing.transitionTo('index');
36-
this.notify.success(this.l10n.t('Your account has been deleted successfully.'));
36+
this.notify.success(this.l10n.t('Your account has been deleted successfully.'), {
37+
id: 'account_Delete'
38+
});
3739
})
3840
.catch(() => {
39-
this.notify.error(this.l10n.t('An unexpected error has occurred.'));
41+
this.notify.error(this.l10n.t('An unexpected error has occurred.'), {
42+
id: 'account_del_error'
43+
});
4044
})
4145
.finally(() => {
4246
this.setProperties({

app/components/account/email-preferences-section.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@ export default Component.extend({
55
savePreference(emailPreference) {
66
emailPreference.save()
77
.then(() => {
8-
this.notify.success(this.l10n.t('Email notifications updated successfully'));
8+
this.notify.success(this.l10n.t('Email notifications updated successfully'), {
9+
id: 'email_notif'
10+
});
911
})
1012
.catch(() => {
1113
emailPreference.rollbackAttributes();
12-
this.notify.error(this.l10n.t('An unexpected error occurred.'));
14+
this.notify.error(this.l10n.t('An unexpected error occurred.'), {
15+
id: 'email_error'
16+
});
1317
});
1418
}
1519
}

app/components/events/view/export/api-response.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ export default Component.extend({
3939
this.set('json', htmlSafe(syntaxHighlight(json)));
4040
})
4141
.catch(() => {
42-
this.notify.error(this.l10n.t('Could not fetch from the server'));
42+
this.notify.error(this.l10n.t('Could not fetch from the server'), {
43+
id: 'server_fetch_error'
44+
});
4345
this.set('json', 'Could not fetch from the server');
4446
})
4547
.finally(() => {

app/components/events/view/export/download-common.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,27 @@ export default Component.extend({
2929
if (exportJobStatus.state === 'SUCCESS') {
3030
this.set('isDownloadDisabled', false);
3131
this.set('eventDownloadUrl', exportJobStatus.result.download_url);
32-
this.notify.success(this.l10n.t('Download Ready'));
32+
this.notify.success(this.l10n.t('Download Ready'), {
33+
id: 'down_ready'
34+
});
3335
} else if (exportJobStatus.state === 'WAITING') {
3436
this.requestLoop(exportJobInfo);
3537
this.set('eventExportStatus', exportJobStatus.state);
36-
this.notify.alert(this.l10n.t('Task is going on.'));
38+
this.notify.alert(this.l10n.t('Task is going on.'), {
39+
id: 'task_progress'
40+
});
3741
} else {
3842
this.set('eventExportStatus', exportJobStatus.state);
39-
this.notify.error(this.l10n.t('Task failed.'));
43+
this.notify.error(this.l10n.t('Task failed.'), {
44+
id: 'task_fail'
45+
});
4046
}
4147
})
4248
.catch(() => {
4349
this.set('eventExportStatus', 'FAILURE');
44-
this.notify.error(this.l10n.t('Task failed.'));
50+
this.notify.error(this.l10n.t('Task failed.'), {
51+
id: 'task_failure'
52+
});
4553
})
4654
.finally(() => {
4755
this.set('isLoading', false);
@@ -58,7 +66,9 @@ export default Component.extend({
5866
})
5967
.catch(() => {
6068
this.set('isLoading', false);
61-
this.notify.error(this.l10n.t('Unexpected error occurred.'));
69+
this.notify.error(this.l10n.t('Unexpected error occurred.'), {
70+
id: 'unexpected_down_error'
71+
});
6272
});
6373
}
6474
}

app/components/events/view/export/download-zip.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,14 @@ export default class extends Component {
1212
anchor.href = URL.createObjectURL(new Blob([res], { type: 'octet/stream' }));
1313
anchor.download = 'EventExport.zip';
1414
anchor.click();
15-
this.notify.success(this.l10n.t('Exported Event Downloaded successfully.'));
15+
this.notify.success(this.l10n.t('Exported Event Downloaded successfully.'), {
16+
id: 'export_succ'
17+
});
1618
} catch (e) {
1719
console.error(e);
18-
this.notify.error(this.l10n.t(e));
20+
this.notify.error(this.l10n.t(e), {
21+
id: 'err_down'
22+
});
1923
}
2024
this.set('isLoading', false);
2125
}

app/components/events/view/overview/manage-roles.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,14 @@ export default Component.extend({
2828
this.get('data.roleInvites').addObject(this.currentInvite);
2929
}
3030
this.set('isAddUserRoleModalOpen', false);
31-
this.notify.success(this.isNewInvite ? this.l10n.t('Role Invite sent successfully') : this.l10n.t('Role Invite updated successfully'));
31+
this.notify.success(this.isNewInvite ? this.l10n.t('Role Invite sent successfully') : this.l10n.t('Role Invite updated successfully'), {
32+
id: 'man_role'
33+
});
3234
})
3335
.catch(() => {
34-
this.notify.error(this.l10n.t('Oops something went wrong. Please try again'));
36+
this.notify.error(this.l10n.t('Oops something went wrong. Please try again'), {
37+
id: 'man_role_err'
38+
});
3539
})
3640
.finally(() => {
3741
this.set('isLoading', false);
@@ -41,11 +45,15 @@ export default Component.extend({
4145
this.set('isLoading', true);
4246
invite.destroyRecord()
4347
.then(() => {
44-
this.notify.success(this.l10n.t('Role Invite deleted successfully'));
48+
this.notify.success(this.l10n.t('Role Invite deleted successfully'), {
49+
id: 'del_role_succ'
50+
});
4551
this.get('data.roleInvites').removeObject(invite);
4652
})
4753
.catch(() => {
48-
this.notify.error(this.l10n.t('Oops something went wrong. Please try again'));
54+
this.notify.error(this.l10n.t('Oops something went wrong. Please try again'), {
55+
id: 'err_man_role'
56+
});
4957
})
5058
.finally(() => {
5159
this.set('isLoading', false);

app/components/forms/admin/settings/system/mail-settings/test-email-form.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,15 @@ export default Component.extend(FormMixin, {
3535
};
3636
this.loader.post('/test-mail', JSON.stringify(payload), config)
3737
.then(response => {
38-
this.notify.success(response.message);
38+
this.notify.success(response.message, {
39+
id: 'succ_response_test'
40+
});
3941
})
4042
.catch(e => {
4143
console.warn(e);
42-
this.notify.error(this.l10n.t('An unexpected error has occurred'));
44+
this.notify.error(this.l10n.t('An unexpected error has occurred'), {
45+
id: 'test_mail_err'
46+
});
4347
});
4448
});
4549
}

app/components/forms/admin/settings/ticket-fees-form.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ export default Component.extend({
2121
return (!setting.get('currency') || !setting.get('country'));
2222
});
2323
if (incorrect_settings.length > 0) {
24-
this.notify.error(this.l10n.t('Existing items need to be completed before new items can be added.'));
24+
this.notify.error(this.l10n.t('Existing items need to be completed before new items can be added.'), {
25+
id: 'existing_item'
26+
});
2527
this.set('isLoading', false);
2628
} else {
2729
this.model.toArray().addObject(this.store.createRecord('ticket-fee', {
@@ -34,10 +36,14 @@ export default Component.extend({
3436
this.set('isLoading', true);
3537
rec.destroyRecord()
3638
.then(() => {
37-
this.notify.success(this.l10n.t('Fee setting deleted successfully'));
39+
this.notify.success(this.l10n.t('Fee setting deleted successfully'), {
40+
id: 'fee_delete_succ'
41+
});
3842
})
3943
.catch(() => {
40-
this.notify.error(this.l10n.t('Oops something went wrong. Please try again'));
44+
this.notify.error(this.l10n.t('Oops something went wrong. Please try again'), {
45+
id: 'fee_err'
46+
});
4147
})
4248
.finally(() => {
4349
this.set('isLoading', false);

0 commit comments

Comments
 (0)