mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 13:53:34 +00:00
[SM-613] Misc Onboarding UX fixes (#4953)
* make dismiss always visible * reorder tasks; hide create secret task if no projects * update stories
This commit is contained in:
@@ -18,13 +18,7 @@
|
|||||||
<ng-content></ng-content>
|
<ng-content></ng-content>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="tw-p-4 tw-pt-0">
|
<div class="tw-p-4 tw-pt-0">
|
||||||
<button
|
<button bitLink type="button" class="tw-ml-auto tw-block" (click)="dismiss.emit()">
|
||||||
bitLink
|
|
||||||
type="button"
|
|
||||||
class="tw-ml-auto tw-block"
|
|
||||||
[ngClass]="{ 'tw-invisible': !isComplete }"
|
|
||||||
(click)="dismiss.emit()"
|
|
||||||
>
|
|
||||||
{{ "dismiss" | i18n }}
|
{{ "dismiss" | i18n }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -23,10 +23,6 @@ export class OnboardingComponent {
|
|||||||
return this.tasks.length === 0 ? 0 : (this.amountCompleted / this.tasks.length) * 100;
|
return this.tasks.length === 0 ? 0 : (this.amountCompleted / this.tasks.length) * 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected get isComplete(): boolean {
|
|
||||||
return this.tasks.length > 0 && this.tasks.length === this.amountCompleted;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected toggle() {
|
protected toggle() {
|
||||||
this.open = !this.open;
|
this.open = !this.open;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,6 +54,11 @@ const Template: Story = (args) => ({
|
|||||||
{{ "downloadThe" | i18n }} <a bitLink routerLink="">{{ "smCLI" | i18n }}</a>
|
{{ "downloadThe" | i18n }} <a bitLink routerLink="">{{ "smCLI" | i18n }}</a>
|
||||||
</span>
|
</span>
|
||||||
</sm-onboarding-task>
|
</sm-onboarding-task>
|
||||||
|
<sm-onboarding-task
|
||||||
|
[title]="'createProject' | i18n"
|
||||||
|
icon="bwi-collection"
|
||||||
|
[completed]="createProject"
|
||||||
|
></sm-onboarding-task>
|
||||||
<sm-onboarding-task
|
<sm-onboarding-task
|
||||||
[title]="'importSecrets' | i18n"
|
[title]="'importSecrets' | i18n"
|
||||||
icon="bwi-download"
|
icon="bwi-download"
|
||||||
@@ -64,11 +69,6 @@ const Template: Story = (args) => ({
|
|||||||
icon="bwi-key"
|
icon="bwi-key"
|
||||||
[completed]="createSecret"
|
[completed]="createSecret"
|
||||||
></sm-onboarding-task>
|
></sm-onboarding-task>
|
||||||
<sm-onboarding-task
|
|
||||||
[title]="'createProject' | i18n"
|
|
||||||
icon="bwi-collection"
|
|
||||||
[completed]="createProject"
|
|
||||||
></sm-onboarding-task>
|
|
||||||
</sm-onboarding>
|
</sm-onboarding>
|
||||||
`,
|
`,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -14,6 +14,13 @@
|
|||||||
{{ "downloadThe" | i18n }} <a bitLink routerLink="">{{ "smCLI" | i18n }}</a>
|
{{ "downloadThe" | i18n }} <a bitLink routerLink="">{{ "smCLI" | i18n }}</a>
|
||||||
</span>
|
</span>
|
||||||
</sm-onboarding-task>
|
</sm-onboarding-task>
|
||||||
|
<sm-onboarding-task
|
||||||
|
*ngIf="userIsAdmin"
|
||||||
|
[title]="'createProject' | i18n"
|
||||||
|
(click)="openNewProjectDialog()"
|
||||||
|
icon="bwi-collection"
|
||||||
|
[completed]="view.tasks.createProject"
|
||||||
|
></sm-onboarding-task>
|
||||||
<sm-onboarding-task
|
<sm-onboarding-task
|
||||||
*ngIf="userIsAdmin"
|
*ngIf="userIsAdmin"
|
||||||
[title]="'importSecrets' | i18n"
|
[title]="'importSecrets' | i18n"
|
||||||
@@ -22,18 +29,12 @@
|
|||||||
[completed]="view.tasks.importSecrets"
|
[completed]="view.tasks.importSecrets"
|
||||||
></sm-onboarding-task>
|
></sm-onboarding-task>
|
||||||
<sm-onboarding-task
|
<sm-onboarding-task
|
||||||
|
*ngIf="view.tasks.createProject"
|
||||||
[title]="'createSecret' | i18n"
|
[title]="'createSecret' | i18n"
|
||||||
(click)="openSecretDialog()"
|
(click)="openSecretDialog()"
|
||||||
icon="bwi-key"
|
icon="bwi-key"
|
||||||
[completed]="view.tasks.createSecret"
|
[completed]="view.tasks.createSecret"
|
||||||
></sm-onboarding-task>
|
></sm-onboarding-task>
|
||||||
<sm-onboarding-task
|
|
||||||
*ngIf="userIsAdmin"
|
|
||||||
[title]="'createProject' | i18n"
|
|
||||||
(click)="openNewProjectDialog()"
|
|
||||||
icon="bwi-collection"
|
|
||||||
[completed]="view.tasks.createProject"
|
|
||||||
></sm-onboarding-task>
|
|
||||||
</sm-onboarding>
|
</sm-onboarding>
|
||||||
|
|
||||||
<div class="tw-mt-6 tw-flex tw-flex-col tw-gap-6">
|
<div class="tw-mt-6 tw-flex tw-flex-col tw-gap-6">
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ export class OverviewComponent implements OnInit, OnDestroy {
|
|||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
this.stateService.setSMOnboardingTasks(null);
|
||||||
const orgId$ = this.route.params.pipe(
|
const orgId$ = this.route.params.pipe(
|
||||||
map((p) => p.organizationId),
|
map((p) => p.organizationId),
|
||||||
distinctUntilChanged()
|
distinctUntilChanged()
|
||||||
@@ -297,5 +298,11 @@ export class OverviewComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
protected hideOnboarding() {
|
protected hideOnboarding() {
|
||||||
this.showOnboarding = false;
|
this.showOnboarding = false;
|
||||||
|
this.saveCompletedTasks(this.organizationId, {
|
||||||
|
importSecrets: true,
|
||||||
|
createSecret: true,
|
||||||
|
createProject: true,
|
||||||
|
createServiceAccount: true,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user