-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No files loaded when closing the dialog window #875
Labels
bug
Only issues that describe bugs.
pr-visualization
Issues that touch the visualization pr(oject) which means web and desktop features.
Comments
NearW
added
bug
Only issues that describe bugs.
pr-visualization
Issues that touch the visualization pr(oject) which means web and desktop features.
pr-visualization-desktop
Issues that touch the visualization pr(oject) but only apply to the desktop version.
labels
Mar 11, 2020
I saw that the other day as well and committed a fix on the other file validation branch ✌️ |
NearW
removed
the
pr-visualization-desktop
Issues that touch the visualization pr(oject) but only apply to the desktop version.
label
Mar 20, 2020
The above mentioned fix, doesn't fix the issue correctly. I undid the change again on the other branch some time ago. How to solve this bug:
The problem is:
|
JaiJoPa
added a commit
that referenced
this issue
Jun 25, 2020
JaiJoPa
added a commit
that referenced
this issue
Jul 2, 2020
@JaiJoPa collecting multiples before setting them all export class FileChooserController {
private files : NameDataPair[] = []
/* @ngInject */
constructor(
private $scope,
private dialogService: DialogService,
private codeChartaService: CodeChartaService,
private storeService: StoreService
) {}
public onImportNewFiles(element) {
this.$scope.$apply(() => {
this.storeService.dispatch(resetFiles())
let content
let readFiles = 0
for (const file of element.files) {
const isCompressed = file.name.endsWith(".gz")
const reader = new FileReader()
reader.onloadstart = () => {
this.storeService.dispatch(setIsLoadingFile(true))
}
reader.onload = event => {
if (isCompressed) {
const zlib = require("zlib")
content = zlib.unzipSync(Buffer.from((<any>event.target).result))
} else {
content = (<any>event.target).result
}
}
reader.onloadend = () => {
readFiles++
this.addNameDataPair(file.name, content)
console.log("adding ", file.name)
if(readFiles === element.files.length) {
this.setNewData()
console.log("setting files")
}
}
isCompressed ? reader.readAsArrayBuffer(file) : reader.readAsText(file, "UTF-8")
}
})
}
public setNewData() {
this.codeChartaService.loadFiles(this.files).catch((validationResult: CCValidationResult) => {
this.storeService.dispatch(setIsLoadingFile(false))
this.printErrors(validationResult)
})
this.files = []
}
private addNameDataPair(fileName: string, content: string) {
this.files.push({
fileName,
content: FileChooserController.getParsedContent(content)
})
}
} |
JaiJoPa
added a commit
that referenced
this issue
Jul 6, 2020
JaiJoPa
added a commit
that referenced
this issue
Jul 6, 2020
11 tasks
11 tasks
NearW
added a commit
that referenced
this issue
Jul 23, 2020
NearW
added a commit
that referenced
this issue
Jul 23, 2020
* Fix files are only valuated if a file was chosen #875 * Test onimportnewfiles #875 * Remove unused implementation in codeCharta test * Filereset only after first valid file #875 * Remove invalid validation behaviour #875 * Collect files in array instead calling multiple times loadingFile #875 * Adjust tests #875 * Update changelog #875 * Remove tests #875 * Add delay to prevent e2e tests failing #875 Co-authored-by: Ben Willenbring <ben-willenbring@t-online.de> Co-authored-by: Ruben Bridgewater <ruben@bridgewater.de>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Only issues that describe bugs.
pr-visualization
Issues that touch the visualization pr(oject) which means web and desktop features.
Bug
Expected Behavior
When I have a map loaded and open the dialog to load a new file and close it again, I expect that nothing changes at all. The application should return to it's state before I opened the dialog.
Actual Behavior
When I have a map loaded and open the dialog to load a new file and close it again, the file selection vanishes and I can't select another loaded file until I load a complete new file.
Screenshots
Additional Info
This somehow only happens with maps that were loaded through the dialog. It doesn't happen with the default loaded maps.
Steps to Reproduce the Problem
Specifications
The text was updated successfully, but these errors were encountered: