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

rereading : master master = dev branch - comments rows

parent 62fce29f
function deleteConceptRelationshipAjax(concept_id_1, oData) {
// var URL_concept_relationship = "http://127.0.0.1:5000/concept_relationship/";
var URL_concept_relationship = "http://omop-mapper.fgh.ovh/api/concept_relationship/";
if (sap.ui.getCore().getModel('loginModel') !== undefined) {
var token = sap.ui.getCore().getModel('loginModel').oData.access_token;
}
debugger;
$.ajax({
type:"DELETE",
......@@ -19,12 +17,11 @@ function deleteConceptRelationshipAjax(concept_id_1, oData) {
"Content-Type": "application/json",
},
success: function(data, response, xhr) {
debugger;
var ret = "Delete relation beetween concept_id = " + concept_id_1 + " and concept_id = " + oData.concept_id_2;
sap.m.MessageToast.show(ret);
console.log("Connexion : deleteConceptRelationshipAjax()");
},
beforeSend: function(xhr, settings) { debugger; xhr.setRequestHeader('Authorization','Bearer ' + token); } ,
beforeSend: function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + token); } ,
error : function(error) {
sap.m.MessageToast.show("Connexion error");
console.log("Connexion error : deleteConceptRelationshipAjax()");
......@@ -34,7 +31,6 @@ function deleteConceptRelationshipAjax(concept_id_1, oData) {
}
function putConceptRelationshipAjax(concept_id_1, oData) {
// var URL_concept_relationship = "http://127.0.0.1:5000/concept_relationship/";
var URL_concept_relationship = "http://omop-mapper.fgh.ovh/api/concept_relationship/";
if (sap.ui.getCore().getModel('loginModel') !== undefined) {
......@@ -51,12 +47,11 @@ function putConceptRelationshipAjax(concept_id_1, oData) {
"Content-Type": "application/json",
},
success: function(data, response, xhr) {
debugger;
var ret = "Item concept_id = " + concept_id_1 + " mapped to concept_id = " + oData.concept_id_2;
sap.m.MessageToast.show(ret);
console.log("Connexion : putConceptRelationshipAjax()");
},
beforeSend: function(xhr, settings) { debugger; xhr.setRequestHeader('Authorization','Bearer ' + token); } ,
beforeSend: function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + token); } ,
error : function(error) {
sap.m.MessageToast.show("Connexion error");
console.log("Connexion error : putConceptRelationshipAjax()");
......@@ -90,7 +85,6 @@ sap.ui.controller("conceptmapper.conceptDetailPage", {
moreInfos : function(oEvt) {
debugger;
concept_id_2 = sap.ui.getCore().byId(oEvt.getParameters('text').id).getParent().getAggregation('cells')[3].getProperty('text')
var relations = sap.ui.getCore().getModel('conceptDetailModel').oData.relations
......@@ -106,7 +100,6 @@ sap.ui.controller("conceptmapper.conceptDetailPage", {
m_mapping_comment = "No Mapping Comment";
}
debugger;
var moreInfosDialog = new sap.m.Dialog({
title : "More infos",
......@@ -151,10 +144,7 @@ sap.ui.controller("conceptmapper.conceptDetailPage", {
// conceptsDetailModel
var concept = sap.ui.getCore().getModel('conceptDetailModel').oData;
var oData = {};
debugger;
// oData.concept_id_2 = oEvt.getParameters().srcControl.getAggregation('cells')[0].getProperty('text');
// oData.concept_id_2 = oEvt.getSource().getAggregation('cells')[0].getProperty('text');
oData.concept_id_2 = sap.ui.getCore().byId(oEvt.getParameters('text').id).getParent().getAggregation('cells')[3].getProperty('text');
oData.relationship_id = 'Maps to';
......@@ -169,10 +159,8 @@ sap.ui.controller("conceptmapper.conceptDetailPage", {
debugger;
if (action === 'delete') {
debugger;
var odeleteRelationDialog = new sap.m.Dialog({
......@@ -190,7 +178,6 @@ sap.ui.controller("conceptmapper.conceptDetailPage", {
press: function () {
debugger;
deleteConceptRelationshipAjax(concept.concept_id, oData);
odeleteRelationDialog.close();
......
......@@ -240,7 +240,7 @@ sap.ui.jsview("conceptmapper.conceptDetailPage", {
new sap.m.Button({
text: '{loginModel>/m_username}',
icon : "sap-icon://employee",
enabled:false, /// to change
enabled:false,
press: [ oController.userInfos, oController ],
}),
......
......@@ -73,10 +73,6 @@ sap.ui.controller("conceptmapper.mapperPage", {
oData.invalid_reason = ['Valid'];
oData.domain_id = oDomainMCB_list;
oData.vocabulary_id = oVocMCB_list;
// oData.m_language_id = oLangMCB_list;
// oData.frequency_id = [];
//debugger;
getConceptsMapperAjax(oData);
......@@ -90,7 +86,6 @@ sap.ui.controller("conceptmapper.mapperPage", {
addRelation : function(oEvt) {
var URL_concept_relationship = "http://omop-mapper.fgh.ovh/api/concept_relationship/";
// var URL_concept_relationship = "http://127.0.0.1:5000/concept_relationship/";
if (sap.ui.getCore().getModel('loginModel') !== undefined) {
var token = sap.ui.getCore().getModel('loginModel').oData.access_token;
......@@ -99,17 +94,14 @@ sap.ui.controller("conceptmapper.mapperPage", {
// conceptsDetailModel
var concepts = sap.ui.getCore().getModel('conceptsDetailModel').oData.to_map;
var oData = {};
debugger;
oData.m_mapping_rate = sap.ui.getCore().byId("oConceptMappingRate").getProperty('value');
oData.m_mapping_comment = sap.ui.getCore().byId("oConceptMappingComment").getProperty('value');
// oData.concept_id_2 = oEvt.getParameters().srcControl.getAggregation('cells')[0].getProperty('text');
oData.concept_id_2 = oEvt.getSource().getAggregation('cells')[0].getProperty('text');
oData.relationship_id = 'Maps to';
debugger;
......@@ -135,9 +127,7 @@ sap.ui.controller("conceptmapper.mapperPage", {
press: function () {
for (var id in concepts) {
debugger;
for (var id in concepts) {
putConceptRelationshipAjax(concepts[id].concept_id, oData)
......@@ -148,7 +138,6 @@ sap.ui.controller("conceptmapper.mapperPage", {
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'));
......@@ -183,7 +172,6 @@ sap.ui.controller("conceptmapper.mapperPage", {
for (var id in concepts) {
debugger;
putConceptRelationshipAjax(concepts[id].concept_id, oData)
}
......
......@@ -83,13 +83,9 @@ sap.ui.jsview("conceptmapper.mapperPage", {
////////////////// IconTabBar ////////////////////
var oIcTBMapper = new sap.m.IconTabBar("oIcTBMapper", {
//upperCase: true,
//backgroundDesign: "Transparent",
expanded: false,
items: [
new sap.m.IconTabFilter({
text: "{i18n>selected_concepts}",
showAll : true,
......@@ -99,20 +95,6 @@ sap.ui.jsview("conceptmapper.mapperPage", {
}),
new sap.m.IconTabSeparator(),
// new sap.m.IconTabFilter("itf4", {
// iconColor: sap.ui.core.IconColor.Negative,
// text: "Details",
// icon: "sap-icon://add-activity",
//// count: "3",
// visible: true,
// key: "selectConceptKey",
// content: [
// oConceptDetailPanelContent
// ]
// }),
new sap.m.IconTabFilter({
......@@ -120,9 +102,6 @@ sap.ui.jsview("conceptmapper.mapperPage", {
text: "{i18n>research}",
icon: "sap-icon://search",
key: "key3",
// count: "233",
content: [ oFlexBoxFilter,
new sap.m.SearchField({
......@@ -143,9 +122,6 @@ sap.ui.jsview("conceptmapper.mapperPage", {
icon: "sap-icon://developer-settings",
enabled:false,
// key: "key3",
// count: "233",
content: [
......@@ -183,61 +159,9 @@ sap.ui.jsview("conceptmapper.mapperPage", {
]
});
////////// Concepts details /////////////////
// var oConceptsdetailList = new sap.m.List("oConceptsDetailPanel", {
//// headerText : "relations list",
// });
// oConceptsdetailList.bindItems({
// path : "conceptsDetailModel>/to_map",
// template : new sap.m.ObjectListItem({
// title : "{conceptsDetailModel>concept_name}",
//// number : "{conceptDetailModel>standard_concept}",
//// numberUnit : "{conceptDetailModel>invalid_reason}",
//
//// type:"Active",
//
//// press: [oController.goToConceptDetailol, oController ],
//
// attributes : [
// new sap.m.ObjectAttribute({
// title : "concept_id",
// text : "{conceptsDetailModel>concept_id}",
// active : true,
// press: [ oController.goToConceptDetail, oController ],
//
//// }), new sap.m.ObjectAttribute({
//// title : "concept_code",
//// text : "{conceptsDetailModel>concept_code}",
////
//// }), new sap.m.ObjectAttribute({
//// title : "concept_class_id",
//// text : "{conceptDetailModel>concept_class_id}",
////// active : true,
// }), new sap.m.ObjectAttribute({
// title : "vocabulary_id",
// text : "{conceptsDetailModel>vocabulary_id}",
// }), new sap.m.ObjectAttribute({
// title : "domain_id",
// text : "{conceptsDetailModel>domain_id}",
// }),
//// new sap.m.ObjectAttribute({
//// title : "relationship_id",
//// text : "{conceptDetailModel>relationship_id}",
//// }),
//
//
//
// ]
// })
// });
////////// Concepts details /////////////////
var aColumns = [
......@@ -301,38 +225,8 @@ sap.ui.jsview("conceptmapper.mapperPage", {
var oConceptDetailPanelContent = new sap.m.Table({
fixedLayout:false,
// growing: true,
// growingThreshold: 10,
//growingScrollToLoad : true,
//footerText : "Static table footer text",
//headerToolbar : oTableHeader,
//infoToolbar : oTableInfo,
// swipeContent : oSwipe,
columns : aColumns,
// selectionChange : function(e) {
// sap.m.MessageToast.show("selection is changed");
// },
// "delete" : function(oEvent) {
// var oItem = oEvent.getParameter("listItem");
// sap.m.MessageBox.confirm("Are you sure to delete this record?", {
// onClose: function(sResult){
// if (sResult == sap.m.MessageBox.Action.CANCEL) {
// return;
// }
// oTable.removeItem(oItem);
// setTimeout(function() {
// oTable.focus();
// }, 0);
// }
// });
// },
//itemPress : [ oController.mapper, oController ],
// itemPress : function(e) {
// sap.m.MessageToast.show("item is pressed");
// debugger;
// },
// paste: applyPastedData
});
......@@ -395,8 +289,6 @@ sap.ui.jsview("conceptmapper.mapperPage", {
];
var oTemplate = new sap.m.ColumnListItem({
//vAlign: "Middle",
//type : sap.m.ListType.Active,
type: "Active",
press: [ oController.addRelation, oController ],
cells : [
......@@ -434,76 +326,14 @@ sap.ui.jsview("conceptmapper.mapperPage", {
]
});
// var oItemTemplateRelation = new sap.ui.core.Item({
// key : "{relationsModel>key}",
// text : "{relationsModel>text}",
// enabled : "{relationsModel>enabled}"
// });
// var oRelationMapperMCB = new sap.m.ComboBox({
// id : "oRelationMapperMCB",
// width : "10%",
// enabled: false,
//
// placeholder : "relationship",
// items : {
// path : "relationsModel>/items",
// template : oItemTemplateRelation
// },
// selectedKey : {
// path : "relationsModel>/selected",
// template : "{relationsModel>selected}"
// }
// });
// var oTableHeader = new sap.m.Toolbar({
// content : [
//// new sap.m.Title({
//// text : "Choose a relation concept and click on the concept to map"
//// }),
// //new sap.m.ToolbarSpacer(),
// new sap.m.Label({
// text:"Choose the relation"
// }),
//
// oRelationMapperMCB,
// ]
// });
var oTable = new sap.m.Table({
growing: true,
fixedLayout:false,
growingThreshold: 10,
//growingScrollToLoad : true,
//footerText : "Static table footer text",
// headerToolbar : oTableHeader,
//infoToolbar : oTableInfo,
// swipeContent : oSwipe,
columns : aColumns,
// selectionChange : function(e) {
// sap.m.MessageToast.show("selection is changed");
// },
// "delete" : function(oEvent) {
// var oItem = oEvent.getParameter("listItem");
// sap.m.MessageBox.confirm("Are you sure to delete this record?", {
// onClose: function(sResult){
// if (sResult == sap.m.MessageBox.Action.CANCEL) {
// return;
// }
// oTable.removeItem(oItem);
// setTimeout(function() {
// oTable.focus();
// }, 0);
// }
// });
// },
//itemPress : [ oController.mapper, oController ],
// itemPress : function(e) {
// sap.m.MessageToast.show("item is pressed");
// debugger;
// },
// paste: applyPastedData
});
......@@ -512,7 +342,6 @@ sap.ui.jsview("conceptmapper.mapperPage", {
oTable.bindItems({
path: "conceptsMapperModel>/docs",
template : oTemplate,
//key: "id"
});
......@@ -550,20 +379,11 @@ sap.ui.jsview("conceptmapper.mapperPage", {
var oConceptDetailPanel = new sap.m.Panel("oHeaderMapperPanel", {
expandable : true,
expanded : false,
// headerText : "Concept details",
headerToolbar: oConceptDetailHeader,
content : [ oConceptDetailPanelContent
]
});
// var oCommentPanel = new sap.m.Panel("oCommentPanel", {
// expandable : true,
// expanded : false,
// headerText : "Add comment",
// content : [ oConceptPanelComment
//
// ]
// });
var oTableHeader = new sap.m.Toolbar({
content : [
......@@ -605,7 +425,6 @@ sap.ui.jsview("conceptmapper.mapperPage", {
expandable : false,
expanded : true,
headerToolbar : oTableHeader,
// headerText : "Choose an item to map and click on it (that's done)",
content : [
new sap.m.RatingIndicator("oConceptMappingRate", {
......@@ -640,13 +459,6 @@ sap.ui.jsview("conceptmapper.mapperPage", {
app.back();
},
headerContent : [
// new sap.m.Button({
// icon : "sap-icon://home-share",
// text: "Git",
// press: function() {
// window.open('https://framagit.org/interchu/conceptual-mapping');
// }
// }),
new sap.m.Button({
text: '{loginModel>/m_username}',
......@@ -663,7 +475,6 @@ sap.ui.jsview("conceptmapper.mapperPage", {
showSubHeader : true,
subHeader : oSubHeader,
content : [ oIcTBMapper, oConceptDetailPanel, oContentPanel
//oCommentPanel,
]
});
......
......@@ -13,7 +13,6 @@ sap.ui.controller("conceptmapper.registrationPage", {
postUserAjax(oData, sUsername);
debugger;
app.back();
}
......
......@@ -21,7 +21,6 @@ sap.ui.jsview("conceptmapper.registrationPage", {
justifyContent: "Center",
direction: "Column",
fitContainer: true,
//width: "40%",
items: [
new sap.ui.core.Icon({
src:"sap-icon://add-employee",
......@@ -80,10 +79,7 @@ sap.ui.jsview("conceptmapper.registrationPage", {
navButtonPress : function(oEvt) {
app.back();
},
// headerContent : [ new sap.m.Button({
// // text:"lol",
// icon : "sap-icon://sys-help"
// }) ],
showSubHeader : true,
subHeader : oSubHeader,
content : [ oRegistrationForm
......
......@@ -43,7 +43,6 @@ sap.ui.jsview("conceptmapper.searchPage", {
});
var oStandardMCB = new sap.m.MultiComboBox({
id : "oStandardMCB",
// width : "400px",
placeholder : "{i18n>standard_label}",
items : {
path : "isStandardModel>/items",
......@@ -151,13 +150,10 @@ sap.ui.jsview("conceptmapper.searchPage", {
var oMasterPage = new sap.m.Page({
title : "{i18n>filters}",
showNavButton : true,
// navButtonPress : function(oEvt) {
// app.back();
// },
content : [ oMiniIB, oMaxiIB, oDomainMCB, oVocMCB, oStandardMCB, oValidMCB,
oLangMCB, oMapMCB ],
//mode:"SingleSelectMaster",
});
......@@ -174,152 +170,6 @@ sap.ui.jsview("conceptmapper.searchPage", {
// Detail Page
// var oTable = new sap.ui.table.Table({
// // id : "oTable",
// //visibleRowCount: 15,
// cellClick : [ oController.goToConceptDetail, oController ],
// rowSettingsTemplate: new sap.ui.table.RowSettings({
// highlight:"{conceptsModel>status}"
// })
// });
//
// oTable.addColumn(new sap.ui.table.Column({
// label : new sap.ui.commons.Label({
// text : "{i18n>concept_id}"
// }),
// template : new sap.m.Text({
// text : "{conceptsModel>concept_id}"
// }),
// editable : false,
// sortProperty : "concept_id",
// width : '7%',
//
// }));
//
// oTable.addColumn(new sap.ui.table.Column({
// label : new sap.ui.commons.Label({
// text : "{i18n>concept_name}"
// }),
// template : new sap.m.FormattedText({
// htmlText : "{conceptsModel>concept_name}"
// }),
// editable : false,
// sortProperty : "concept_id",
//
// }));
// oTable.addColumn(new sap.ui.table.Column({
// label : new sap.ui.commons.Label({
// text : "{i18n>concept_code}"
// }),
// template : new sap.m.Text({
// text : "{conceptsModel>concept_code}"
// }),
// sortProperty : "concept_code",
// editable : false,
//
// width : '8%',
//
//
// }));
//
// oTable.addColumn(new sap.ui.table.Column({
// label : new sap.ui.commons.Label({
// text : "{i18n>concept_class_id}"
// }),
// template : new sap.m.Text({
// text : "{conceptsModel>concept_class_id}"
// }),
// sortProperty : "concept_class_id",
// editable : false,
//
// width : '8%',
//
//
// }));
// oTable.addColumn(new sap.ui.table.Column({
// label : new sap.ui.commons.Label({
// text : "{i18n>vocabulary_id}"
// }),
// template : new sap.m.Text({
// text : "{conceptsModel>vocabulary_id}"
// }),
// sortProperty : "vocabulary_id",
// editable : false,
//
// width : '8%',
//
//
//
// }));
// oTable.addColumn(new sap.ui.table.Column({
// label : new sap.ui.commons.Label({
// text : "{i18n>standard_concept}"
// }),
// template : new sap.m.Text({
// text : "{conceptsModel>standard_concept}"
// }),
// sortProperty : "standard_concept",
// editable : false,
//
// width : '9%',
//
//
// }));
//
//
// oTable.addColumn(new sap.ui.table.Column({
// label : new sap.ui.commons.Label({