Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async confirmRequestExport() {
this.set('showRequestDialog', false);
if (this.settings !== undefined) {
await this.settings.requestExport();
return this.toast.success(
this.i18n.t('settings.account.export.confirmationToastMessage'),
'',
this.toastOptions,
);
}
const { supportEmail } = config.support;
return this.toast.error(
this.i18n.t('settings.account.security.saveError', { supportEmail }),
'',
this.toastOptions,
);
}
import Controller from '@ember/controller';
import config from 'ember-get-config';
export default class NotFound extends Controller {
supportEmail: string = config.support.supportEmail;
}
declare module '@ember/controller' {
interface Registry {
'not-found': NotFound;
}
}
import { service } from '@ember-decorators/service';
import Component from '@ember/component';
import config from 'ember-get-config';
import { serviceLinks } from 'ember-osf-web/const/service-links';
import { layout } from 'ember-osf-web/decorators/component';
import Analytics from 'ember-osf-web/services/analytics';
import styles from './styles';
import template from './template';
@layout(template, styles)
export default class OsfFooter extends Component {
@service analytics!: Analytics;
serviceLinks = serviceLinks;
supportEmail: string = config.support.supportEmail;
currentYear: number = (new Date()).getUTCFullYear();
constructor(properties: object) {
super(properties);
Object.assign(this, config.signUpPolicy, config.footerLinks);
}
}
constructor() {
super();
Object.assign(this, config.support);
}
}
saveSettings: task(function *(this: DeactivationPane, successMessage: string) {
try {
if (this.settings !== undefined) {
yield this.settings.save();
return this.toast.success(successMessage);
}
throw Error('No settings to save.');
} catch (e) {
const { supportEmail } = config.support;
const saveErrorMessage = this.i18n.t('settings.account.security.saveError', { supportEmail });
return this.toast.error(saveErrorMessage);
}
}),
}) {
verificationError(error: DS.AdapterError) {
if (error instanceof DS.ForbiddenError) {
this.set('showError', true);
} else {
const { supportEmail } = config.support;
const saveErrorMessage: string = this.i18n.t('settings.account.security.saveError', { supportEmail });
this.toast.error(saveErrorMessage);
}
}
updateError() {
this.user.rollbackAttributes();
const { supportEmail } = config.support;
const saveErrorMessage = this.i18n.t('settings.account.defaultRegion.saveError', { supportEmail });
return this.toast.error(saveErrorMessage);
}