diff --git a/jslib b/jslib index 28d21ca5df..635a6fd0d8 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 28d21ca5dfacd1487cd92345d8be9554079fbd96 +Subproject commit 635a6fd0d8758384021d674d9140266f9976e9e0 diff --git a/src/app/app.module.ts b/src/app/app.module.ts index afc753a0cb..30e405e727 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -115,6 +115,7 @@ import { PremiumComponent } from './settings/premium.component'; import { ProfileComponent } from './settings/profile.component'; import { PurgeVaultComponent } from './settings/purge-vault.component'; import { SettingsComponent } from './settings/settings.component'; +import { TaxInfoComponent } from './settings/tax-info.component'; import { TwoFactorAuthenticatorComponent } from './settings/two-factor-authenticator.component'; import { TwoFactorDuoComponent } from './settings/two-factor-duo.component'; import { TwoFactorEmailComponent } from './settings/two-factor-email.component'; @@ -350,6 +351,7 @@ registerLocaleData(localeZhTw, 'zh-TW'); ShareComponent, StopClickDirective, StopPropDirective, + TaxInfoComponent, ToolsComponent, TrueFalseValueDirective, TwoFactorAuthenticatorComponent, diff --git a/src/app/organizations/settings/account.component.html b/src/app/organizations/settings/account.component.html index 7ef7ce28c5..355a4df666 100644 --- a/src/app/organizations/settings/account.component.html +++ b/src/app/organizations/settings/account.component.html @@ -49,9 +49,17 @@

{{'taxInformation' | i18n}}

{{'taxInformationDesc' | i18n}}

- - {{'contactSupport' | i18n}} - +
+ + {{'loading' | i18n}} +
+
+ + +

{{'dangerZone' | i18n}}

diff --git a/src/app/organizations/settings/account.component.ts b/src/app/organizations/settings/account.component.ts index 87c85625c6..4da760b952 100644 --- a/src/app/organizations/settings/account.component.ts +++ b/src/app/organizations/settings/account.component.ts @@ -18,6 +18,7 @@ import { OrganizationResponse } from 'jslib/models/response/organizationResponse import { ModalComponent } from '../../modal.component'; import { PurgeVaultComponent } from '../../settings/purge-vault.component'; +import { TaxInfoComponent } from '../../settings/tax-info.component'; import { ApiKeyComponent } from './api-key.component'; import { DeleteOrganizationComponent } from './delete-organization.component'; import { RotateApiKeyComponent } from './rotate-api-key.component'; @@ -31,11 +32,13 @@ export class AccountComponent { @ViewChild('purgeOrganizationTemplate', { read: ViewContainerRef }) purgeModalRef: ViewContainerRef; @ViewChild('apiKeyTemplate', { read: ViewContainerRef }) apiKeyModalRef: ViewContainerRef; @ViewChild('rotateApiKeyTemplate', { read: ViewContainerRef }) rotateApiKeyModalRef: ViewContainerRef; + @ViewChild(TaxInfoComponent) taxInfo: TaxInfoComponent; loading = true; canUseApi = false; org: OrganizationResponse; formPromise: Promise; + taxFormPromise: Promise; private organizationId: string; private modal: ModalComponent = null; @@ -71,6 +74,13 @@ export class AccountComponent { } catch { } } + async submitTaxInfo() { + this.taxFormPromise = this.taxInfo.submitTaxInfo(); + await this.taxFormPromise; + this.analytics.eventTrack.next({ action: 'Updated Organization Tax Info' }); + this.toasterService.popAsync('success', null, this.i18nService.t('taxInfoUpdated')); + } + deleteOrganization() { if (this.modal != null) { this.modal.close(); diff --git a/src/app/settings/adjust-payment.component.html b/src/app/settings/adjust-payment.component.html index aad11828f0..4938328ac8 100644 --- a/src/app/settings/adjust-payment.component.html +++ b/src/app/settings/adjust-payment.component.html @@ -4,6 +4,7 @@ aria-hidden="true">×

{{(currentType != null ? 'changePaymentMethod' : 'addPaymentMethod') | i18n}}

+