AW-432 converted event to action
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good
This commit is contained in:
parent
c5d7550750
commit
4671ce08d3
@ -41,6 +41,8 @@ export const VIEWITEM = "[AppCommon] ViewItem";
|
||||
|
||||
export const FAIL = '[AppCommon] Fail';
|
||||
|
||||
export const UPLOADEDFILECLICK = '[AppCommon] UploadedFileClick';
|
||||
|
||||
export class InitUser implements Action {
|
||||
readonly type = INITUSER;
|
||||
|
||||
@ -191,6 +193,12 @@ export class ShowNavBar implements Action {
|
||||
constructor() { }
|
||||
}
|
||||
|
||||
export class UploadedFileClick implements Action {
|
||||
readonly type = UPLOADEDFILECLICK;
|
||||
constructor(public itemCode:string) { }
|
||||
}
|
||||
|
||||
|
||||
export type Actions = OpenModal
|
||||
| InitRoot
|
||||
| InitRootSuccess
|
||||
|
@ -1,6 +1,9 @@
|
||||
import { Component, Input,Output, HostListener, ChangeDetectorRef, OnDestroy, OnInit,EventEmitter } from '@angular/core';
|
||||
import { ResumableFileUploadService, File } from './resumable-file-upload.service';
|
||||
import { Subscription } from 'rxjs';
|
||||
import { Store } from '@ngrx/store';
|
||||
import * as commonReducer from '../../reducers/app-common.reducer';
|
||||
import * as commonActions from '../../actions/app-common.actions';
|
||||
|
||||
|
||||
@Component({
|
||||
@ -18,9 +21,8 @@ export class ResumableFileUploadComponent implements OnInit, OnDestroy {
|
||||
else
|
||||
this.uploadService.parentCode = null;
|
||||
}
|
||||
@Output() onUploadedFileClick:EventEmitter<string> = new EventEmitter();
|
||||
|
||||
constructor(private cd: ChangeDetectorRef, public uploadService: ResumableFileUploadService) {
|
||||
constructor(private cd: ChangeDetectorRef, public uploadService: ResumableFileUploadService,public store: Store<commonReducer.State>) {
|
||||
}
|
||||
|
||||
private refreshSub: Subscription;
|
||||
@ -38,7 +40,7 @@ export class ResumableFileUploadComponent implements OnInit, OnDestroy {
|
||||
|
||||
handleUploadedFileClick(event:MouseEvent,file:File) {
|
||||
event.preventDefault();
|
||||
this.onUploadedFileClick.emit(file.identifier);
|
||||
this.store.dispatch(new commonActions.UploadedFileClick(file.identifier));
|
||||
}
|
||||
|
||||
//TODO do this with an canunload guard
|
||||
|
Loading…
Reference in New Issue
Block a user