1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-11-27 00:50:49 +03:00

fixed #7727 - allow hiding individual profiles from the selector

This commit is contained in:
Eugene Pankov 2023-06-04 21:22:05 +02:00
parent e813133f12
commit c983743b57
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4
4 changed files with 54 additions and 7 deletions

View File

@ -48,6 +48,7 @@ enableExperimentalFeatures: false
pluginBlacklist: [] pluginBlacklist: []
commandBlacklist: [] commandBlacklist: []
providerBlacklist: [] providerBlacklist: []
profileBlacklist: []
hacks: hacks:
disableGPU: false disableGPU: false
disableVibrancyWhileDragging: false disableVibrancyWhileDragging: false

View File

@ -153,6 +153,8 @@ export class ProfilesService {
profiles = profiles.filter(x => !x.isTemplate) 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> => ({ options = [...options, ...profiles.map((p): SelectorOption<void> => ({
...this.selectorOptionForProfile(p), ...this.selectorOptionForProfile(p),
weight: p.isBuiltin ? 2 : 1, weight: p.isBuiltin ? 2 : 1,

View File

@ -70,17 +70,47 @@ ul.nav-tabs(ngbNav, #nav='ngbNav')
button.btn.btn-link.hover-reveal.ms-1((click)='$event.stopPropagation(); launchProfile(profile)') button.btn.btn-link.hover-reveal.ms-1((click)='$event.stopPropagation(); launchProfile(profile)')
i.fas.fa-play i.fas.fa-play
button.btn.btn-link.hover-reveal.ms-1((click)='$event.stopPropagation(); newProfile(profile)') .ms-1.hover-reveal(ngbDropdown, placement='bottom-right top-right auto')
i.fas.fa-copy 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( button.dropdown-item(
*ngIf='!profile.isBuiltin', ngbDropdownItem,
(click)='$event.stopPropagation(); deleteProfile(profile)' *ngIf='profile.id && !isProfileBlacklisted(profile)',
) (click)='$event.stopPropagation(); blacklistProfile(profile)'
i.fas.fa-trash-alt )
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(class='badge text-bg-{{getTypeColorClass(profile)}}') {{getTypeLabel(profile)}}
.ms-1.text-danger.fas.fa-eye-slash(*ngIf='isProfileBlacklisted(profile)')
li(ngbNavItem) li(ngbNavItem)
a(ngbNavLink, translate) Advanced a(ngbNavLink, translate) Advanced
ng-template(ngbNavContent) ng-template(ngbNavContent)

View File

@ -297,4 +297,18 @@ export class ProfilesSettingsTabComponent extends BaseComponent {
this.config.store.profileDefaults[provider.id] = model this.config.store.profileDefaults[provider.id] = model
await this.config.save() 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)
}
} }