Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MONUI-116: Add breadcrumbs to callflow and move save and delete buttons #113

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 26 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,20 @@ define(function(require) {
template.find('.entity-manager').show();
});

// Clicking the 'Callflows' breadcrumb closes any open callflow
template.on('click', '.entity-header .hide-callflow', function() {
$('#ws_cf_flow').empty();
$('.buttons').empty();
$('#ws_cf_tools').empty();
$('#hidden_callflow_warning').hide();
$('#pending_change').hide();
$('.breadcrumbs .current').empty();
$('.breadcrumbs span:first-child').addClass('hide-separator');

self.repaintList();
self.resetFlow();
});

template.find('.entity-edition .list-add').on('click', function() {
var type = template.find('.entity-edition .list-container .list').data('type');
editEntity(type);
Expand Down Expand Up @@ -983,6 +997,8 @@ define(function(require) {
$('.buttons').empty();
$('#ws_cf_tools').empty();
$('#hidden_callflow_warning').hide();
$('.breadcrumbs .current').empty();
$('.breadcrumbs span:first-child').addClass('hide-separator');

self.repaintList();
self.resetFlow();
Expand Down Expand Up @@ -1242,6 +1258,14 @@ define(function(require) {
self.show_pending_change(self.original_flow !== current_flow);
}

// Add the name of the current callflow (or its numbers if no name given)
// to the breadcrumbs in the action bar
const callflowTitle = this.flow.name
|| this.flow.numbers.join(', ')
|| this.i18n.active().callflowsApp.editor.current;
$('.entity-header .breadcrumbs .current').text(callflowTitle);
$('.breadcrumbs .hide-separator').removeClass('hide-separator');

var metadata = self.dataCallflow.hasOwnProperty('ui_metadata') ? self.dataCallflow.ui_metadata : false,
isHiddenCallflow = metadata && metadata.hasOwnProperty('origin') && _.includes(['voip', 'migration', 'mobile', 'callqueues'], metadata.origin);

Expand All @@ -1252,10 +1276,10 @@ define(function(require) {
var self = this;
if (pending_change) {
$('#pending_change', '#ws_callflow').show();
$('.save', '#ws_callflow').addClass('pulse-box');
$('.entity-header .save', '#callflow_container').addClass('pulse-box');
} else {
$('#pending_change', '#ws_callflow').hide();
$('.save', '#ws_callflow').removeClass('pulse-box');
$('.entity-header .save', '#callflow_container').removeClass('pulse-box');
}
},

Expand Down
34 changes: 34 additions & 0 deletions style/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -1594,6 +1594,40 @@
float: right;
}

#callflow_container .entity-header .breadcrumbs {
float: left;
}
#callflow_container .entity-header .breadcrumbs .entity-title {
float: none;
font-size: 19px;
}
#callflow_container .entity-header .breadcrumbs a {
color: black;
cursor: pointer;
}
#callflow_container .entity-header .breadcrumbs a:hover {
border-bottom: 2px solid black;
}
#callflow_container .entity-header .breadcrumbs span {
color: black;
font-size: 19px;
}
#callflow_container .entity-header .breadcrumbs span.current {
font-weight: 600;
border-bottom: 2px solid black;
}
#callflow_container .entity-header .breadcrumbs span:not(.current):not(.hide-separator):after {
content: "\03031";
display: inline-block;
font-size: 13px;
margin: 0 8px 0 10px;
transform: scaleX(-1.2) translateY(-1px);
}

#callflow_container .entity-header .buttons {
float: right;
}

#callflow_container .entity-header .superadmin-mode {
float: right;
line-height: 35px;
Expand Down
11 changes: 8 additions & 3 deletions views/callflow-manager.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,15 @@

<div class="callflow-content listing-mode">
<div class="entity-header">
<div class="entity-title">{{ i18n.entityManager.callflowsTitle }}</div>

<nav class="breadcrumbs">
<span class="hide-separator">
<a class="hide-callflow entity-title">{{ i18n.entityManager.callflowsTitle }}</a>
</span>
<span class="current"></span>
</nav>

<button type="button" class="back-button monster-button-secondary">{{ i18n.entityManager.backButton }}</button>
<div class="buttons"></div>
{{#if canToggleCallflows}}
<div class="superadmin-mode">
<span class="switch-title">
Expand Down Expand Up @@ -48,7 +54,6 @@
<div class="callflow">
<div>
<span class="flow">
<div class="buttons"></div>
<div id="ws_cf_flow"></div>
</span>
</div>
Expand Down