Skip to content

Commit

Permalink
feat: click env select open env rightbar
Browse files Browse the repository at this point in the history
  • Loading branch information
kungfuboy committed Jul 28, 2022
1 parent 172f4bf commit 0f5dc0e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/workbench/browser/src/app/pages/api/api.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
nzAllowClear
i18n-nzPlaceHolder="Environment Dropdown placeholder"
nzPlaceHolder="Environment"
#envSelect
>
<nz-option *ngFor="let item of envList" [nzValue]="item.uuid" [nzLabel]="item.name"></nz-option>
</nz-select>
Expand Down
10 changes: 9 additions & 1 deletion src/workbench/browser/src/app/pages/api/api.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { ApiService } from './api.service';
import { StorageService } from '../../shared/services/storage';
import { Change } from '../../shared/store/env.state';
import { RemoteService } from 'eo/workbench/browser/src/app/shared/services/remote/remote.service';
import { NzSelectComponent } from 'ng-zorro-antd/select';

@Component({
selector: 'eo-api',
Expand Down Expand Up @@ -86,6 +87,11 @@ export class ApiComponent implements OnInit, OnDestroy {
});
}
});
this.messageService.get().subscribe(({ type, data }) => {
if (type === 'toggleEnv') {
this.activeBar = data;
}
});
}
ngOnDestroy() {
this.destroy$.next();
Expand Down Expand Up @@ -138,7 +144,9 @@ export class ApiComponent implements OnInit, OnDestroy {

gotoEnvManager() {
// * switch to env
this.tabsIndex = 1;
this.messageService.send({ type: 'toggleEnv', data: true });
// * close select
this.isOpen = false;
}

toggleRightBar(status = null) {
Expand Down

0 comments on commit 0f5dc0e

Please sign in to comment.