Skip to content

Commit

Permalink
Removed conditional for displaying search exit component (#2269)
Browse files Browse the repository at this point in the history
  • Loading branch information
justjam2013 authored Dec 8, 2024
1 parent 8a1da3a commit 7a246d7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ui/src/app/modules/plugins/plugins.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ <h3 class="primary-text m-0">{{ 'menu.label_plugins' | translate }}</h3>
[placeholder]="'plugins.placeholder_search_plugin' | translate"
formControlName="query"
/>
<a class="hb-npm-search-clear" href="javascript:void(0)" (click)="onClearSearch()">
<i class="far fa-fw fa-times-circle" *ngIf="form.controls['query'].value"></i>
<a class="hb-npm-search-clear" href="javascript:void(0)" (click)="onClearSearch()" *ngIf="showExitButton">
<i class="far fa-fw fa-times-circle"></i>
</a>
</form>
</div>
Expand Down
5 changes: 3 additions & 2 deletions ui/src/app/modules/plugins/plugins.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export class PluginsComponent implements OnInit, OnDestroy {
public loading = true
public installedPlugins: any = []
public childBridges = []
public showExitButton = false
public form = new FormGroup({
query: new FormControl('', [Validators.required]),
})
Expand Down Expand Up @@ -73,7 +74,7 @@ export class PluginsComponent implements OnInit, OnDestroy {

async loadInstalledPlugins() {
this.form.setValue({ query: '' })

this.showExitButton = false
this.installedPlugins = []
this.loading = true

Expand Down Expand Up @@ -155,6 +156,7 @@ export class PluginsComponent implements OnInit, OnDestroy {
search() {
this.installedPlugins = []
this.loading = true
this.showExitButton = true

this.$api.get(`/plugins/search/${encodeURIComponent(this.form.value.query)}`).subscribe({
next: (data) => {
Expand All @@ -172,7 +174,6 @@ export class PluginsComponent implements OnInit, OnDestroy {
}

onClearSearch() {
this.form.setValue({ query: '' })
this.loadInstalledPlugins()
}

Expand Down

0 comments on commit 7a246d7

Please sign in to comment.