Skip to content

Commit

Permalink
Merge pull request #221 from emrysr/feature/hide-notification-once-added
Browse files Browse the repository at this point in the history
hide warning after addNew()
  • Loading branch information
glynhudson authored Jun 20, 2019
2 parents 4e29f21 + 60961a2 commit 8afa1e5
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions Views/dashboard_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,12 @@


<div id="app" class="container-fluid" v-cloak>
<div class="alert mt-2" :class="{'alert-warning':true}" v-if="status.message">
<div class="alert mt-2" :class="{'alert-warning':true}" v-if="gridData.length === 0">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="alert-heading" if="status.title">{{ status.title }}</h4>
{{ status.message }}
<h4 class="alert-heading" if="status.title"><?php echo _('No dashboards created') ?></h4>
<?php echo _('Maybe you would like to add your first dashboard using the button below&hellip;') ?>
</div>
<div class="d-flex justify-content-between align-items-center">
<div class="d-flex align-items-center">
Expand Down Expand Up @@ -201,9 +201,7 @@ function getTranslations(){
'Edit this dashboard layout': "<?php echo _('Edit this dashboard layout') ?>",
'Delete this dashboard': "<?php echo _('Delete this dashboard') ?>…",
'View this dashboard': "<?php echo _('View this dashboard') ?>…",
'Edit Layout': "<?php echo _('Edit Layout') ?>",
'No dashboards created': "<?php echo _('No dashboards created') ?>",
'Maybe you would like to add your first dashboard using the button bellow.': "<?php echo _('Maybe you would like to add your first dashboard using the button bellow.') ?>"
'Edit Layout': "<?php echo _('Edit Layout') ?>"
}
}
</script>
Expand Down Expand Up @@ -613,13 +611,14 @@ function(insert_id){
},
addNew: function() {
let vm = this;
dashboard_v2.add().then(function(){
vm.update();
dashboard_v2.add().then(function() {
vm.update({title:_('Added')});
})
},
update: function() {
update: function(message) {
let vm = this;
vm.Notify(_('Loading'), true)
message = message ? message: _('Loading');
vm.Notify(message, true)
dashboard_v2.list().then(
function(data){
// handle success - populate gridData[] array
Expand All @@ -632,10 +631,6 @@ function(data){
});
if(data.length === 0) {
vm.gridData = [];
vm.Notify({
'title': _('No dashboards created'),
'message': _('Maybe you would like to add your first dashboard using the button bellow.')
}, true)
} else {
vm.gridData = data;
}
Expand Down

0 comments on commit 8afa1e5

Please sign in to comment.