ref(core): profiles.services optionnal options object argument

This commit is contained in:
Clem
2023-08-25 16:35:53 +02:00
parent 06859de2de
commit 5e5c80832d
3 changed files with 26 additions and 24 deletions

View File

@@ -57,7 +57,7 @@ export class EditProfileModalComponent<P extends Profile> {
ngOnInit () {
this._profile = this.profile
this.profile = this.profilesService.getConfigProxyForProfile(this.profile, this.defaultsMode === 'enabled', this.defaultsMode === 'group')
this.profile = this.profilesService.getConfigProxyForProfile(this.profile, { skipGlobalDefaults: this.defaultsMode === 'enabled', skipGroupDefaults: this.defaultsMode === 'group' })
}
ngAfterViewInit () {

View File

@@ -41,7 +41,7 @@ export class ProfilesSettingsTabComponent extends BaseComponent {
async ngOnInit (): Promise<void> {
this.refresh()
this.builtinProfiles = (await this.profilesService.getProfiles(true, false)).filter(x => x.isBuiltin)
this.builtinProfiles = (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()
@@ -239,13 +239,13 @@ export class ProfilesSettingsTabComponent extends BaseComponent {
deleteProfiles = true
}
await this.profilesService.deleteProfileGroup(group, deleteProfiles).then(() => this.config.save())
await this.profilesService.deleteProfileGroup(group, { deleteProfiles }).then(() => this.config.save())
}
}
async refresh (): Promise<void> {
const profileGroupCollapsed = JSON.parse(window.localStorage.profileGroupCollapsed ?? '{}')
const groups = await this.profilesService.getProfileGroups(true, true)
const groups = await this.profilesService.getProfileGroups({ includeNonUserGroup: true, includeProfiles: true })
groups.sort((a, b) => a.name.localeCompare(b.name))
groups.sort((a, b) => (a.id === 'built-in' || !a.editable ? 1 : 0) - (b.id === 'built-in' || !b.editable ? 1 : 0))
groups.sort((a, b) => (a.id === 'ungrouped' ? 0 : 1) - (b.id === 'ungrouped' ? 0 : 1))