Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Devrim Gunyel
core
Commits
8af59861
Commit
8af59861
authored
Feb 21, 2019
by
Piotr Gawron
Browse files
updting preferences is blocking UI so two parallel changes cannot be executed
parent
c31bae29
Changes
4
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
8af59861
minerva
(
12.2.0
~
beta
.2
)
unstable
;
urgency
=
medium
*
Bug
fix
:
changes
in
selected
checkbox
in
add
project
dialog
block
UI
(#
726
)
*
Bug
fix
:
providing
invalid
overlay
id
in
url
could
break
minerva
(#
726
)
*
Bug
fix
:
Editing
project
with
images
and
submaps
could
cause
a
problem
(#
725
)
...
...
frontend-js/src/main/js/gui/admin/AddProjectDialog.js
View file @
8af59861
...
...
@@ -797,10 +797,14 @@ AddProjectDialog.prototype.bindProjectUploadPreferences = function (user, type,
var
value
=
user
.
getPreferences
().
getProjectUpload
()[
type
];
element
.
prop
(
'
checked
'
,
value
);
GuiConnector
.
showProcessing
();
element
.
change
(
function
()
{
var
data
=
new
UserPreferences
();
data
.
getProjectUpload
()[
type
]
=
element
.
is
(
"
:checked
"
);
return
ServerConnector
.
updateUserPreferences
({
user
:
user
,
preferences
:
data
}).
then
(
null
,
GuiConnector
.
alert
);
return
ServerConnector
.
updateUserPreferences
({
user
:
user
,
preferences
:
data
}).
finally
(
GuiConnector
.
hideProcessing
).
catch
(
GuiConnector
.
alert
);
});
};
...
...
frontend-js/src/main/js/gui/admin/ChooseAnnotatorsDialog.js
View file @
8af59861
...
...
@@ -77,7 +77,11 @@ function onChangeParameterValue(element, user) {
else
annotatorsParams
[
annotatorClassName
][
name
]
=
element
.
value
;
data
.
setAnnotatorsParameters
(
annotatorsParams
);
return
ServerConnector
.
updateUserPreferences
({
user
:
user
,
preferences
:
data
}).
then
(
null
,
GuiConnector
.
alert
);
GuiConnector
.
showProcessing
();
return
ServerConnector
.
updateUserPreferences
({
user
:
user
,
preferences
:
data
}).
finally
(
GuiConnector
.
hideProcessing
).
catch
(
GuiConnector
.
alert
);
}
/**
...
...
@@ -88,6 +92,7 @@ function onChangeParameterValue(element, user) {
*/
ChooseAnnotatorsDialog
.
prototype
.
saveAnnotatorsInfo
=
function
(
elementTypes
,
selectedAnnotators
)
{
selectedAnnotators
=
selectedAnnotators
.
slice
();
GuiConnector
.
showProcessing
();
return
ServerConnector
.
getLoggedUser
().
then
(
function
(
user
)
{
var
data
=
new
UserPreferences
();
...
...
@@ -105,7 +110,7 @@ ChooseAnnotatorsDialog.prototype.saveAnnotatorsInfo = function (elementTypes, se
user
:
user
,
preferences
:
data
});
}).
catch
(
GuiConnector
.
alert
);
}).
finally
(
GuiConnector
.
hideProcessing
).
catch
(
GuiConnector
.
alert
);
};
/**
...
...
frontend-js/src/main/js/gui/admin/ChooseValidatorsDialog.js
View file @
8af59861
...
...
@@ -160,6 +160,7 @@ ChooseValidatorsDialog.prototype.saveAnnotationsInfo = function (params) {
var
requiredAnnotators
=
params
.
requiredAnnotators
;
var
validAnnotators
=
params
.
validAnnotators
;
var
self
=
this
;
GuiConnector
.
showProcessing
();
return
self
.
getServerConnector
().
getLoggedUser
().
then
(
function
(
user
)
{
var
data
=
new
UserPreferences
();
...
...
@@ -179,7 +180,7 @@ ChooseValidatorsDialog.prototype.saveAnnotationsInfo = function (params) {
user
:
user
,
preferences
:
data
});
}).
catch
(
GuiConnector
.
alert
);
}).
finally
(
GuiConnector
.
hideProcessing
).
catch
(
GuiConnector
.
alert
);
};
...
...
@@ -241,10 +242,11 @@ ChooseValidatorsDialog.prototype.createValidAnnotationsDualListBox = function (u
var
elementAnnotators
=
{};
elementAnnotators
[
elementType
.
className
]
=
validAnnotations
;
data
.
setElementValidAnnotations
(
elementAnnotators
);
GuiConnector
.
showProcessing
();
return
self
.
getServerConnector
().
updateUserPreferences
({
user
:
user
,
preferences
:
data
}).
catch
(
GuiConnector
.
alert
);
}).
finally
(
GuiConnector
.
hideProcessing
).
catch
(
GuiConnector
.
alert
);
};
checkboxList
.
addListener
(
"
select
"
,
function
(
element
)
{
...
...
@@ -282,7 +284,11 @@ ChooseValidatorsDialog.prototype.createVerifyAnnotationsDualListBox = function (
"
annotation-list
"
:
requiredAnnotationsData
.
list
};
data
.
setElementRequiredAnnotations
(
elementRequiredAnnotations
);
return
self
.
getServerConnector
().
updateUserPreferences
({
user
:
user
,
preferences
:
data
}).
catch
(
GuiConnector
.
alert
);
GuiConnector
.
showProcessing
();
return
self
.
getServerConnector
().
updateUserPreferences
({
user
:
user
,
preferences
:
data
}).
finally
(
GuiConnector
.
hideProcessing
).
catch
(
GuiConnector
.
alert
);
}
});
checkbox
.
checked
=
requiredAnnotationsData
.
requiredAtLeastOnce
;
...
...
@@ -343,7 +349,11 @@ ChooseValidatorsDialog.prototype.createVerifyAnnotationsDualListBox = function (
"
annotation-list
"
:
requiredAnnotationsData
.
list
};
data
.
setElementRequiredAnnotations
(
elementRequiredAnnotations
);
return
self
.
getServerConnector
().
updateUserPreferences
({
user
:
user
,
preferences
:
data
}).
catch
(
GuiConnector
.
alert
);
GuiConnector
.
showProcessing
();
return
self
.
getServerConnector
().
updateUserPreferences
({
user
:
user
,
preferences
:
data
}).
finally
(
GuiConnector
.
hideProcessing
).
catch
(
GuiConnector
.
alert
);
};
checkboxList
.
addListener
(
"
select
"
,
function
(
element
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment