Skip to content

Commit

Permalink
Merge branch
Browse files Browse the repository at this point in the history
'ust_16937/keep_the_original_name_of_a_generic_method_displayed_pr' into
branches/rudder/6.0
  • Loading branch information
RaphaelGauthier committed Apr 23, 2020
2 parents 91bb5d0 + 86647ca commit 296a974
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 61 deletions.
3 changes: 3 additions & 0 deletions builder/css/custom.css
Expand Up @@ -73,6 +73,9 @@ ul.dropdown-menu > li > a{
.popover{
max-width: 450px;
}
.popover.condition {
left: -250px !important;
}
.popover-content b{
color: #f08004;
}
Expand Down
132 changes: 78 additions & 54 deletions builder/index.html
Expand Up @@ -29,27 +29,6 @@
<script src="js/class_utils.js?version=dev"></script>
<script src="js/ui-bootstrap-tpls-0.14.3.min.js?version=dev"></script>
<script src="js/showdown-1.9.0.min.js?version=dev"></script>
<script type="text/ng-template" id="deprecatedMethod.html">
<div>
<!-- This template is used inside a tooltip, which appears : -->

<!-- 1. In the general generic methods list -->
<div ng-if="method_call === undefined && method" ng-bind-html="getTooltipContent(method)"></div>

<!-- 2. In the generic methods list of a technique -->
<div ng-if="method_call" ng-bind-html="getTooltipContent(method_call)"></div>

<!-- 3. In the details of a selected generic method -->
<div ng-if="method_call === undefined && selectedMethod" ng-bind-html="getTooltipContent(selectedMethod)"></div>

</div>
</script>
<script type="text/ng-template" id="deprecatedCategory.html">
<div>All generic methods in this category are <b>deprecated</b>.</div>
</script>
<script type="text/ng-template" id="TechniqueWithDeprecatedMethod.html">
<div>This technique uses <b>deprecated</b> generic methods.</div>
</script>
<script id="template/uib-accordion/uib-accordion-group.html" type="text/ng-template">
<div class="panel panel-default">
<div class="panel-heading" ng-click="isOpen = !isOpen">
Expand Down Expand Up @@ -192,6 +171,13 @@ <h3 class="modal-title">Clone Technique</h3>
($(function() {
if (window.self != window.top) {
$(document.body).addClass("iframe");

$(document).on('mouseover','.popover-bs',function(){
$(this).popover('show');
});
$(document).on('mouseover','.tooltip-bs',function(){
$(this).tooltip('show');
});
}
}));
</script>
Expand Down Expand Up @@ -248,14 +234,15 @@ <h3 class="title">Techniques</h3>
<span
class="cursor-help"
ng-if="hasDeprecatedMethod(technique)"
popover-title="{{technique.name}}"
uib-popover-template="'TechniqueWithDeprecatedMethod.html'"
rel="popover"
popover-placement="right"
popover-trigger="mouseenter"
popover-append-to-body="true"
data-toggle="popover"
data-trigger="hover"
data-container="body"
data-placement="right"
data-title="{{technique.name}}"
data-content="<div>This technique uses <b>deprecated</b> generic methods.</div>"
data-html="true"
>
<i class="glyphicon glyphicon-info-sign deprecated-icon"></i>
<i class="glyphicon glyphicon-info-sign deprecated-icon"></i>
</span>
</div>
<div class="col-auto align-self-center" ng-click="checkSelect(technique,selectTechnique);toggleDisplay(false); $event.stopPropagation();">
Expand Down Expand Up @@ -462,7 +449,18 @@ <h5>
</div>
<div class="col method-info" dnd-nodrag>
<div class="btn-holder">
<button type="button" uib-tooltip="Clone this method" tooltip-append-to-body="true" popup-trigger="click" popup-open-delay="500" ng-click="cloneMethod($index);$event.stopPropagation();" class="text-success method-action">
<button
type="button"
class="text-success method-action tooltip-bs"
ng-click="cloneMethod($index);$event.stopPropagation();"
data-toggle="tooltip"
data-trigger="hover"
data-container="body"
data-placement="left"
data-title="Clone this method"
data-html="true"
data-delay='{"show":"400", "hide":"100"}'
>
<i class="fas fa-clone"></i>
</button>
<button type="button" ng-click="removeMethod($index);$event.stopPropagation();" class="text-danger method-action">
Expand All @@ -473,28 +471,36 @@ <h5>
<div class="method-condition col-auto flex-form" ng-if="method_call.class_context !== 'any'">
<label>Condition:</label>
<textarea
class="form-control"
class="form-control popover-bs"
msd-elastic
rows="1"
ng-model="method_call.class_context"
ng-readonly="true"
ng-click="$event.stopPropagation();"
uib-popover-html="'<small>Click <span class=\'text-info\'>3</span> times to copy the whole condition below</small>'"
popover-trigger="mouseenter"
popover-append-to-body="true"
popover-title="{{method_call.class_context}}">
data-toggle="popover"
data-trigger="hover"
data-placement="top"
data-title="{{method_call.class_context}}"
data-content="<small>Click <span class='text-info'>3</span> times to copy the whole condition below</small>"
data-template='<div class="popover condition" role="tooltip"><div class="arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>'
data-html="true">
</textarea>
</div>

<div class="method-name col-auto">
{{method_call.component ? method_call.component : getMethodName(method_call)}}
<span
class="cursor-help"
uib-popover-template="'deprecatedMethod.html'"
popover-title="{{getMethodName(method_call)}}"
popover-trigger="mouseenter"
popover-append-to-body="true">
<i class="fas fa-info-circle tooltip-icon" ng-class="{'deprecated-icon':(method_call.deprecated || isDeprecated(method_call.method_name))}"></i>
<span class="cursor-help">
<i
class="fas fa-info-circle tooltip-icon popover-bs"
ng-class="{'deprecated-icon':(method_call.deprecated || isDeprecated(method_call.method_name))}"
data-toggle="popover"
data-trigger="hover"
data-container="body"
data-placement="auto"
data-title="{{getMethodName(method_call)}}"
data-content="{{getTooltipContent(method_call)}}"
data-html="true"
></i>
</span>
</div>

Expand Down Expand Up @@ -532,7 +538,18 @@ <h5>

</div>
</div>
<div class="edit-method col-auto" ng-click="selectMethod(method_call)" dnd-nodrag uib-tooltip="{{getStatusTooltipMessage(method_call)}}" tooltip-placement="left" tooltip-trigger="mouseenter" popup-open-delay="300">
<div
class="edit-method col-auto tooltip-bs"
ng-click="selectMethod(method_call)"
dnd-nodrag
data-toggle="tooltip"
data-trigger="hover"
data-container="body"
data-placement="left"
data-title="{{getStatusTooltipMessage(method_call)}}"
data-html="true"
data-delay='{"show":"400", "hide":"100"}'
>
<i class="fas fa-pen"></i>
</div>
</div>
Expand Down Expand Up @@ -751,12 +768,17 @@ <h5 id={{kind}}>{{capitaliseFirstLetter(kind)}}</h5>
</div>
<div class="method-name col" ng-click="addMethod(method)">
{{method.name}}
<span
class="cursor-help"
ng-if="method.deprecated"
popover-title="{{method.name}}" uib-popover-template="'deprecatedMethod.html'"
popover-placement="bottom" popover-trigger="mouseenter" popover-append-to-body="true">
<i class="fas fa-info-circle tooltip-icon deprecated-icon"></i>
<span class="cursor-help" ng-if="method.deprecated">
<i
class="fas fa-info-circle tooltip-icon deprecated-icon popover-bs"
data-toggle="popover"
data-trigger="hover"
data-container="body"
data-placement="top"
data-title="{{method.name}}"
data-content="{{getTooltipContent(method)}}"
data-html="true"
></i>
</span>
<img src="ncf-builder/css/dsc-icon.svg" class="dsc-icon" ng-if="checkAgentSupport(method,'dsc')">
</div>
Expand All @@ -775,13 +797,15 @@ <h4 id="categories">Categories</h4>
<a href="" ng-click="scroll(kind)">
{{capitaliseFirstLetter(kind)}}
<span
class="cursor-help"
class="cursor-help popover-bs"
ng-if="!checkDeprecatedFilter(methods)"
popover-title="{{capitaliseFirstLetter(kind)}}"
uib-popover-template="'deprecatedCategory.html'"
popover-placement="bottom"
popover-trigger="hover"
popover-append-to-body="true"
data-toggle="popover"
data-trigger="hover"
data-container="body"
data-placement="bottom"
data-title="{{capitaliseFirstLetter(kind)}}"
data-content="<div>All generic methods in this category are <b>deprecated</b>.</div>"
data-html="true"
> <i class="glyphicon glyphicon-info-sign deprecated-icon"></i>
</span>
</a>
Expand Down
8 changes: 1 addition & 7 deletions builder/js/ncf.js
Expand Up @@ -152,12 +152,6 @@ return {
}
});

app.directive('popover', function() {
return function(scope, elem) {
$(elem).popover();
}
});

app.filter('parameterName', function () {
return function (text) {
if (!text) {
Expand Down Expand Up @@ -1751,4 +1745,4 @@ function uuidv4() {
return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c =>
(c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
);
}
}

0 comments on commit 296a974

Please sign in to comment.