mirror of
https://github.com/Eugeny/tabby.git
synced 2024-11-27 06:00:26 +08:00
fixed #7727 - allow hiding individual profiles from the selector
This commit is contained in:
parent
e813133f12
commit
c983743b57
@ -48,6 +48,7 @@ enableExperimentalFeatures: false
|
||||
pluginBlacklist: []
|
||||
commandBlacklist: []
|
||||
providerBlacklist: []
|
||||
profileBlacklist: []
|
||||
hacks:
|
||||
disableGPU: false
|
||||
disableVibrancyWhileDragging: false
|
||||
|
@ -153,6 +153,8 @@ export class ProfilesService {
|
||||
|
||||
profiles = profiles.filter(x => !x.isTemplate)
|
||||
|
||||
profiles = profiles.filter(x => x.id && !this.config.store.profileBlacklist.includes(x.id))
|
||||
|
||||
options = [...options, ...profiles.map((p): SelectorOption<void> => ({
|
||||
...this.selectorOptionForProfile(p),
|
||||
weight: p.isBuiltin ? 2 : 1,
|
||||
|
@ -70,17 +70,47 @@ ul.nav-tabs(ngbNav, #nav='ngbNav')
|
||||
button.btn.btn-link.hover-reveal.ms-1((click)='$event.stopPropagation(); launchProfile(profile)')
|
||||
i.fas.fa-play
|
||||
|
||||
button.btn.btn-link.hover-reveal.ms-1((click)='$event.stopPropagation(); newProfile(profile)')
|
||||
i.fas.fa-copy
|
||||
.ms-1.hover-reveal(ngbDropdown, placement='bottom-right top-right auto')
|
||||
button.btn.btn-link.ms-1(
|
||||
ngbDropdownToggle,
|
||||
(click)='$event.stopPropagation()'
|
||||
)
|
||||
i.fas.fa-fw.fa-ellipsis-vertical
|
||||
div(ngbDropdownMenu)
|
||||
button.dropdown-item(
|
||||
ngbDropdownItem,
|
||||
(click)='$event.stopPropagation(); newProfile(profile)'
|
||||
)
|
||||
i.fas.fa-fw.fa-copy
|
||||
span(translate) Duplicate
|
||||
|
||||
button.btn.btn-link.hover-reveal.ms-1(
|
||||
*ngIf='!profile.isBuiltin',
|
||||
(click)='$event.stopPropagation(); deleteProfile(profile)'
|
||||
)
|
||||
i.fas.fa-trash-alt
|
||||
button.dropdown-item(
|
||||
ngbDropdownItem,
|
||||
*ngIf='profile.id && !isProfileBlacklisted(profile)',
|
||||
(click)='$event.stopPropagation(); blacklistProfile(profile)'
|
||||
)
|
||||
i.fas.fa-fw.fa-eye-slash
|
||||
span(translate) Hide
|
||||
|
||||
button.dropdown-item(
|
||||
ngbDropdownItem,
|
||||
*ngIf='profile.id && isProfileBlacklisted(profile)',
|
||||
(click)='$event.stopPropagation(); unblacklistProfile(profile)'
|
||||
)
|
||||
i.fas.fa-fw.fa-eye
|
||||
span(translate) Show
|
||||
|
||||
button.dropdown-item(
|
||||
*ngIf='!profile.isBuiltin',
|
||||
(click)='$event.stopPropagation(); deleteProfile(profile)'
|
||||
)
|
||||
i.fas.fa-fw.fa-trash-alt
|
||||
span(translate) Delete
|
||||
|
||||
.ms-1(class='badge text-bg-{{getTypeColorClass(profile)}}') {{getTypeLabel(profile)}}
|
||||
|
||||
.ms-1.text-danger.fas.fa-eye-slash(*ngIf='isProfileBlacklisted(profile)')
|
||||
|
||||
li(ngbNavItem)
|
||||
a(ngbNavLink, translate) Advanced
|
||||
ng-template(ngbNavContent)
|
||||
|
@ -297,4 +297,18 @@ export class ProfilesSettingsTabComponent extends BaseComponent {
|
||||
this.config.store.profileDefaults[provider.id] = model
|
||||
await this.config.save()
|
||||
}
|
||||
|
||||
blacklistProfile (profile: PartialProfile<Profile>): void {
|
||||
this.config.store.profileBlacklist = [...this.config.store.profileBlacklist, profile.id]
|
||||
this.config.save()
|
||||
}
|
||||
|
||||
unblacklistProfile (profile: PartialProfile<Profile>): void {
|
||||
this.config.store.profileBlacklist = this.config.store.profileBlacklist.filter(x => x !== profile.id)
|
||||
this.config.save()
|
||||
}
|
||||
|
||||
isProfileBlacklisted (profile: PartialProfile<Profile>): boolean {
|
||||
return profile.id && this.config.store.profileBlacklist.includes(profile.id)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user