-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Authoring): Move component info retrieval inside dialog
- Loading branch information
1 parent
a7f6fd6
commit 23fa59c
Showing
5 changed files
with
30 additions
and
28 deletions.
There are no files selected for viewing
6 changes: 3 additions & 3 deletions
6
...wise5/authoringTool/components/component-info-dialog/component-info-dialog.component.html
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
23 changes: 22 additions & 1 deletion
23
...s/wise5/authoringTool/components/component-info-dialog/component-info-dialog.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 |
---|---|---|
@@ -1,11 +1,32 @@ | ||
import { Component, Inject } from '@angular/core'; | ||
import { MAT_DIALOG_DATA } from '@angular/material/dialog'; | ||
import { ComponentInfoService } from '../../../services/componentInfoService'; | ||
import { ComponentInfo } from '../../../components/ComponentInfo'; | ||
import { ComponentFactory } from '../../../common/ComponentFactory'; | ||
|
||
@Component({ | ||
selector: 'component-info-dialog', | ||
templateUrl: './component-info-dialog.component.html', | ||
styleUrls: ['./component-info-dialog.component.scss'] | ||
}) | ||
export class ComponentInfoDialogComponent { | ||
constructor(@Inject(MAT_DIALOG_DATA) protected data: any) {} | ||
protected component: any; | ||
private componentInfo: ComponentInfo; | ||
protected description: string; | ||
protected label: string; | ||
|
||
constructor( | ||
private componentInfoService: ComponentInfoService, | ||
@Inject(MAT_DIALOG_DATA) private componentType: string | ||
) {} | ||
|
||
ngOnInit(): void { | ||
this.componentInfo = this.componentInfoService.getInfo(this.componentType); | ||
this.label = this.componentInfo.getLabel(); | ||
this.description = this.componentInfo.getDescription(); | ||
this.component = new ComponentFactory().getComponent( | ||
this.componentInfo.getPreviewContent(), | ||
'node1' | ||
); | ||
} | ||
} |
8 changes: 2 additions & 6 deletions
8
...ssets/wise5/authoringTool/components/component-selector/component-selector.component.html
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 |
---|---|---|
@@ -1,8 +1,4 @@ | ||
<div class="component-div" fxLayoutAlign="space-between center"> | ||
<button mat-flat-button class="component-button" (click)="select()"> | ||
{{ label }} | ||
</button> | ||
<button mat-flat-button (click)="preview()"> | ||
<mat-icon>info</mat-icon> | ||
</button> | ||
<button mat-flat-button class="component-button" (click)="select()">{{ label }}</button> | ||
<button mat-flat-button (click)="preview()"><mat-icon>info</mat-icon></button> | ||
</div> |
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