diff --git a/src/app/organizations/settings/account.component.html b/src/app/organizations/settings/account.component.html index 7ef7ce28c5..b5adb00f6c 100644 --- a/src/app/organizations/settings/account.component.html +++ b/src/app/organizations/settings/account.component.html @@ -49,9 +49,325 @@

{{'taxInformation' | i18n}}

{{'taxInformationDesc' | i18n}}

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

{{'dangerZone' | i18n}}

diff --git a/src/app/organizations/settings/account.component.ts b/src/app/organizations/settings/account.component.ts index 87c85625c6..65a252810b 100644 --- a/src/app/organizations/settings/account.component.ts +++ b/src/app/organizations/settings/account.component.ts @@ -21,6 +21,7 @@ import { PurgeVaultComponent } from '../../settings/purge-vault.component'; import { ApiKeyComponent } from './api-key.component'; import { DeleteOrganizationComponent } from './delete-organization.component'; import { RotateApiKeyComponent } from './rotate-api-key.component'; +import { OrganizationTaxInfoUpdateRequest } from 'jslib/models/request/organizationTaxInfoUpdateRequest'; @Component({ selector: 'app-org-account', @@ -36,6 +37,16 @@ export class AccountComponent { canUseApi = false; org: OrganizationResponse; formPromise: Promise; + taxInfo: any = { + taxId: null, + line1: null, + line2: null, + city: null, + state: null, + postalCode: null, + country: 'US', + includeTaxId: false, + }; private organizationId: string; private modal: ModalComponent = null; @@ -51,6 +62,23 @@ export class AccountComponent { try { this.org = await this.apiService.getOrganization(this.organizationId); this.canUseApi = this.org.useApi; + const taxInfo = await this.apiService.getOrganizationTaxInfo(this.organizationId); + if (taxInfo) { + this.taxInfo.taxId = taxInfo.taxId; + this.taxInfo.state = taxInfo.state; + this.taxInfo.line1 = taxInfo.line1; + this.taxInfo.line2 = taxInfo.line2; + this.taxInfo.city = taxInfo.city; + this.taxInfo.state = taxInfo.state; + this.taxInfo.postalCode = taxInfo.postalCode; + this.taxInfo.country = taxInfo.country; + this.taxInfo.includeTaxId = taxInfo.country !== 'US' && ( + !!taxInfo.taxId + || !!taxInfo.line1 + || !!taxInfo.line2 + || !!taxInfo.city + || !!taxInfo.state); + } } catch { } }); this.loading = false; @@ -71,6 +99,22 @@ export class AccountComponent { } catch { } } + async submitTaxInfo() { + const request = new OrganizationTaxInfoUpdateRequest(); + request.taxId = this.taxInfo.taxId; + request.state = this.taxInfo.state; + request.line1 = this.taxInfo.line1; + request.line2 = this.taxInfo.line2; + request.city = this.taxInfo.city; + request.state = this.taxInfo.state; + request.postalCode = this.taxInfo.postalCode; + request.country = this.taxInfo.country; + this.formPromise = this.apiService.putOrganizationTaxInfo(this.organizationId, request); + await this.formPromise; + 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(); @@ -131,4 +175,15 @@ export class AccountComponent { this.modal = null; }); } + + changeCountry() { + if (this.taxInfo.country === 'US') { + this.taxInfo.includeTaxId = false; + this.taxInfo.taxId = null; + this.taxInfo.line1 = null; + this.taxInfo.line2 = null; + this.taxInfo.city = null; + this.taxInfo.state = null; + } + } } diff --git a/src/app/services/services.module.ts b/src/app/services/services.module.ts index c74261dd31..c3da3d9566 100644 --- a/src/app/services/services.module.ts +++ b/src/app/services/services.module.ts @@ -143,8 +143,8 @@ export function initFactory(): Function { } apiService.setUrls({ base: isDev ? null : window.location.origin, - api: isDev ? 'http://localhost:4000' : null, - identity: isDev ? 'http://localhost:33656' : null, + api: isDev ? 'http://localhost:7064' : null, + identity: isDev ? 'http://localhost:5000' : null, events: isDev ? 'http://localhost:46273' : null, // Uncomment these (and comment out the above) if you want to target production diff --git a/src/app/settings/adjust-payment.component.html b/src/app/settings/adjust-payment.component.html index aad11828f0..9c219a04a1 100644 --- a/src/app/settings/adjust-payment.component.html +++ b/src/app/settings/adjust-payment.component.html @@ -4,6 +4,271 @@ aria-hidden="true">×

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

+
+
+ + + {{'countryPostalCodeRequiredDesc' | i18n}} +
+
+ + +
+