1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-22 11:13:46 +00:00

SM-1159: Rename Service Accounts to Machine Accounts (#8444)

* SM-1159: Rename service accounts to machine accounts. Visible text only.

* SM-1159: Second round of adding service to machine account renames

* SM-1159: Change title

* SM-1159: Fix typo

* SM-1159: Add more keys

* SM-1159: Reordered keys

* SM-1159: Keys update
This commit is contained in:
Colton Hurst
2024-04-05 10:52:21 -04:00
committed by GitHub
parent 9f8f93ef97
commit fb51aa570d
23 changed files with 222 additions and 59 deletions

View File

@@ -18,7 +18,7 @@
></bit-nav-item>
<bit-nav-item
icon="bwi-wrench"
[text]="'serviceAccounts' | i18n"
[text]="'machineAccounts' | i18n"
route="service-accounts"
[relativeTo]="route.parent"
></bit-nav-item>

View File

@@ -5,7 +5,7 @@
<div *ngIf="!loading && view$ | async as view; else spinner">
<app-onboarding [title]="'getStarted' | i18n" *ngIf="showOnboarding" (dismiss)="hideOnboarding()">
<app-onboarding-task
[title]="'createServiceAccount' | i18n"
[title]="'createMachineAccount' | i18n"
(click)="openServiceAccountDialog()"
icon="bwi-cli"
[completed]="view.tasks.createServiceAccount"

View File

@@ -1,14 +1,14 @@
<div class="tw-w-2/5">
<p class="tw-mt-8">
{{ "projectServiceAccountsDescription" | i18n }}
{{ "projectMachineAccountsDescription" | i18n }}
</p>
<sm-access-selector
[rows]="rows$ | async"
granteeType="serviceAccounts"
[label]="'serviceAccounts' | i18n"
[hint]="'projectServiceAccountsSelectHint' | i18n"
[columnTitle]="'serviceAccounts' | i18n"
[emptyMessage]="'projectEmptyServiceAccountAccessPolicies' | i18n"
[label]="'machineAccounts' | i18n"
[hint]="'projectMachineAccountsSelectHint' | i18n"
[columnTitle]="'machineAccounts' | i18n"
[emptyMessage]="'projectEmptyMachineAccountAccessPolicies' | i18n"
(onCreateAccessPolicies)="handleCreateAccessPolicies($event)"
(onDeleteAccessPolicy)="handleDeleteAccessPolicy($event)"
(onUpdateAccessPolicy)="handleUpdateAccessPolicy($event)"

View File

@@ -6,7 +6,7 @@
<bit-tab-link [route]="['secrets']">{{ "secrets" | i18n }}</bit-tab-link>
<ng-container *ngIf="project.write">
<bit-tab-link [route]="['people']">{{ "people" | i18n }}</bit-tab-link>
<bit-tab-link [route]="['service-accounts']">{{ "serviceAccounts" | i18n }}</bit-tab-link>
<bit-tab-link [route]="['service-accounts']">{{ "machineAccounts" | i18n }}</bit-tab-link>
</ng-container>
</bit-tab-nav-bar>
<sm-new-menu></sm-new-menu>

View File

@@ -8,7 +8,7 @@
</ng-container>
<ng-container *ngIf="data.serviceAccounts.length > 1">
{{ data.serviceAccounts.length }}
{{ "serviceAccounts" | i18n }}
{{ "machineAccounts" | i18n }}
</ng-container>
</span>
</ng-container>

View File

@@ -43,14 +43,14 @@ export class ServiceAccountDeleteDialogComponent {
get title() {
return this.data.serviceAccounts.length === 1
? this.i18nService.t("deleteServiceAccount")
: this.i18nService.t("deleteServiceAccounts");
? this.i18nService.t("deleteMachineAccount")
: this.i18nService.t("deleteMachineAccounts");
}
get dialogContent() {
return this.data.serviceAccounts.length === 1
? this.i18nService.t("deleteServiceAccountDialogMessage", this.data.serviceAccounts[0].name)
: this.i18nService.t("deleteServiceAccountsDialogMessage");
? this.i18nService.t("deleteMachineAccountDialogMessage", this.data.serviceAccounts[0].name)
: this.i18nService.t("deleteMachineAccountsDialogMessage");
}
get dialogConfirmationLabel() {
@@ -79,17 +79,17 @@ export class ServiceAccountDeleteDialogComponent {
const message =
this.data.serviceAccounts.length === 1
? "deleteServiceAccountToast"
: "deleteServiceAccountsToast";
? "deleteMachineAccountToast"
: "deleteMachineAccountsToast";
this.platformUtilsService.showToast("success", null, this.i18nService.t(message));
}
openBulkStatusDialog(bulkStatusResults: BulkOperationStatus[]) {
this.dialogService.open<unknown, BulkStatusDetails>(BulkStatusDialogComponent, {
data: {
title: "deleteServiceAccounts",
subTitle: "serviceAccounts",
columnTitle: "serviceAccountName",
title: "deleteMachineAccounts",
subTitle: "machineAccounts",
columnTitle: "machineAccountName",
message: "bulkDeleteProjectsErrorMessage",
details: bulkStatusResults,
},
@@ -100,7 +100,7 @@ export class ServiceAccountDeleteDialogComponent {
return this.data.serviceAccounts?.length === 1
? this.i18nService.t("deleteProjectConfirmMessage", this.data.serviceAccounts[0].name)
: this.i18nService.t(
"deleteServiceAccountsConfirmMessage",
"deleteMachineAccountsConfirmMessage",
this.data.serviceAccounts?.length.toString(),
);
}

View File

@@ -7,7 +7,7 @@
</div>
<div *ngIf="!loading">
<bit-form-field>
<bit-label>{{ "serviceAccountName" | i18n }}</bit-label>
<bit-label>{{ "machineAccountName" | i18n }}</bit-label>
<input appAutofocus formControlName="name" bitInput />
</bit-form-field>
</div>

View File

@@ -69,7 +69,7 @@ export class ServiceAccountDialogComponent {
this.platformUtilsService.showToast(
"error",
null,
this.i18nService.t("serviceAccountsCannotCreate"),
this.i18nService.t("machineAccountsCannotCreate"),
);
return;
}
@@ -85,14 +85,14 @@ export class ServiceAccountDialogComponent {
if (this.data.operation == OperationType.Add) {
await this.serviceAccountService.create(this.data.organizationId, serviceAccountView);
serviceAccountMessage = this.i18nService.t("serviceAccountCreated");
serviceAccountMessage = this.i18nService.t("machineAccountCreated");
} else {
await this.serviceAccountService.update(
this.data.serviceAccountId,
this.data.organizationId,
serviceAccountView,
);
serviceAccountMessage = this.i18nService.t("serviceAccountUpdated");
serviceAccountMessage = this.i18nService.t("machineAccountUpdated");
}
this.platformUtilsService.showToast("success", null, serviceAccountMessage);
@@ -107,6 +107,6 @@ export class ServiceAccountDialogComponent {
}
get title() {
return this.data.operation === OperationType.Add ? "newServiceAccount" : "editServiceAccount";
return this.data.operation === OperationType.Add ? "newMachineAccount" : "editMachineAccount";
}
}

View File

@@ -65,7 +65,7 @@ export class ServiceAccountEventsComponent extends BaseEventsComponent implement
protected getUserName() {
return {
name: this.i18nService.t("serviceAccount") + " " + this.serviceAccountId,
name: this.i18nService.t("machineAccount") + " " + this.serviceAccountId,
email: "",
};
}

View File

@@ -1,7 +1,7 @@
<form [formGroup]="formGroup" [bitSubmit]="submit">
<div class="tw-w-2/5">
<p class="tw-mt-8" *ngIf="!loading">
{{ "serviceAccountPeopleDescription" | i18n }}
{{ "machineAccountPeopleDescription" | i18n }}
</p>
<sm-access-policy-selector
[loading]="loading"

View File

@@ -131,7 +131,7 @@ export class ServiceAccountPeopleComponent implements OnInit, OnDestroy {
this.platformUtilsService.showToast(
"success",
null,
this.i18nService.t("serviceAccountAccessUpdated"),
this.i18nService.t("machineAccountAccessUpdated"),
);
} catch (e) {
this.validationService.showError(e);
@@ -210,8 +210,8 @@ export class ServiceAccountPeopleComponent implements OnInit, OnDestroy {
private async showWarning(): Promise<boolean> {
const confirmed = await this.dialogService.openSimpleDialog({
title: { key: "smAccessRemovalWarningSaTitle" },
content: { key: "smAccessRemovalWarningSaMessage" },
title: { key: "smAccessRemovalWarningMaTitle" },
content: { key: "smAccessRemovalWarningMaMessage" },
acceptButtonText: { key: "removeAccess" },
cancelButtonText: { key: "cancel" },
type: "warning",
@@ -222,7 +222,7 @@ export class ServiceAccountPeopleComponent implements OnInit, OnDestroy {
private async showAccessTokenStillAvailableWarning(): Promise<void> {
await this.dialogService.openSimpleDialog({
title: { key: "saPeopleWarningTitle" },
content: { key: "saPeopleWarningMessage" },
content: { key: "maPeopleWarningMessage" },
type: "warning",
acceptButtonText: { key: "close" },
cancelButtonText: null,

View File

@@ -1,6 +1,6 @@
<div class="tw-mt-4 tw-w-2/5">
<p class="tw-mt-6">
{{ "serviceAccountProjectsDescription" | i18n }}
{{ "machineAccountProjectsDescription" | i18n }}
</p>
<sm-access-selector
[rows]="rows$ | async"
@@ -8,7 +8,7 @@
[label]="'projects' | i18n"
[hint]="'newSaSelectAccess' | i18n"
[columnTitle]="'projects' | i18n"
[emptyMessage]="'serviceAccountEmptyProjectAccesspolicies' | i18n"
[emptyMessage]="'serviceAccountEmptyProjectAccessPolicies' | i18n"
(onCreateAccessPolicies)="handleCreateAccessPolicies($event)"
(onDeleteAccessPolicy)="handleDeleteAccessPolicy($event)"
(onUpdateAccessPolicy)="handleUpdateAccessPolicy($event)"

View File

@@ -5,7 +5,7 @@
>
<bit-breadcrumbs slot="breadcrumbs">
<bit-breadcrumb [route]="['..']" icon="bwi-angle-left">{{
"serviceAccounts" | i18n
"machineAccounts" | i18n
}}</bit-breadcrumb>
</bit-breadcrumbs>
<sm-new-menu></sm-new-menu>

View File

@@ -49,7 +49,7 @@ export class ServiceAccountComponent implements OnInit, OnDestroy {
this.platformUtilsService.showToast(
"error",
null,
this.i18nService.t("notFound", this.i18nService.t("serviceAccount")),
this.i18nService.t("notFound", this.i18nService.t("machineAccount")),
);
});
return EMPTY;

View File

@@ -3,8 +3,8 @@
</div>
<bit-no-items *ngIf="serviceAccounts?.length == 0">
<ng-container slot="title">{{ "serviceAccountsNoItemsTitle" | i18n }}</ng-container>
<ng-container slot="description">{{ "serviceAccountsNoItemsMessage" | i18n }}</ng-container>
<ng-container slot="title">{{ "machineAccountsNoItemsTitle" | i18n }}</ng-container>
<ng-container slot="description">{{ "machineAccountsNoItemsMessage" | i18n }}</ng-container>
<button
slot="button"
type="button"
@@ -13,7 +13,7 @@
(click)="newServiceAccountEvent.emit()"
>
<i class="bwi bwi-plus" aria-hidden="true"></i>
{{ "newServiceAccount" | i18n }}
{{ "newMachineAccount" | i18n }}
</button>
</bit-no-items>
@@ -80,16 +80,16 @@
<bit-menu #serviceAccountMenu>
<a type="button" bitMenuItem [routerLink]="serviceAccount.id">
<i class="bwi bwi-fw bwi-eye" aria-hidden="true"></i>
{{ "viewServiceAccount" | i18n }}
{{ "viewMachineAccount" | i18n }}
</a>
<button type="button" bitMenuItem (click)="editServiceAccountEvent.emit(serviceAccount.id)">
<i class="bwi bwi-fw bwi-pencil" aria-hidden="true"></i>
{{ "editServiceAccount" | i18n }}
{{ "editMachineAccount" | i18n }}
</button>
<button type="button" bitMenuItem (click)="delete(serviceAccount)">
<i class="bwi bwi-fw bwi-trash tw-text-danger" aria-hidden="true"></i>
<span class="tw-text-danger">
{{ "deleteServiceAccount" | i18n }}
{{ "deleteMachineAccount" | i18n }}
</span>
</button>
</bit-menu>
@@ -101,7 +101,7 @@
<button type="button" bitMenuItem (click)="bulkDeleteServiceAccounts()">
<i class="bwi bwi-fw bwi-trash tw-text-danger" aria-hidden="true"></i>
<span class="tw-text-danger">
{{ "deleteServiceAccounts" | i18n }}
{{ "deleteMachineAccounts" | i18n }}
</span>
</button>
</bit-menu>

View File

@@ -1,6 +1,6 @@
<app-header>
<bit-search
[placeholder]="'searchServiceAccounts' | i18n"
[placeholder]="'searchMachineAccounts' | i18n"
[(ngModel)]="search"
class="tw-w-80"
></bit-search>

View File

@@ -19,6 +19,6 @@
</button>
<button type="button" bitMenuItem (click)="openServiceAccountDialog()">
<i class="bwi bwi-fw bwi-wrench" aria-hidden="true"></i>
{{ "serviceAccount" | i18n }}
{{ "machineAccount" | i18n }}
</button>
</bit-menu>

View File

@@ -58,7 +58,7 @@ const routes: Routes = [
path: "service-accounts",
loadChildren: () => ServiceAccountsModule,
data: {
titleId: "serviceAccounts",
titleId: "machineAccounts",
},
},
{