Skip to content
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

Show the loading UX immediately when importing a resource model #10540 #11681

Open
wants to merge 2 commits into
base: dev/8.0.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 12 additions & 11 deletions arches/app/media/js/views/graph.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require([
define([
'jquery',
'underscore',
'knockout',
Expand All @@ -11,7 +11,7 @@ require([
'bindings/hover',
'bindings/chosen',
'utils/set-csrf-token',
], function($, _, ko, arches, graphManagerData, BaseManager, AlertViewModel, JsonErrorAlertViewModel) {
], function($, _, ko, arches, graphManagerData, BaseManager, AlertViewModel, JsonErrorAlertViewModel) {
var GraphView = BaseManager.extend({
/**
* Initializes an instance of BaseManager, optionally using a passed in view
Expand Down Expand Up @@ -74,9 +74,9 @@ require([
};
graph.deleteGraph = function() {
self.viewModel.alert(new AlertViewModel(
'ep-alert-red',
arches.translations.confirmGraphDelete.title,
arches.translations.confirmGraphDelete.text,
'ep-alert-red',
arches.translations.confirmGraphDelete.title,
arches.translations.confirmGraphDelete.text,
function() {
return;
}, function(){
Expand All @@ -98,9 +98,9 @@ require([
};
graph.deleteInstances = function() {
self.viewModel.alert(new AlertViewModel(
'ep-alert-red',
arches.translations.confirmAllResourceDelete.title,
arches.translations.confirmAllResourceDelete.text,
'ep-alert-red',
arches.translations.confirmAllResourceDelete.title,
arches.translations.confirmAllResourceDelete.text,
function() {
return;
}, function(){
Expand Down Expand Up @@ -143,14 +143,14 @@ require([
resources = self.viewModel.graphs();
}

return resources.reduce((acc, resource) => {
return resources.reduce((acc, resource) => {
if (!resource.source_identifier_id) {
const editableFutureGraph = resources.find(graph => graph.source_identifier_id === resource.graphid);

if (editableFutureGraph) {
resource['has_unpublished_changes'] = editableFutureGraph['has_unpublished_changes'];
}

acc.push(resource);
}
return acc;
Expand All @@ -166,6 +166,7 @@ require([
var formData = new FormData();
formData.append("importedGraph", e.target.files[0]);

self.viewModel.loading(true);
$.ajax({
type: "POST",
url: 'import/',
Expand Down
1 change: 1 addition & 0 deletions releases/8.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Arches 8.0.0 Release Notes
- Make number datatype node values searchable in the main search [#11619](https://github.com/archesproject/arches/issues/11619)
- Prevent navigation to a new browser tab when clicking Manage link in index.htm [#11635](https://github.com/archesproject/arches/issues/11635)
- Add support for tile sort order to the bulk data manager [#11638](https://github.com/archesproject/arches/pull/11638)
- Show the loading UX immediately when the user imports a resource model [#10540](https://github.com/archesproject/arches/issues/10540)

### Dependency changes
```
Expand Down
Loading