Commit 837730de authored by Adrien PARROT's avatar Adrien PARROT
Browse files

Add color for mapping

parent e69f0a65
function getConceptsAjax(oData, oTable_ref, oRowsNumber) {
// var URL_concepts = "http://127.0.0.1:5000/concepts";
var URL_concepts = "http://omop-mapper.fgh.ovh/concepts";
// var URL_concepts = "http://127.0.0.1:5000/api/concepts";
var URL_concepts = "http://omop-mapper.fgh.ovh/api/concepts";
console.log("concepts");
......@@ -21,8 +21,30 @@ function getConceptsAjax(oData, oTable_ref, oRowsNumber) {
}
console.log(data);
debugger;
for (var i = 0; i < data.docs.length; i++) {
var concept = data.docs[i];
if (concept.concept_id >= 2000000000 && concept.is_mapped == 'S') {
concept.status = 'Success';
} else if (concept.concept_id >= 2000000000 &&
(concept.is_mapped == 'NS' || concept.is_mapped == 'R')){
concept.status = 'Warning';
} else {
concept.status = 'None';
}
// Vert : Success
// Orange : Warning
// Rouge : Error
// Bleu : Information
}
var oModel = new sap.ui.model.json.JSONModel(data);
sap.ui.getCore().setModel(oModel, "conceptsModel");
console.log("connection");
},
error : function(error) {
......@@ -35,8 +57,8 @@ function getConceptsAjax(oData, oTable_ref, oRowsNumber) {
function getConceptAjax(sVal) {
// var URL_concept = "http://127.0.0.1:5000/concept/";
var URL_concept = "http://omop-mapper.fgh.ovh/concept/";
// var URL_concept = "http://127.0.0.1:5000/api/concept/";
var URL_concept = "http://omop-mapper.fgh.ovh/api/concept/";
if (sVal !== undefined) {
$.ajax({
......@@ -139,7 +161,6 @@ sap.ui.controller("conceptmapper.searchPage", {
var oModel = sap.ui.getCore().getModel('conceptsModel');
var aPageFound = oModel.getProperty("/page_found");
var aPageShown = oModel.getProperty("/page_shown");
debugger;
if (aPageFound === 0 || aPageFound === 1) {
sap.ui.getCore().byId('oButtonPrev').setEnabled(false);
sap.ui.getCore().byId('oButtonNext').setEnabled(false);
......@@ -409,8 +430,8 @@ sap.ui.controller("conceptmapper.searchPage", {
/******* CREATE *******/
openCreateDialog : function (oEvt) {
// var URL_concept = "http://127.0.0.1:5000/concept/";
var URL_concept = "http://omop-mapper.fgh.ovh/concept/";
// var URL_concept = "http://127.0.0.1:5000/api/concept/";
var URL_concept = "http://omop-mapper.fgh.ovh/api/concept/";
var oCreateDialog = new sap.m.Dialog({
title : "{i18n>create_concept}",
......@@ -558,8 +579,8 @@ sap.ui.controller("conceptmapper.searchPage", {
/******* UPDATE *******/
openUpdateDialog : function(oEvt) {
// var URL_concept = "http://127.0.0.1:5000/concept/";
var URL_concept = "http://omop-mapper.fgh.ovh/concept/";
// var URL_concept = "http://127.0.0.1:5000/api/concept/";
var URL_concept = "http://omop-mapper.fgh.ovh/api/concept/";
var button_press = oEvt.getParameters().id;
var oTable_ref = sap.ui.getCore().byId(button_press).getParent().getParent();
......@@ -713,8 +734,8 @@ sap.ui.controller("conceptmapper.searchPage", {
/******* DELETE *******/
openDeleteDialog : function (oEvt) {
// var URL_concept = "http://127.0.0.1:5000/concept/";
var URL_concept = "http://omop-mapper.fgh.ovh/concept/";
// var URL_concept = "http://127.0.0.1:5000/api/concept/";
var URL_concept = "http://omop-mapper.fgh.ovh/api/concept/";
var button_press = oEvt.getParameters().id;
......@@ -810,26 +831,15 @@ sap.ui.controller("conceptmapper.searchPage", {
* Can be used to modify the View before it is displayed, to bind event handlers and do other one-time initialization.
* @memberOf conceptmapper.searchPage
*/
// onInit: function() {
//
//
//
// },
/**
* Similar to onAfterRendering, but this hook is invoked before the controller's View is re-rendered
* (NOT before the first rendering! onInit() is used for that one!).
* @memberOf conceptmapper.searchPage
*/
onBeforeRendering: function() {
onInit: function() {
sap.ui.getCore().byId("__container1-Master").addStyleClass('searchPage');
var oModel = new sap.ui.model.json.JSONModel();
var mData = {
"selected" : ["Standard"],
"selected" : [],
"items" : [{
"key" : "Standard",
"text" : "Standard"
......@@ -848,7 +858,7 @@ sap.ui.controller("conceptmapper.searchPage", {
var oModel = new sap.ui.model.json.JSONModel();
var mData = {
"selected" : ["Valid"],
"selected" : [],
"items" : [{
"key" : "Deleted",
"text" : "Deleted"
......@@ -904,15 +914,15 @@ sap.ui.controller("conceptmapper.searchPage", {
var oModel = new sap.ui.model.json.JSONModel();
var mData = {
"selected" : [],
"selected" : ["FR"],
"items" : [{
"key" : "FR",
"text" : "FR"
},
// {
// "key" : "EN",
// "text" : "EN"
// }
// {
// "key" : "EN",
// "text" : "EN"
// }
]
};
oModel.setData(mData);
......@@ -960,7 +970,18 @@ sap.ui.controller("conceptmapper.searchPage", {
oModel.setData(mData);
sap.ui.getCore().setModel(oModel, "isValidModel");
},
/**
* Similar to onAfterRendering, but this hook is invoked before the controller's View is re-rendered
* (NOT before the first rendering! onInit() is used for that one!).
* @memberOf conceptmapper.searchPage
*/
// onBeforeRendering: function() {
//
// },
/**
* Called when the View has been rendered (so its HTML is part of the document). Post-rendering manipulations of the HTML could be done here.
......
......@@ -184,7 +184,10 @@ sap.ui.jsview("conceptmapper.searchPage", {
}) ]
}),
visibleRowCount: 15,
cellClick : [ oController.goToConceptDetail, oController ]
cellClick : [ oController.goToConceptDetail, oController ],
rowSettingsTemplate: new sap.ui.table.RowSettings({
highlight:"{conceptsModel>status}"
})
});
oTable.addColumn(new sap.ui.table.Column({
......@@ -295,10 +298,37 @@ sap.ui.jsview("conceptmapper.searchPage", {
}));
oTable.addColumn(new sap.ui.table.Column({
label : new sap.ui.commons.Label({
text : "Map"
}),
template : new sap.m.Text({
text : "{conceptsModel>is_mapped}"
}),
sortProperty : "lol",
editable : false,
width : '10%',
}));
oTable.bindRows({
// var mapping = new sap.ui.model.Sorter("{conceptsModel>/is_mapped}", false, true);
// debugger;
// oTable.bindRows( {
// path : "conceptsModel>/docs",
// });
oTable.bindRows( {
path : "conceptsModel>/docs",
highlight:'Error',
// sorter: main,
//
// groupHeaderFactory: function(oGroup) { // will be called by any sorter!
//
// }
});
var icoToolbar = new sap.m.IconTabBar({
......@@ -340,10 +370,10 @@ sap.ui.jsview("conceptmapper.searchPage", {
navButtonPress : function(oEvt) {
app.back();
},
headerContent : [ new sap.m.Button({
// text:"lol",
icon : "sap-icon://account"
}) ],
// headerContent : [ new sap.m.Button({
// // text:"lol",
// icon : "sap-icon://account"
// }) ],
content : [ icoToolbar, oTable ],
footer: new sap.m.Bar({
contentRight: new sap.m.Input({
......
function getUsers() {
var URL_users = "http://omop-mapper.fgh.ovh/users"
// var URL_users = "http://127.0.0.1:5000/users";
var URL_users = "http://omop-mapper.fgh.ovh/api/users"
// var URL_users = "http://127.0.0.1:5000/api/users";
$.ajax({
method:"GET",
......@@ -24,8 +24,8 @@ function getUsers() {
}
function getUser(username) {
var URL_user = "http://omop-mapper.fgh.ovh/user/"
// var URL_user = "http://127.0.0.1:5000/user/";
var URL_user = "http://omop-mapper.fgh.ovh/api/user/"
// var URL_user = "http://127.0.0.1:5000/api/user/";
$.ajax({
method:"GET",
......@@ -64,8 +64,8 @@ sap.ui.controller("conceptmapper.userPage", {
/******* CREATE *******/
openCreateDialog : function (oEvt) {
var URL_user = "http://omop-mapper.fgh.ovh/user/";
//var URL_user = "http://127.0.0.1:5000/user/";
var URL_user = "http://omop-mapper.fgh.ovh/api/user/";
//var URL_user = "http://127.0.0.1:5000/api/user/";
var oCreateDialog = new sap.m.Dialog({
......@@ -199,8 +199,8 @@ sap.ui.controller("conceptmapper.userPage", {
/******* UPDATE *******/
openUpdateDialog : function(oEvt) {
var URL_user = "http://omop-mapper.fgh.ovh/user/";
// var URL_user = "http://127.0.0.1:5000/user/";
var URL_user = "http://omop-mapper.fgh.ovh/api/user/";
// var URL_user = "http://127.0.0.1:5000/api/user/";
var button_press = oEvt.getParameters().id;
......@@ -344,8 +344,8 @@ sap.ui.controller("conceptmapper.userPage", {
/******* DELETE *******/
openDeleteDialog : function (oEvt) {
var URL_user = "http://omop-mapper.fgh.ovh/user/";
// var URL_user = "http://127.0.0.1:5000/user/";
var URL_user = "http://omop-mapper.fgh.ovh/api/user/";
// var URL_user = "http://127.0.0.1:5000/api/user/";
var button_press = oEvt.getParameters().id;
......
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