Reload image on change

This commit is contained in:
Willem Dantuma 2021-03-02 08:09:42 +01:00
parent 2f1c5210ea
commit cabdeaa875
5 changed files with 20 additions and 15 deletions

16
package-lock.json generated
View File

@ -1865,23 +1865,25 @@
}
},
"@farmmaps/common": {
"version": "file:dist/common",
"version": "0.0.1-prerelease.548",
"resolved": "https://repository.akkerweb.nl/repository/npm-group/@farmmaps/common/-/common-0.0.1-prerelease.548.tgz",
"integrity": "sha512-gI+5kwpdimDkJUqU51PsyfZ0My5QRrEtwHGpCivd4kHxBZJ053cz6vHFnH1HquxesIXBVmDxjyeYGCrxhXVIOA==",
"requires": {
"tslib": "^2.0.0"
}
},
"@farmmaps/common-map": {
"version": "0.0.1-prerelease.542",
"resolved": "https://repository.akkerweb.nl/repository/npm-group/@farmmaps/common-map/-/common-map-0.0.1-prerelease.542.tgz",
"integrity": "sha512-UTz3FnIKEJ9PGgGTGy8UuWqY+ZBY6cW4oIL9VgHrUg9yXtfRt2zT9kaNDTeSUVOiLWcocGbJZX7zt5gjM/50PQ==",
"version": "0.0.1-prerelease.548",
"resolved": "https://repository.akkerweb.nl/repository/npm-group/@farmmaps/common-map/-/common-map-0.0.1-prerelease.548.tgz",
"integrity": "sha512-rrlYUZvq4r1ANlbinucdasy5iRidOt8DI9V7ra4pKcgZqlsD5hteeosX45DnDlbSvcNzTtY3A0E28e4WXd25jA==",
"requires": {
"tslib": "^2.0.0"
}
},
"@farmmaps/common-map3d": {
"version": "0.0.1-prerelease.542",
"resolved": "https://repository.akkerweb.nl/repository/npm-group/@farmmaps/common-map3d/-/common-map3d-0.0.1-prerelease.542.tgz",
"integrity": "sha512-igy1g7ritVE2+hgc6jIO4+OriCeV6k2MubQcoszWWG4F6RZYuMgKciIWSdlDZ8yvZsA8WMdtxlT5vJ3wgvmesA==",
"version": "0.0.1-prerelease.548",
"resolved": "https://repository.akkerweb.nl/repository/npm-group/@farmmaps/common-map3d/-/common-map3d-0.0.1-prerelease.548.tgz",
"integrity": "sha512-l3XQMSclt6x0fIjKw4K9j1IAr+L+0alHLd/9p80jfCkhB0qo1jZf/TorA636PSYB9NIBioiXOKMDVqTuPi+s/w==",
"requires": {
"tslib": "^2.0.0"
}

View File

@ -19,9 +19,9 @@
"@angular/platform-browser": "~10.2.4",
"@angular/platform-browser-dynamic": "~10.2.4",
"@angular/router": "~10.2.4",
"@farmmaps/common": "file:dist/common",
"@farmmaps/common-map": ">=0.0.1-prerelease.540 <0.0.1",
"@farmmaps/common-map3d": ">=0.0.1-prerelease.540 <0.0.1",
"@farmmaps/common": ">=0.0.1-prerelease.548 <0.0.1",
"@farmmaps/common-map": ">=0.0.1-prerelease.548 <0.0.1",
"@farmmaps/common-map3d": ">=0.0.1-prerelease.548 <0.0.1",
"@microsoft/signalr": "^3.1.3",
"@ng-bootstrap/ng-bootstrap": "^7.0",
"@ngrx/effects": "^10.0",

View File

@ -1,6 +1,6 @@
<div *ngIf="item;let item">
<div class="card border-0">
<fm-thumbnail [item]="item" [edit]="true"></fm-thumbnail>
<fm-thumbnail [item]="item" [edit]="item.isEditable"></fm-thumbnail>
</div>
<div class="card">
<div class="card-body">

View File

@ -56,7 +56,7 @@ export class EditImageModalComponent implements OnInit {
this.imageService.putImage(this.endpointUrl,this.imageService.b64toBlob(body,"image/jpeg")).subscribe(() => {
this.changed.emit({});
});
(this.modal as any).close('Save click');
this,this.modalService.dismissAll("Save");
}
}
}

View File

@ -1,4 +1,4 @@
import { Component,Input ,ViewChild,ElementRef} from '@angular/core';
import { Component,Input ,ViewChild,ElementRef,ChangeDetectorRef} from '@angular/core';
import { Store } from '@ngrx/store';
import { IListItem } from '../../models/list.item';
@ -19,7 +19,7 @@ import { AppConfig } from "../../shared/app.config";
@ViewChild('thumbnail') el:ElementRef;
@ViewChild('modal') modal:EditImageModalComponent;
constructor(public store: Store<commonReducers.State>, public itemTypeService: ItemTypeService,public appConfig: AppConfig,) {
constructor(public store: Store<commonReducers.State>, public itemTypeService: ItemTypeService,public appConfig: AppConfig,private changeDetector:ChangeDetectorRef) {
}
getThumbnailUrl(item:IListItem):string {
@ -53,6 +53,9 @@ import { AppConfig } from "../../shared/app.config";
}
onChanged() {
console.log("changed");
if(this.item) {
this.item.updated = new Date(new Date().getTime()).toISOString();
this.changeDetector.detectChanges();
}
}
}