1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-11 05:43:41 +00:00

[PM-13818] Allow user to edit self-hosted url during registration (#11790)

* Trigger self hosted settings dialog on select close

* Simplify triggering self hosted env config dialog

* Always emit selected value

* Update variable naming of lastSelectedValue to userSelectedValue to better reflect purpose

* Add comment for userSelectedValue variable

* Remove userSelectedValue and simply emit a closed event

* Remove passing selectedRegion in closed event
This commit is contained in:
Alec Rippberger
2024-11-06 13:17:59 -06:00
committed by GitHub
parent 4cc562c228
commit 619651ca55
4 changed files with 28 additions and 9 deletions

View File

@@ -7,6 +7,7 @@
(blur)="onBlur()"
[labelForId]="labelForId"
[clearable]="false"
(close)="onClose()"
appendTo="body"
>
<ng-template ng-option-tmp let-item="item">

View File

@@ -7,6 +7,8 @@ import {
QueryList,
Self,
ViewChild,
Output,
EventEmitter,
} from "@angular/core";
import { ControlValueAccessor, NgControl, Validators } from "@angular/forms";
import { NgSelectComponent } from "@ng-select/ng-select";
@@ -31,6 +33,7 @@ export class SelectComponent<T> implements BitFormFieldControl, ControlValueAcce
/** Optional: Options can be provided using an array input or using `bit-option` */
@Input() items: Option<T>[] = [];
@Input() placeholder = this.i18nService.t("selectPlaceholder");
@Output() closed = new EventEmitter();
protected selectedValue: T;
protected selectedOption: Option<T>;
@@ -156,4 +159,9 @@ export class SelectComponent<T> implements BitFormFieldControl, ControlValueAcce
private findSelectedOption(items: Option<T>[], value: T): Option<T> | undefined {
return items.find((item) => item.value === value);
}
/**Emits the closed event. */
protected onClose() {
this.closed.emit();
}
}