Skip to content

Commit

Permalink
feat(#243) Add picture to fire safety department
Browse files Browse the repository at this point in the history
  • Loading branch information
philipperobertgh authored and iamkinetic committed Jan 28, 2019
1 parent 9886041 commit ecb3d06
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/app/management-system/department/department.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@
<dxo-lookup [dataSource]="languages" displayExpr="name" valueExpr="code">
</dxo-lookup>
</dxi-column>
<dxi-column
dataField="picture"
caption="{{'picture' | translate}}"
editCellTemplate="editphoto"
[visible]="false">
</dxi-column>

<dxo-filter-row [visible]="true"></dxo-filter-row>
<dxo-load-panel [enabled]="true"></dxo-load-panel>
Expand All @@ -39,6 +45,9 @@
<dxi-item dataField="localizations" [isRequired]="true"></dxi-item>
<dxi-item dataField="idCounty" [isRequired]="true"></dxi-item>
<dxi-item dataField="language" [isRequired]="true"></dxi-item>
<dxi-item itemType="group">
<dxi-item dataField="picture" [label]="{visible: false}"></dxi-item>
</dxi-item>
</dxo-form>
</dxo-editing>

Expand All @@ -50,4 +59,8 @@
(valueChanged)="field.setValue($event.value);">
</app-multilang>
</div>
<div *dxTemplate="let field of 'editphoto'">
<span class="dx-field-item-label-text">{{'picture' | translate}}:</span>
<app-image [idImage]="field.row.data.idPicture" height="350px" [allowChange]="true" (valueChanged)="field.setValue($event)"></app-image>
</div>
</dx-data-grid>
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { WithLocalization } from '../../../shared/models/with-localization';
import {Picture} from '../../../shared/models/picture.model';


export class FireSafetyDepartment extends WithLocalization {
idCounty: string;
language: string;
idPicture: string = null;
picture: Picture;

static fromJSON(data: object): FireSafetyDepartment {
const department = new FireSafetyDepartment();
Expand Down

0 comments on commit ecb3d06

Please sign in to comment.