-
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.
refactor(NotebookReportComponent): Convert to standalone (#1949)
- Loading branch information
1 parent
e0e6226
commit bdbad6f
Showing
8 changed files
with
198 additions
and
254 deletions.
There are no files selected for viewing
184 changes: 97 additions & 87 deletions
184
src/app/notebook/notebook-report/notebook-report.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,93 +1,103 @@ | ||
<mat-card | ||
*ngIf="mode !== 'classroomMonitor'" | ||
class="notebook-report" | ||
fxLayout="column" | ||
[ngClass]="{ collapsed: collapsed, full: full && !collapsed }" | ||
> | ||
<mat-card-header | ||
class="dark-theme mat-app-background" | ||
(click)="toggleCollapse()" | ||
fxLayoutAlign="start center" | ||
@if (mode !== 'classroomMonitor') { | ||
<mat-card | ||
class="notebook-report" | ||
fxLayout="column" | ||
[ngClass]="{ collapsed: collapsed, full: full && !collapsed }" | ||
> | ||
<mat-card-title | ||
class="mat-body-2 overflow--ellipsis" | ||
<mat-card-header | ||
class="dark-theme mat-app-background" | ||
(click)="toggleCollapse()" | ||
fxLayoutAlign="start center" | ||
fxLayoutGap="4px" | ||
> | ||
<mat-icon> assignment </mat-icon> | ||
<span> | ||
{{ reportItem.content.title }} | ||
</span> | ||
</mat-card-title> | ||
<span fxFlex></span> | ||
<button | ||
mat-icon-button | ||
i18n-title | ||
title="Toggle Full Screen" | ||
(click)="$event.stopPropagation(); fullscreen()" | ||
fxHide.lt-sm | ||
> | ||
<mat-icon *ngIf="!full || collapsed"> fullscreen </mat-icon> | ||
<mat-icon *ngIf="full && !collapsed"> fullscreen_exit </mat-icon> | ||
</button> | ||
<button | ||
*ngIf="!collapsed" | ||
mat-icon-button | ||
i18n-title | ||
title="Collapse" | ||
(click)="$event.stopPropagation(); toggleCollapse()" | ||
> | ||
<mat-icon> arrow_drop_down </mat-icon> | ||
</button> | ||
<button | ||
*ngIf="collapsed" | ||
mat-icon-button | ||
i18n-title | ||
title="Restore" | ||
(click)="$event.stopPropagation(); toggleCollapse()" | ||
> | ||
<mat-icon> arrow_drop_up </mat-icon> | ||
</button> | ||
</mat-card-header> | ||
<mat-card-content [class.hidden]="collapsed" fxFlex> | ||
<wise-tinymce-editor | ||
[(model)]="reportItemContent" | ||
(modelChange)="changed(reportItemContent)" | ||
[isAddNoteButtonAvailable]="isAddNoteButtonAvailable" | ||
(openNotebook)="addNotebookItemContent($event)" | ||
> | ||
</wise-tinymce-editor> | ||
</mat-card-content> | ||
<mat-card-actions [class.hidden]="collapsed"> | ||
<div class="actions" fxLayoutGap="8px" fxLayoutAlign="start center"> | ||
<button | ||
mat-flat-button | ||
color="primary" | ||
[disabled]="!dirty" | ||
(click)="saveNotebookReportItem()" | ||
i18n | ||
<mat-card-title | ||
class="mat-body-2 overflow--ellipsis" | ||
fxLayoutAlign="start center" | ||
fxLayoutGap="4px" | ||
> | ||
Save | ||
</button> | ||
<save-time-message *ngIf="saveTime" [saveTime]="saveTime"></save-time-message> | ||
<div id="{{ reportId }}-toolbar"></div> | ||
<mat-icon> assignment </mat-icon> | ||
<span> | ||
{{ reportItem.content.title }} | ||
</span> | ||
</mat-card-title> | ||
<span fxFlex></span> | ||
<mat-icon | ||
*ngIf="reportItem.content.prompt" | ||
class="info" | ||
tabindex="0" | ||
matTooltip="{{ reportItem.content.title }}: {{ reportItem.content.prompt }}" | ||
matTooltipPosition="above" | ||
>info</mat-icon | ||
<button | ||
mat-icon-button | ||
i18n-title | ||
title="Toggle Full Screen" | ||
(click)="$event.stopPropagation(); fullscreen()" | ||
fxHide.lt-sm | ||
> | ||
</div> | ||
</mat-card-actions> | ||
</mat-card> | ||
<div *ngIf="mode === 'classroomMonitor'"> | ||
<article *ngIf="hasReport"> | ||
<div [innerHTML]="reportItemContent"></div> | ||
</article> | ||
<p *ngIf="!hasReport" i18n> | ||
Team hasn't worked on {{ config.itemTypes.report.notes[0].title }} yet. | ||
</p> | ||
</div> | ||
@if (!full || collapsed) { | ||
<mat-icon> fullscreen </mat-icon> | ||
} | ||
@if (full && !collapsed) { | ||
<mat-icon> fullscreen_exit </mat-icon> | ||
} | ||
</button> | ||
@if (!collapsed) { | ||
<button | ||
mat-icon-button | ||
i18n-title | ||
title="Collapse" | ||
(click)="$event.stopPropagation(); toggleCollapse()" | ||
> | ||
<mat-icon> arrow_drop_down </mat-icon> | ||
</button> | ||
} @else { | ||
<button | ||
mat-icon-button | ||
i18n-title | ||
title="Restore" | ||
(click)="$event.stopPropagation(); toggleCollapse()" | ||
> | ||
<mat-icon> arrow_drop_up </mat-icon> | ||
</button> | ||
} | ||
</mat-card-header> | ||
<mat-card-content [class.hidden]="collapsed" fxFlex> | ||
<wise-tinymce-editor | ||
[(model)]="reportItemContent" | ||
(modelChange)="changed(reportItemContent)" | ||
[isAddNoteButtonAvailable]="isAddNoteButtonAvailable" | ||
(openNotebook)="addNotebookItemContent($event)" | ||
/> | ||
</mat-card-content> | ||
<mat-card-actions [class.hidden]="collapsed"> | ||
<div class="actions" fxLayoutGap="8px" fxLayoutAlign="start center"> | ||
<button | ||
mat-flat-button | ||
color="primary" | ||
[disabled]="!dirty" | ||
(click)="saveNotebookReportItem()" | ||
i18n | ||
> | ||
Save | ||
</button> | ||
@if (saveTime) { | ||
<save-time-message [saveTime]="saveTime" /> | ||
} | ||
<div id="{{ reportId }}-toolbar"></div> | ||
<span fxFlex></span> | ||
@if (reportItem.content.prompt) { | ||
<mat-icon | ||
class="info" | ||
tabindex="0" | ||
matTooltip="{{ reportItem.content.title }}: {{ reportItem.content.prompt }}" | ||
matTooltipPosition="above" | ||
>info</mat-icon | ||
> | ||
} | ||
</div> | ||
</mat-card-actions> | ||
</mat-card> | ||
} @else { | ||
<div> | ||
@if (hasReport) { | ||
<article> | ||
<div [innerHTML]="reportItemContent"></div> | ||
</article> | ||
} @else { | ||
<p i18n>Team hasn't worked on {{ config.itemTypes.report.notes[0].title }} yet.</p> | ||
} | ||
</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
Oops, something went wrong.