Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
InterHop
Omop
susana-front
Commits
ae3a5cda
Commit
ae3a5cda
authored
Feb 08, 2019
by
Adrien PARROT
Browse files
Add mapping_comment and mapping_rate
parent
fb617ce6
Changes
6
Hide whitespace changes
Inline
Side-by-side
WebContent/conceptmapper/conceptDetailPage.controller.js
View file @
ae3a5cda
...
...
@@ -20,7 +20,7 @@ function deleteConceptRelationshipAjax(concept_id_1, oData) {
},
success
:
function
(
data
,
response
,
xhr
)
{
debugger
;
var
ret
=
"
Item(s) mapped to
"
+
oData
.
concept_id_2
;
var
ret
=
"
Delete relation beetween concept_id =
"
+
concept_id_1
+
"
and concept_id =
"
+
oData
.
concept_id_2
;
sap
.
m
.
MessageToast
.
show
(
ret
);
console
.
log
(
"
Delete relation : success
"
);
},
...
...
@@ -53,7 +53,7 @@ function putConceptRelationshipAjax(concept_id_1, oData) {
},
success
:
function
(
data
,
response
,
xhr
)
{
debugger
;
var
ret
=
"
Item
(s) mapped to
"
+
oData
.
concept_id_2
;
var
ret
=
"
Item
concept_id =
"
+
concept_id_1
+
"
mapped to concept_id =
"
+
oData
.
concept_id_2
;
sap
.
m
.
MessageToast
.
show
(
ret
);
console
.
log
(
"
addRelationAjax success
"
);
},
...
...
@@ -92,9 +92,64 @@ 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
for
(
var
i
in
relations
)
{
if
(
relations
[
i
].
concept_id
===
parseInt
(
concept_id_2
))
{
var
m_mappping_rate
=
relations
[
i
].
m_mapping_rate
;
var
m_mapping_comment
=
relations
[
i
].
m_mapping_comment
;
break
;
}
}
if
(
m_mapping_comment
===
""
)
{
m_mapping_comment
=
"
No Mapping Comment
"
;
}
debugger
;
var
moreInfosDialog
=
new
sap
.
m
.
Dialog
({
title
:
"
More infos
"
,
icon
:
"
sap-icon://doc-attachment
"
,
content
:
[
new
sap
.
m
.
RatingIndicator
({
value
:
relations
[
i
].
m_mapping_rate
,
enabled
:
false
,
}),
new
sap
.
m
.
TextArea
({
placeholder
:
"
no mapping comment!
"
,
width
:
"
100%
"
,
value
:
m_mapping_comment
,
enabled
:
false
,
})
]
});
moreInfosDialog
.
addButton
(
new
sap
.
m
.
Button
({
text
:
"
Reject
"
,
icon
:
"
sap-icon://decline
"
,
press
:
function
()
{
moreInfosDialog
.
close
();
}
})
);
moreInfosDialog
.
open
();
},
deleteRelation
:
function
(
oEvt
)
{
modifRelation
:
function
(
oEvt
)
{
// conceptsDetailModel
...
...
WebContent/conceptmapper/conceptDetailPage.view.js
View file @
ae3a5cda
...
...
@@ -90,7 +90,7 @@ sap.ui.jsview("conceptmapper.conceptDetailPage", {
var
oConceptPanelComment
=
new
sap
.
m
.
FeedInput
(
"
oConceptPanelComment
"
,
{
icon
:
"
sap-icon://post
"
icon
:
"
sap-icon://post
"
,
});
...
...
@@ -189,6 +189,11 @@ sap.ui.jsview("conceptmapper.conceptDetailPage", {
text
:
"
Valid
"
}),
}),
new
sap
.
m
.
Column
({
header
:
new
sap
.
m
.
Label
({
text
:
"
More infos
"
}),
}),
new
sap
.
m
.
Column
({
header
:
new
sap
.
m
.
Label
({
text
:
"
Delete
"
...
...
@@ -198,7 +203,6 @@ sap.ui.jsview("conceptmapper.conceptDetailPage", {
];
var
oTemplate
=
new
sap
.
m
.
ColumnListItem
({
//vAlign: "Middle",
//type : sap.m.ListType.Active,
...
...
@@ -234,15 +238,26 @@ sap.ui.jsview("conceptmapper.conceptDetailPage", {
wrapping
:
false
}),
new
sap
.
m
.
Button
({
icon
:
"
{conceptDetailModel>moreInfoIcon}
"
,
text
:
"
{conceptDetailModel>moreInfoText}
"
,
enabled
:
"
{conceptDetailModel>enabledMoreInfo}
"
,
// visible: "{conceptDetailModel>erasable}",
text
:
"
{conceptDetailModel>moreInfoText}
"
,
type
:
"
{conceptDetailModel>typeMoreInfoButton}
"
,
press
:
[
oController
.
moreInfos
,
oController
]
}),
new
sap
.
m
.
Button
({
icon
:
"
{conceptDetailModel>erasableIcon}
"
,
// ""sap-icon://delete",
// hoverColor: "red",
// activeColor: "red",
enabled
:
"
{conceptDetailModel>enabled}
"
,
enabled
:
"
{conceptDetailModel>enabled
Erasable
}
"
,
text
:
"
{conceptDetailModel>notErasableText}
"
,
// visible: "{conceptDetailModel>erasable}",
type
:
"
{conceptDetailModel>typeErasableButton}
"
,
press
:
[
oController
.
delete
Relation
,
oController
]
press
:
[
oController
.
modif
Relation
,
oController
]
}),
...
...
WebContent/conceptmapper/mapperPage.controller.js
View file @
ae3a5cda
...
...
@@ -164,6 +164,12 @@ sap.ui.controller("conceptmapper.mapperPage", {
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
'
;
...
...
@@ -203,6 +209,7 @@ sap.ui.controller("conceptmapper.mapperPage", {
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
);
}
,
...
...
@@ -210,6 +217,7 @@ sap.ui.controller("conceptmapper.mapperPage", {
alert
(
"
pb in the connection
"
);
console
.
log
(
"
addRelationAjax error
"
);
console
.
log
(
error
);
console
.
log
(
oData
)
return
;
}
});
...
...
@@ -220,6 +228,15 @@ 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
'
));
parseInt
(
sap
.
ui
.
getCore
().
byId
(
'
oIcTBMapper
'
).
setExpanded
(
false
));
app
.
to
(
'
idSearchPage
'
);
...
...
WebContent/conceptmapper/mapperPage.view.js
View file @
ae3a5cda
...
...
@@ -82,7 +82,7 @@ sap.ui.jsview("conceptmapper.mapperPage", {
var
oppp
=
new
sap
.
m
.
IconTabBar
(
"
itb5
"
,
{
var
oppp
=
new
sap
.
m
.
IconTabBar
(
"
oIcTBMapper
"
,
{
//upperCase: true,
//backgroundDesign: "Transparent",
expanded
:
false
,
...
...
@@ -187,14 +187,22 @@ sap.ui.jsview("conceptmapper.mapperPage", {
//count: "3",
key
:
"
mappingCommentKey
"
,
content
:
[
new
sap
.
m
.
RatingIndicator
({
// value: 3
}),
// new sap.m.RatingIndicator("oConceptMappingRate", {
//
//// value: 3
// }),
new
sap
.
m
.
FeedInput
(
// new sap.m.Button({
// icon: "sap-icon://post",
//
//
// }),
new
sap
.
m
.
TextArea
(
"
oConceptMappingComment
"
,
{
icon
:
"
sap-icon://post
"
})
placeholder
:
"
your mapping comment!
"
,
width
:
"
100%
"
,
}),
]
}),
...
...
@@ -525,7 +533,6 @@ sap.ui.jsview("conceptmapper.mapperPage", {
oTable
.
bindItems
({
path
:
"
conceptsMapperModel>/docs
"
,
template
:
oTemplate
,
...
...
@@ -574,10 +581,29 @@ sap.ui.jsview("conceptmapper.mapperPage", {
//
// ]
// });
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
:
"
Relation mapping rate :
"
}),
new
sap
.
m
.
RatingIndicator
(
"
oConceptMappingRate
"
,
{
// value: 3
}),
]
});
var
oContentPanel
=
new
sap
.
m
.
Panel
(
"
oContentMapperPanel
"
,
{
expandable
:
false
,
expanded
:
true
,
headerText
:
"
Choose an item to map and click on it (that's done)
"
,
headerToolbar
:
oTableHeader
,
// headerText : "Choose an item to map and click on it (that's done)",
content
:
[
oTable
]
});
...
...
WebContent/conceptmapper/searchPage.controller.js
View file @
ae3a5cda
...
...
@@ -215,6 +215,8 @@ function getConceptDetailAjax(sVal) {
success
:
function
(
data
,
response
,
xhr
)
{
for
(
var
i
=
0
;
i
<
data
.
relations
.
length
;
i
++
)
{
var
relation
=
data
.
relations
[
i
];
// DELETE actions
if
(
relation
.
m_user_id
&&
relation
.
invalid_reason
!==
'
Deleted
'
)
{
relation
.
erasableIcon
=
"
sap-icon://delete
"
;
relation
.
notErasableText
=
"
Delete relation
"
;
...
...
@@ -222,19 +224,31 @@ function getConceptDetailAjax(sVal) {
relation
.
action
=
"
delete
"
;
//relation.enabled = true;
}
else
if
(
relation
.
m_user_id
&&
relation
.
invalid_reason
===
'
Deleted
'
)
{
}
else
if
(
relation
.
m_user_id
)
{
relation
.
erasableIcon
=
"
sap-icon://undo
"
;
relation
.
notErasableText
=
"
Enable relation
"
;
relation
.
typeErasableButton
=
"
Accept
"
;
relation
.
action
=
"
undo
"
;
}
else
{
// relation.erasable = false;
relation
.
notErasableText
=
"
You can't delete it
"
;
relation
.
typeErasableButton
=
"
Transparent
"
;
relation
.
enabled
=
false
;
relation
.
enabled
Erasable
=
false
;
}
if
(
relation
.
m_user_id
&&
(
relation
.
m_mapping_comment
!==
""
||
relation
.
m_mapping_rate
!==
0
))
{
relation
.
moreInfoIcon
=
"
sap-icon://add
"
;
relation
.
typeMoreInfoButton
=
"
Accept
"
;
relation
.
moreInfoText
=
""
;
}
else
{
relation
.
moreInfoText
=
"
No more info
"
;
relation
.
typeMoreInfoButton
=
"
Transparent
"
;
relation
.
enabledMoreInfo
=
false
;
}
// More infos actions
}
debugger
;
...
...
WebContent/css/app.css
View file @
ae3a5cda
...
...
@@ -72,6 +72,4 @@
padding-left
:
171%
!important
;
padding-top
:
22%
;
padding-bottom
:
88%
;
}
}
\ No newline at end of file
Write
Preview
Supports
Markdown
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