Skip to content

Commit

Permalink
Show custom profiles in default profiles selection
Browse files Browse the repository at this point in the history
  • Loading branch information
Ranhiru committed Oct 9, 2023
1 parent 642db6a commit 5d1a35a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
18 changes: 10 additions & 8 deletions tabby-settings/src/components/profilesSettingsTab.component.pug
Expand Up @@ -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
Expand Down
Expand Up @@ -21,6 +21,7 @@ interface CollapsableProfileGroup extends ProfileGroup {
export class ProfilesSettingsTabComponent extends BaseComponent {
builtinProfiles: PartialProfile<Profile>[] = []
templateProfiles: PartialProfile<Profile>[] = []
customProfiles: PartialProfile<Profile>[] = []
profileGroups: PartialProfileGroup<CollapsableProfileGroup>[]
filter = ''
Platform = Platform
Expand All @@ -42,6 +43,7 @@ export class ProfilesSettingsTabComponent extends BaseComponent {
async ngOnInit (): Promise<void> {
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()
Expand Down

0 comments on commit 5d1a35a

Please sign in to comment.