Commit 70dd55fc authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch...

Merge branch '911-remove-additional-options-in-copy-from-selecting-annotators-min13-1' into 'master'

Resolve "Remove additional options in Copy from selecting annotators // MIN13.1"

Closes #911

See merge request !905
parents f2846ad5 813a9b9a
Pipeline #13136 failed with stage
in 9 minutes and 38 seconds
......@@ -32,6 +32,8 @@ minerva (14.0.0~beta.0) unstable; urgency=low
* Bug fix: width of info window adjust to the content size (#903)
* Bug fix: when uploading generic data overlay the type was not updated in
case the type was not specified in the input file (#906)
* Bug fix: list of types when copying from annotators contains only types
that are selectable in the dialog (#911)
-- Piotr Gawron <piotr.gawron@uni.lu> Mon, 21 Aug 2019 21:00:00 +0200
......
......@@ -188,7 +188,6 @@ ServerConnector.isSessionValid = function () {
//this is workaround for the problem with Firefox Private Window issue
//in FF new tab is opened with existing cookies but localStorage is cleared
if (sessionLogin === undefined || sessionLogin === null) {
console.log("SET USER");
self.getSessionData(null).setLogin(serverSideLogin);
}
return serverSideLogin === self.getSessionData(null).getLogin();
......
......@@ -163,16 +163,13 @@ ChooseAnnotatorsDialog.prototype.setElementType = function (elementType) {
var copyFromSelect = Functions.createElement({type: "select", style: "margin:5px"});
element.appendChild(copyFromSelect);
var options = [], i;
for (i = 0; i < configuration.getElementTypes().length; i++) {
var type = configuration.getElementTypes()[i];
var name = type.className;
if (name.indexOf(".") > 0) {
name = name.substr(name.lastIndexOf(".") + 1);
}
var nodeList = self.getTypeNodeList();
for (i = 0; i < nodeList.length; i++) {
var type = nodeList[i];
options.push(Functions.createElement({
type: "option",
value: type.className,
content: name
value: type.data.className,
content: type.text
}));
}
options.sort(function (a, b) {
......@@ -567,8 +564,8 @@ ChooseAnnotatorsDialog.prototype.getParameterName = function (parameter) {
ChooseAnnotatorsDialog.prototype.copyAnnotatorsToChildren = function (from, to, user) {
if (user.getPreferences()._elementAnnotators[from.className] === undefined) {
logger.warn("Cannot copy annotator from " + from.className + " to " + to.className + ". Annotators don't exist");
user.getPreferences()._elementAnnotators[from.className] = user.getPreferences()._elementAnnotators[to.className];
user.getPreferences()._elementAnnotators[from.className] = user.getPreferences().getElementAnnotators(to.className);
}
user.getPreferences()._elementAnnotators[to.className] = user.getPreferences()._elementAnnotators[from.className];
user.getPreferences()._elementAnnotators[to.className] = user.getPreferences().getElementAnnotators(from.className);
};
module.exports = ChooseAnnotatorsDialog;
......@@ -21,6 +21,9 @@ function UserPreferences(javaObject) {
this.setGuiPreferences(javaObject["gui-preferences"]);
} else {
this._projectUpload = {};
/**
* @private
*/
this._elementAnnotators = {};
this._elementRequiredAnnotations = {};
this._elementValidAnnotations = {};
......@@ -42,7 +45,7 @@ UserPreferences.prototype.update = function (userPreferences) {
};
updateDict(this._projectUpload, userPreferences.getProjectUpload());
updateDict(this._elementAnnotators, userPreferences.getElementAnnotators);
updateDict(this._elementAnnotators, userPreferences._elementAnnotators);
updateDict(this._elementValidAnnotations, userPreferences._elementValidAnnotations);
updateDict(this._elementRequiredAnnotations, userPreferences._elementRequiredAnnotations);
updateDict(this._guiPreferences, userPreferences.getGuiPreferences());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment