Skip to content

feat: datafiles action type json #1790

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

Merged
merged 23 commits into from
May 27, 2025
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
ea01b26
added datafiles action type json
nitrosx Mar 18, 2025
84f703d
Merge branch 'master' of https://github.com/SciCatProject/frontend in…
nitrosx Mar 26, 2025
bb331e0
datafile json action with payload
nitrosx Mar 26, 2025
a56db7b
added downloadable json datafile action
nitrosx Mar 27, 2025
a0c16ea
added datafiles action type json
nitrosx Mar 18, 2025
83bd5d0
datafile json action with payload
nitrosx Mar 26, 2025
f1fa6ff
added downloadable json datafile action
nitrosx Mar 27, 2025
2df4183
Merge branch 'swap-4596-datafiles-action-json' of https://github.com/…
nitrosx Mar 28, 2025
5aa25e8
integrate requested changes
nitrosx Mar 31, 2025
be4ca11
Merge branch 'master' into swap-4596-datafiles-action-json
Junjiequan Mar 31, 2025
62bda9c
Added local documentation for datafiles actions
nitrosx Mar 31, 2025
6a3bbb1
Merge branch 'swap-4596-datafiles-action-json' of https://github.com/…
nitrosx Mar 31, 2025
64cbe9b
included suggestion to use snackBar
nitrosx Mar 31, 2025
215b31c
added snackbar to spec file
nitrosx Apr 1, 2025
1163826
Merge branch 'master' into swap-4596-datafiles-action-json
nitrosx Apr 1, 2025
7dc43ca
Merge branch 'master' into swap-4596-datafiles-action-json
nitrosx May 5, 2025
c6361d2
Merge branch 'master' into swap-4596-datafiles-action-json
nitrosx May 7, 2025
f196e09
Merge branch 'master' into swap-4596-datafiles-action-json
nitrosx May 23, 2025
082704f
removed console log
nitrosx May 26, 2025
d185ddb
Merge branch 'master' into swap-4596-datafiles-action-json
nitrosx May 26, 2025
db88c1a
Merge branch 'master' into swap-4596-datafiles-action-json
nitrosx May 26, 2025
5a848ab
try to fix flaky e2e test with finishLoading
martin-trajanovski May 27, 2025
ca58ada
Merge branch 'master' into swap-4596-datafiles-action-json
nitrosx May 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions src/app/datasets/datafiles-actions/datafiles-action.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,23 +208,29 @@ export class DatafilesActionComponent implements OnInit, OnChanges {
},
body: payload,
})
.then((response) => response.blob())
.then((response) => {
if (response.ok) {
return response.blob();
} else {
// http error
console.log(`HTTP Error code: ${response.status}`);
return Promise.reject(
new Error(`HTTP Error code: ${response.status}`),
);
}
})
.then((blob) => URL.createObjectURL(blob))
.then((url) => {
const a = document.createElement("a");
a.href = url;
a.download = filename;
a.click();
URL.revokeObjectURL(url);
// Object.assign(document.createElement("a"), {
// url,
// download: "filename.csv",
// }).click();
})
.catch((error) => {
console.log("Datafile action error : ", error);
alert("There has been an error performing the action");
});
// .then((url) => {
// window.open(url, "_blank");
// URL.revokeObjectURL(url);
// });

return true;
}
Expand Down
Loading