mirror of
https://github.com/Eugeny/tabby.git
synced 2025-07-20 02:18:01 +00:00
Revert "wip ref(core): update profileDefaults in view of Eugeny/tabby#3999"
This reverts commit 272b9ee5dc
.
This commit is contained in:
@@ -170,7 +170,7 @@ ul.nav-tabs(ngbNav, #nav='ngbNav')
|
||||
|
||||
.list-group.mt-3.mb-3.content-box
|
||||
a.list-group-item.list-group-item-action(
|
||||
(click)='editGlobalDefaults(provider)',
|
||||
(click)='editDefaults(provider)',
|
||||
*ngFor='let provider of profileProviders'
|
||||
) {{provider.name|translate}}
|
||||
|
||||
|
@@ -277,16 +277,12 @@ export class ProfilesSettingsTabComponent extends BaseComponent {
|
||||
window.localStorage.profileGroupCollapsed = JSON.stringify(profileGroupCollapsed)
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit Defaults for a given profile provider
|
||||
* defaultsId: used to identify defaults stored in config (ex. value: group ID)
|
||||
*/
|
||||
async editDefaults (defaultsId: string, provider: ProfileProvider<Profile>): Promise<void> {
|
||||
async editDefaults (provider: ProfileProvider<Profile>): Promise<void> {
|
||||
const modal = this.ngbModal.open(
|
||||
EditProfileModalComponent,
|
||||
{ size: 'lg' },
|
||||
)
|
||||
const model = this.profilesService.getProviderDefaults(defaultsId, provider)
|
||||
const model = this.config.store.profileDefaults[provider.id] ?? {}
|
||||
model.type = provider.id
|
||||
modal.componentInstance.profile = Object.assign({}, model)
|
||||
modal.componentInstance.profileProvider = provider
|
||||
@@ -299,17 +295,10 @@ export class ProfilesSettingsTabComponent extends BaseComponent {
|
||||
delete model[k]
|
||||
}
|
||||
Object.assign(model, result)
|
||||
this.profilesService.setProviderDefaults(defaultsId, provider, model)
|
||||
this.config.store.profileDefaults[provider.id] = model
|
||||
await this.config.save()
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit global Defaults for a given profile provider
|
||||
*/
|
||||
async editGlobalDefaults (provider: ProfileProvider<Profile>): Promise<void> {
|
||||
return this.editDefaults('global', provider)
|
||||
}
|
||||
|
||||
blacklistProfile (profile: PartialProfile<Profile>): void {
|
||||
this.config.store.profileBlacklist = [...this.config.store.profileBlacklist, profile.id]
|
||||
this.config.save()
|
||||
|
Reference in New Issue
Block a user