-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core/settings): #3999 Allow groups to specify settings that host…
…s inherit
- Loading branch information
Showing
8 changed files
with
189 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
tabby-settings/src/components/editProfileGroupModal.component.pug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
.modal-header | ||
h3.m-0 {{group.name}} | ||
|
||
.modal-body | ||
.row | ||
.col-12.col-lg-4 | ||
.mb-3 | ||
label(translate) Name | ||
input.form-control( | ||
type='text', | ||
autofocus, | ||
[(ngModel)]='group.name', | ||
) | ||
|
||
.col-12.col-lg-8 | ||
.form-line.content-box | ||
.header | ||
.title(translate) Default profile group settings | ||
.description(translate) These apply to all profiles of a given type in this group | ||
|
||
.list-group.mt-3.mb-3.content-box | ||
a.list-group-item.list-group-item-action( | ||
(click)='editDefaults(provider)', | ||
*ngFor='let provider of providers' | ||
) {{provider.name|translate}} | ||
|
||
.modal-footer | ||
button.btn.btn-primary((click)='save()', translate) Save | ||
button.btn.btn-danger((click)='cancel()', translate) Cancel |
34 changes: 34 additions & 0 deletions
34
tabby-settings/src/components/editProfileGroupModal.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ | ||
import { Component, Input } from '@angular/core' | ||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap' | ||
import { ConfigProxy, ProfileGroup, Profile, ProfileProvider } from 'tabby-core' | ||
|
||
/** @hidden */ | ||
@Component({ | ||
templateUrl: './editProfileGroupModal.component.pug', | ||
}) | ||
export class EditProfileGroupModalComponent<G extends ProfileGroup> { | ||
@Input() group: G & ConfigProxy | ||
@Input() providers: ProfileProvider<Profile>[] | ||
|
||
constructor ( | ||
private modalInstance: NgbActiveModal, | ||
) {} | ||
|
||
save () { | ||
this.modalInstance.close({ group: this.group }) | ||
} | ||
|
||
cancel () { | ||
this.modalInstance.dismiss() | ||
} | ||
|
||
editDefaults (provider: ProfileProvider<Profile>) { | ||
this.modalInstance.close({ group: this.group, provider }) | ||
} | ||
} | ||
|
||
export interface EditProfileGroupModalComponentResult<G extends ProfileGroup> { | ||
group: G | ||
provider?: ProfileProvider<Profile> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.