diff options
author | 2020-01-30 14:07:25 +0000 | |
---|---|---|
committer | 2020-01-30 14:07:25 +0000 | |
commit | 23f898a96f7e8b3ecb0817abc61612bdc3d2e9aa (patch) | |
tree | fc3118a1cfbfcd5d29f5923914e8e488f16be7b2 /cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/imports-tab/imports-tab.component.ts | |
parent | da25e1649c9a10f998c8dde068641d7601a3f00a (diff) | |
parent | f2e85fa8183c684322f1f8a34ea9ed4d1f33b169 (diff) |
Merge "package creation store preparation"
Diffstat (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/imports-tab/imports-tab.component.ts')
-rw-r--r-- | cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/imports-tab/imports-tab.component.ts | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/imports-tab/imports-tab.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/imports-tab/imports-tab.component.ts index 4db67b8dc..a8ba164f3 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/imports-tab/imports-tab.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/imports-tab/imports-tab.component.ts @@ -1,7 +1,7 @@ -import { Component, OnInit } from '@angular/core'; -import { NgxFileDropEntry, FileSystemFileEntry, FileSystemDirectoryEntry } from 'ngx-file-drop'; -import { PackageCreationStore } from '../package-creation.store'; -import { PackageCreationUtils } from '../package-creation.utils'; +import {Component, OnInit} from '@angular/core'; +import {FileSystemFileEntry, NgxFileDropEntry} from 'ngx-file-drop'; +import {PackageCreationStore} from '../package-creation.store'; +import {PackageCreationUtils} from '../package-creation.utils'; @Component({ @@ -19,8 +19,8 @@ export class ImportsTabComponent implements OnInit { constructor(private packageCreationStore: PackageCreationStore, private packageCreationUtils: PackageCreationUtils) { this.packageCreationStore.state$.subscribe(cbaPackage => { - if (cbaPackage.definitions && cbaPackage.definitions.files && cbaPackage.definitions.files.size > 0) { - this.definitionFiles = cbaPackage.definitions.files; + if (cbaPackage.definitions && cbaPackage.definitions.imports && cbaPackage.definitions.imports.size > 0) { + this.definitionFiles = cbaPackage.definitions.imports; } }); } @@ -65,7 +65,7 @@ export class ImportsTabComponent implements OnInit { removeFile(fileIndex: number) { console.log(this.uploadedFiles[fileIndex]); console.log(this.uploadedFiles); - this.packageCreationStore.removeFromState(this.uploadedFiles[fileIndex].name, 'definitions'); + this.packageCreationStore.removeFileFromDefinition(this.uploadedFiles[fileIndex].name); this.uploadedFiles.splice(fileIndex, 1); } @@ -76,6 +76,7 @@ export class ImportsTabComponent implements OnInit { public fileLeave(event) { console.log(event); } + /* readFileContent(file: File): string | ArrayBuffer { const fileReader = new FileReader(); // let content: string | ArrayBuffer = ''; |