Commit e29615dc authored by Adrien PARROT's avatar Adrien PARROT
Browse files

Add expert mode and UX design on rate/comment

parent b7061824
......@@ -177,6 +177,12 @@ sap.ui.controller("conceptmapper.mapperPage", {
if (!sap.ui.getCore().getModel('conceptsDetailModel').oData.expert_mode) {
var oMapperDialog = new sap.m.Dialog({
title : "Mapper",
icon : "sap-icon://doc-attachment"
......@@ -258,7 +264,56 @@ sap.ui.controller("conceptmapper.mapperPage", {
oMapperDialog.open();
} else {
for (var id in concepts) {
debugger;
$.ajax({
type:"PUT",
url: URL_concept_relationship + concepts[id].concept_id,
dataType:"json",
async: false,
data: oData,
header: {
"Content-Type": "application/json",
},
success: function(data, response, xhr) {
debugger;
var ret = "Item(s) mapped to " + oData.concept_id_2;
sap.m.MessageToast.show(ret);
console.log("addRelationAjax success");
},
beforeSend: function(xhr, settings) { debugger; xhr.setRequestHeader('Authorization','Bearer ' + token); } ,
error : function(error) {
alert("pb in the connection");
console.log("addRelationAjax error");
console.log(error);
console.log(oData)
return;
}
});
}
sap.ui.controller("conceptmapper.searchPage").searcher();
//reset comment and rate
parseInt(sap.ui.getCore().byId('oConceptMappingRate').resetProperty('value'));
parseInt(sap.ui.getCore().byId('oConceptMappingComment').resetProperty('value'));
parseInt(sap.ui.getCore().byId('oIcTBMapper').setExpanded(false));
app.to('idSearchPage');
}
},
......
......@@ -137,74 +137,75 @@ sap.ui.jsview("conceptmapper.mapperPage", {
// new sap.m.IconTabFilter({
// iconColor: sap.ui.core.IconColor.Critical,
// text: "Algorithms",
// icon: "sap-icon://developer-settings",
//
//
// key: "key3",
//// count: "233",
// content: [
//
//
// new sap.m.ToggleButton({
// id: "algo1Toggle",
// pressed: true,
// text: "Algo 1",
// icon : "sap-icon://radar-chart",
// press : [ oController.algo_one, oController ],
//
// }),
//
// new sap.m.ToggleButton({
// id: "algo2Toggle",
// pressed: false,
// text: "Algo 2",
// icon : "sap-icon://radar-chart",
// press : [ oController.algo_two, oController ],
//
// }),
//
// new sap.m.ToggleButton({
// id: "algo3Toggle",
// pressed: false,
// text: "Algo 3",
// icon : "sap-icon://radar-chart",
// press : [ oController.algo_three, oController ],
//
// }),
//
//
// ]
// }),
//
new sap.m.IconTabFilter({
iconColor: sap.ui.core.IconColor.Positive,
text: "Comments",
icon: "sap-icon://comment",
//count: "3",
key: "mappingCommentKey",
iconColor: sap.ui.core.IconColor.Critical,
text: "Algorithms",
icon: "sap-icon://developer-settings",
enabled:false,
// key: "key3",
// count: "233",
content: [
// new sap.m.RatingIndicator("oConceptMappingRate", {
//
//// value: 3
// }),
// new sap.m.Button({
// icon: "sap-icon://post",
//
//
// }),
new sap.m.TextArea(
"oConceptMappingComment", {
placeholder: "your mapping comment!",
width: "100%",
}),
new sap.m.ToggleButton({
id: "algo1Toggle",
pressed: true,
text: "Algo 1",
icon : "sap-icon://radar-chart",
press : [ oController.algo_one, oController ],
}),
new sap.m.ToggleButton({
id: "algo2Toggle",
pressed: false,
text: "Algo 2",
icon : "sap-icon://radar-chart",
press : [ oController.algo_two, oController ],
}),
new sap.m.ToggleButton({
id: "algo3Toggle",
pressed: false,
text: "Algo 3",
icon : "sap-icon://radar-chart",
press : [ oController.algo_three, oController ],
}),
]
}),
// new sap.m.IconTabFilter({
// iconColor: sap.ui.core.IconColor.Positive,
// text: "Comments",
// icon: "sap-icon://comment",
// //count: "3",
// key: "mappingCommentKey",
// content: [
//// new sap.m.RatingIndicator("oConceptMappingRate", {
////
////// value: 3
//// }),
//
//// new sap.m.Button({
//// icon: "sap-icon://post",
////
////
//// }),
// new sap.m.TextArea(
// "oConceptMappingComment", {
// placeholder: "your mapping comment!",
// width: "100%",
//
// }),
// ]
// }),
]
......@@ -540,7 +541,7 @@ sap.ui.jsview("conceptmapper.mapperPage", {
oTable.bindItems({
path: "conceptsMapperModel>/docs",
template : oTemplate,
key: "id"
//key: "id"
});
......@@ -565,6 +566,14 @@ sap.ui.jsview("conceptmapper.mapperPage", {
var oConceptDetailHeader = new sap.m.Toolbar({
content : [
new sap.m.Title({
text : "Concept details"
}),
]
});
......@@ -572,7 +581,8 @@ sap.ui.jsview("conceptmapper.mapperPage", {
var oHeaderPanel = new sap.m.Panel("oHeaderMapperPanel", {
expandable : true,
expanded : false,
headerText : "Concept details",
// headerText : "Concept details",
headerToolbar: oConceptDetailHeader,
content : [ oConceptsdetailList
]
......@@ -592,23 +602,60 @@ sap.ui.jsview("conceptmapper.mapperPage", {
text : "Choose a relation concept and click on the concept to map"
}),
new sap.m.ToolbarSpacer(),
new sap.m.Label({
text:"Relation mapping rate : "
new sap.m.ToggleButton({
id:"expertMode",
text:"Expert mode",
press : function(e) {
if (e.getSource().getPressed()) {
sap.ui.getCore().getModel('conceptsDetailModel').oData.expert_mode = true;
} else {
sap.ui.getCore().getModel('conceptsDetailModel').oData.expert_mode = false;
}
},
}),
new sap.m.RatingIndicator("oConceptMappingRate", {
// value: 3
new sap.m.ToggleButton({
text:"Add rate/comment",
pressed: true,
press: function(e) {
if (e.getSource().getPressed()) {
sap.ui.getCore().byId("oConceptMappingRate").setVisible(true);
sap.ui.getCore().byId("oConceptMappingComment").setVisible(true);
} else {
sap.ui.getCore().byId("oConceptMappingRate").setVisible(false);
sap.ui.getCore().byId("oConceptMappingComment").setVisible(false);
}
},
}),
// new sap.m.Label({
// text:"Relation mapping rate : "
// }),
// new sap.m.RatingIndicator("oConceptMappingRate", {
//
//// value: 3
// }),
]
});
]
});
var oContentPanel = new sap.m.Panel("oContentMapperPanel", {
expandable : false,
expanded : true,
headerToolbar : oTableHeader,
// headerText : "Choose an item to map and click on it (that's done)",
content : [ oTable ]
content : [
new sap.m.RatingIndicator("oConceptMappingRate", {
}),
new sap.m.TextArea("oConceptMappingComment",
{
placeholder: "your mapping comment!",
width: "100%",
}),
oTable
]
});
......
......@@ -123,6 +123,16 @@ function getConceptsAjax(oData, oTable_ref) {
var oModel = new sap.ui.model.json.JSONModel(data);
sap.ui.getCore().setModel(oModel, "conceptsModel");
//reset checkbox to not selected
var oTable_ref = sap.ui.getCore().byId('oTable');
for (var i in oTable_ref.getAggregation('items')) {
oTable_ref.getAggregation('items')[i].getAggregation('cells')[0].resetProperty('selected')
}
console.log("connection");
},
......@@ -135,6 +145,8 @@ function getConceptsAjax(oData, oTable_ref) {
}
function getConceptsMapperAjax(oData) {
// var URL_concepts = "http://127.0.0.1:5000/api/concepts";
var URL_concepts = "http://omop-mapper.fgh.ovh/api/concepts";
......@@ -468,7 +480,6 @@ sap.ui.controller("conceptmapper.searchPage", {
if (oTable_ref.getAggregation('items')[i].getAggregation('cells')[0].getProperty('selected')) {
idx.push(i);
}
}
// idx = oTable_ref.getSelectedIndices();
......@@ -527,7 +538,7 @@ sap.ui.controller("conceptmapper.searchPage", {
})
}
var oData = {"to_map": listToMap, "to_map_number": idx.length};
var oData = {"to_map": listToMap, "to_map_number": idx.length, expert_mode: sap.ui.getCore().byId("expertMode").getPressed()};
var oModel = new sap.ui.model.json.JSONModel(oData);
......@@ -625,9 +636,9 @@ sap.ui.controller("conceptmapper.searchPage", {
placeholder: "Password",
type:"Password",
}),
new sap.m.Link({
text : "Lost your password"
}).addStyleClass('forgotPassword'),
// new sap.m.Link({
// text : "Lost your password"
// }).addStyleClass('forgotPassword'),
]
})
......
Supports Markdown
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