Skip to content

Commit

Permalink
feat: modal to dropmenu + card
Browse files Browse the repository at this point in the history
  • Loading branch information
kungfuboy committed Jul 13, 2022
1 parent 963dc6e commit 99850ea
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 18 deletions.
5 changes: 4 additions & 1 deletion src/workbench/browser/src/app/pages/api/api.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,13 @@
class="flex items-center justify-center mx-1 icon"
i18n-title
title="Quick look"
(click)="handleShowEnv()"
nz-dropdown
nzTrigger="click"
[nzDropdownMenu]="envParams"
>
<eo-iconpark-icon name="eyes"></eo-iconpark-icon>
</span>
<nz-dropdown-menu #envParams="nzDropdownMenu"> <env-list></env-list> </nz-dropdown-menu>
</div>
</div>
<div class="content_container {{ this.id ? 'has_tab_page' : '' }}">
Expand Down
13 changes: 0 additions & 13 deletions src/workbench/browser/src/app/pages/api/api.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ import { Message, MessageService } from '../../shared/services/message';
import { ApiService } from './api.service';
import { StorageService } from '../../shared/services/storage';
import { Change } from '../../shared/store/env.state';
import { NzModalRef } from 'ng-zorro-antd/modal';
import { ModalService } from '../../shared/services/modal.service';
import { RemoteService } from 'eo/workbench/browser/src/app/shared/services/remote/remote.service';
import { EnvListComponent } from 'eo/workbench/browser/src/app/shared/components/env-list/env-list.component';

@Component({
selector: 'eo-api',
Expand Down Expand Up @@ -50,7 +47,6 @@ export class ApiComponent implements OnInit, OnDestroy {
private messageService: MessageService,
private storage: StorageService,
private remoteService: RemoteService,
private modalService: ModalService,
private store: Store
) {}

Expand Down Expand Up @@ -168,14 +164,5 @@ export class ApiComponent implements OnInit, OnDestroy {
}
});
}

handleShowEnv() {
const modal: NzModalRef = this.modalService.create({
nzTitle: 'Environment',
nzContent: EnvListComponent,
nzClosable: true,
nzFooter: null,
});
}
handleEnvSelectStatus(event: boolean) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import { StorageRes, StorageResStatus } from '../../../shared/services/storage/i
import { StorageService } from '../../services/storage';

@Component({
selector: '',
template: ` <span class="text-gray-400">Environment variable</span>
selector: 'env-list',
template: ` <nz-card style="width:300px">
<span class="text-gray-400">Environment variable</span>
<!-- <span class="my-2">{{ item.name }}</span> -->
<div *ngFor="let it of envParams" class="flex items-center justify-between h-8">
<span class="w-1/3 text-gray-500">{{ it.name }}</span>
<span class="w-2/3 text-gray-500">{{ it.description }}</span>
</div>`,
</div>
</nz-card>`,
styleUrls: [],
})
export class EnvListComponent implements OnInit {
Expand Down
4 changes: 3 additions & 1 deletion src/workbench/browser/src/app/shared/shared.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { NzResultModule } from 'ng-zorro-antd/result';
import { NzDropDownModule } from 'ng-zorro-antd/dropdown';
import { NzDescriptionsModule } from 'ng-zorro-antd/descriptions';
import { NzSpinModule } from 'ng-zorro-antd/spin';
import { NzCardModule } from 'ng-zorro-antd/card';

import { NzNotificationModule } from 'ng-zorro-antd/notification';
import { NzMessageModule } from 'ng-zorro-antd/message';
Expand Down Expand Up @@ -48,6 +49,7 @@ const COMPONENTS = [
NzResultModule,
NzDropDownModule,
NzSpinModule,
NzCardModule,
NzNotificationModule,
NzMessageModule,
NzDescriptionsModule,
Expand All @@ -57,6 +59,6 @@ const COMPONENTS = [
],
declarations: [WebviewDirective, ...COMPONENTS, ApiParamsNumPipe, PageBlankComponent, EnvListComponent],
providers: [ModalService],
exports: [WebviewDirective, ...COMPONENTS, ApiParamsNumPipe, EoIconparkIconModule],
exports: [WebviewDirective, ...COMPONENTS, ApiParamsNumPipe, EoIconparkIconModule, EnvListComponent],
})
export class SharedModule {}

0 comments on commit 99850ea

Please sign in to comment.