diff --git a/webapp/sources/rudder/rudder-web/src/main/elm/editor/sources/ViewMethod.elm b/webapp/sources/rudder/rudder-web/src/main/elm/editor/sources/ViewMethod.elm index 8cd797df4a0..7f6b65217c5 100644 --- a/webapp/sources/rudder/rudder-web/src/main/elm/editor/sources/ViewMethod.elm +++ b/webapp/sources/rudder/rudder-web/src/main/elm/editor/sources/ViewMethod.elm @@ -301,7 +301,7 @@ showMethodTab model method parentId call uiInfo= , name "class_context" , class "form-control" , rows 1 - , id "advanced" + , id "class_context" , value (conditionStr condition) , readonly True -- to deactivate plugin "Grammarly" or "Language Tool" from @@ -478,6 +478,7 @@ callBody model ui techniqueUi call pid = |> appendChild removeIcon condition = element "div" |> addClass "method-condition flex-form" + |> addClassConditional "hidden" (call.condition.os == Nothing && call.condition.advanced == "") |> appendChildList [ element "label" |> appendText "Condition:" @@ -491,22 +492,26 @@ callBody model ui techniqueUi call pid = Nothing -> "" methodName = case ui.mode of Opened -> element "div" + |> addClass "method-name" |> appendChild ( element "div" |> addClass "component-name-wrapper" |> appendChildList [ element "div" - |> addClass "title-input-name" - |> appendText "Name" - , element "div" |> addClass "gm-label-name" |> appendText method.name |> addActionStopPropagation ("mouseover" , HoverMethod Nothing) + , element "div" + |> addClass "form-group" + |> appendChildList + [ element "div" + |> addClass "title-input-name" + |> appendText "Name" + , element "input" + |> addAttributeList [ readonly (not model.hasWriteRights), stopPropagationOn "mousedown" (Json.Decode.succeed (DisableDragDrop, True)), onFocus DisableDragDrop, type_ "text", name "component", style "width" "100%", class "form-control", value call.component, placeholder "Enter a component name" ] + |> addInputHandler (\s -> MethodCallModified (Call pid {call | component = s })) + ] ] - |> appendChild - (element "input" - |> addAttributeList [ readonly (not model.hasWriteRights), stopPropagationOn "mousedown" (Json.Decode.succeed (DisableDragDrop, True)), onFocus DisableDragDrop, type_ "text", name "component", style "width" "100%", class "form-control", value call.component, placeholder "Enter a component name" ] - |> addInputHandler (\s -> MethodCallModified (Call pid {call | component = s }))) ) Closed -> element "div" |> addClass "method-name" @@ -557,7 +562,7 @@ callBody model ui techniqueUi call pid = |> Dom.appendChildList [ dragElem , element "div" - |> addClass ("method-info " ++ shoudHoveredMethod) + |> addClass ("method-info" ++ shoudHoveredMethod) |> addActionStopPropagation ("mouseleave" , HoverMethod Nothing) |> addClassConditional ("closed") (ui.mode == Closed) |> addAction ("click", UIMethodAction call.id {ui | mode = Opened}) @@ -578,10 +583,11 @@ callBody model ui techniqueUi call pid = ] , element "span" |> appendText " " ] + , element "div" |> addClass "flex-column" |> addAction ("click", UIMethodAction call.id {ui | mode = Opened}) - |> appendChildConditional condition (call.condition.os /= Nothing || call.condition.advanced /= "") + |> appendChild condition |> appendChild methodName --|> appendChild methodNameId |> appendChildConditional methodContent (ui.mode == Closed) diff --git a/webapp/sources/rudder/rudder-web/src/main/webapp/style/rudder/rudder-technique-editor.css b/webapp/sources/rudder/rudder-web/src/main/webapp/style/rudder/rudder-technique-editor.css index 81271de5e4d..65b28310148 100644 --- a/webapp/sources/rudder/rudder-web/src/main/webapp/style/rudder/rudder-technique-editor.css +++ b/webapp/sources/rudder/rudder-web/src/main/webapp/style/rudder/rudder-technique-editor.css @@ -898,7 +898,10 @@ button.btn.clipboard:hover { } .method-details .form-group{ - margin-bottom: 2px; + margin-bottom: 6px; +} +.method-details .form-group .form-group:last-child{ + margin-bottom: 0; } .method-details textarea + ul.list-unstyled{ min-height: 19px; @@ -1075,7 +1078,7 @@ ul li.hide-method { } .method .method-condition{ word-break: break-word; - padding-right: 50px; + padding-right: 300px; } .name-content { cursor: text; @@ -1111,8 +1114,9 @@ ul li.hide-method { background-color: #8fb92a; } -.method .method-condition ~ div:before, -.method .method-condition ~ label:before { +.method .method-info.closed .method-condition:not(.hidden) ~ div:before, +.method .method-info .method-condition:not(.hidden) ~ div:not(.method-name):before, +.method .method-condition:not(.hidden) ~ label:before { content: ""; position: absolute; top: 0; @@ -1121,7 +1125,7 @@ ul li.hide-method { width: 3px; background-color: #337ab7; } -.method .method-condition ~ div{ +.method .method-info.closed .method-condition ~ div{ padding-left: 10px; } .method .method-name { @@ -1151,6 +1155,7 @@ ul li.hide-method { display: inline-block; color: #777; cursor: pointer; + margin-right: 4px; } .label-value { cursor: text; @@ -1158,6 +1163,10 @@ ul li.hide-method { .method-condition > label{ display: inline-block; color: #337ab7; + margin: 0 4px 0 10px; +} +.method-info.closed .method-condition > label{ + margin-left: 0; } .method-param > .form-control, .method-condition > .form-control{ @@ -1527,15 +1536,13 @@ ul li.hide-method { margin-left:10px; } .title-input-name { - position: absolute; - margin-top: 14px; font-size: 14px; font-weight: bold; + margin-top: 14px; } .gm-label-name { font-size:11px; opacity:0.9; - margin-top : -2px; display: inline-block; padding-left: 10px; padding-right: 10px; @@ -1546,9 +1553,19 @@ ul li.hide-method { line-height: 25px; border-radius: 0 0 5px 5px; z-index:10; - float:right; - margin-bottom:10px; - margin-right:80px; + margin: 0; + position: absolute; + top: -16px; + right: 80px; +} +.method-info .method-condition:not(.hidden) + .method-name .gm-label-name{ + top: -24px; +} +.method-info:not(.closed) .method-condition:not(.hidden) + .method-name .gm-label-name{ + top: -36px; +} +.method-info.closed .method-condition.hidden + .method-name .gm-label-name{ + top: -2px; } .reporting-checkbox { margin-left: 5px;