From 5d1a35a2852b45a2d1dac49f17b57909f28b3eb0 Mon Sep 17 00:00:00 2001 From: Jude Cooray Date: Mon, 9 Oct 2023 20:29:06 +1100 Subject: [PATCH] Show custom profiles in default profiles selection --- .../profilesSettingsTab.component.pug | 18 ++++++++++-------- .../profilesSettingsTab.component.ts | 2 ++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/tabby-settings/src/components/profilesSettingsTab.component.pug b/tabby-settings/src/components/profilesSettingsTab.component.pug index f6d60b1a57..9aa25f9520 100644 --- a/tabby-settings/src/components/profilesSettingsTab.component.pug +++ b/tabby-settings/src/components/profilesSettingsTab.component.pug @@ -12,14 +12,16 @@ ul.nav-tabs(ngbNav, #nav='ngbNav') [(ngModel)]='config.store.terminal.profile', (ngModelChange)='config.save()', ) - option( - *ngFor='let profile of profiles', - [ngValue]='profile.id' - ) {{profile.name}} - option( - *ngFor='let profile of builtinProfiles', - [ngValue]='profile.id' - ) {{profile.name}} + optgroup([label]='"Custom Profiles"|translate') + option( + *ngFor='let profile of customProfiles', + [ngValue]='profile.id' + ) {{profile.name}} + optgroup([label]='"Built-in Profiles"|translate') + option( + *ngFor='let profile of builtinProfiles', + [ngValue]='profile.id' + ) {{profile.name}} .d-flex.mb-3 .input-group diff --git a/tabby-settings/src/components/profilesSettingsTab.component.ts b/tabby-settings/src/components/profilesSettingsTab.component.ts index 4bfe2cc47a..e2c0339270 100644 --- a/tabby-settings/src/components/profilesSettingsTab.component.ts +++ b/tabby-settings/src/components/profilesSettingsTab.component.ts @@ -21,6 +21,7 @@ interface CollapsableProfileGroup extends ProfileGroup { export class ProfilesSettingsTabComponent extends BaseComponent { builtinProfiles: PartialProfile[] = [] templateProfiles: PartialProfile[] = [] + customProfiles: PartialProfile[] = [] profileGroups: PartialProfileGroup[] filter = '' Platform = Platform @@ -42,6 +43,7 @@ export class ProfilesSettingsTabComponent extends BaseComponent { async ngOnInit (): Promise { this.refresh() this.builtinProfiles = (await this.profilesService.getProfiles()).filter(x => x.isBuiltin) + this.customProfiles = (await this.profilesService.getProfiles()).filter(x => !x.isBuiltin) this.templateProfiles = this.builtinProfiles.filter(x => x.isTemplate) this.builtinProfiles = this.builtinProfiles.filter(x => !x.isTemplate) this.refresh()