From 7e11b8bb5ae1381d8b41e69d0664b4225eaa53af Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 28 Aug 2020 11:22:30 -0400 Subject: [PATCH] disable certain org settings fields when selfhost (#627) --- src/app/organizations/settings/account.component.html | 7 ++++--- src/app/organizations/settings/account.component.ts | 6 +++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/app/organizations/settings/account.component.html b/src/app/organizations/settings/account.component.html index aa3a530f41..fffa1004d0 100644 --- a/src/app/organizations/settings/account.component.html +++ b/src/app/organizations/settings/account.component.html @@ -10,17 +10,18 @@
- +
+ [(ngModel)]="org.billingEmail" [disabled]="selfHosted">
+ [(ngModel)]="org.businessName" [disabled]="selfHosted">
diff --git a/src/app/organizations/settings/account.component.ts b/src/app/organizations/settings/account.component.ts index f64e18699c..e6285707a8 100644 --- a/src/app/organizations/settings/account.component.ts +++ b/src/app/organizations/settings/account.component.ts @@ -11,6 +11,7 @@ import { Angulartics2 } from 'angulartics2'; import { ApiService } from 'jslib/abstractions/api.service'; import { I18nService } from 'jslib/abstractions/i18n.service'; +import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service'; import { SyncService } from 'jslib/abstractions/sync.service'; import { OrganizationUpdateRequest } from 'jslib/models/request/organizationUpdateRequest'; @@ -34,6 +35,7 @@ export class AccountComponent { @ViewChild('rotateApiKeyTemplate', { read: ViewContainerRef, static: true }) rotateApiKeyModalRef: ViewContainerRef; @ViewChild(TaxInfoComponent) taxInfo: TaxInfoComponent; + selfHosted = false; loading = true; canUseApi = false; org: OrganizationResponse; @@ -46,9 +48,11 @@ export class AccountComponent { constructor(private componentFactoryResolver: ComponentFactoryResolver, private apiService: ApiService, private i18nService: I18nService, private analytics: Angulartics2, private toasterService: ToasterService, - private route: ActivatedRoute, private syncService: SyncService) { } + private route: ActivatedRoute, private syncService: SyncService, + private platformUtilsService: PlatformUtilsService) { } async ngOnInit() { + this.selfHosted = this.platformUtilsService.isSelfHost(); this.route.parent.parent.params.subscribe(async (params) => { this.organizationId = params.organizationId; try {