workarea-admin 3.5.0.beta.1 → 3.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/workarea/admin/config.js.erb +12 -4
- data/app/assets/javascripts/workarea/admin/modules/impersonation_notification.js +1 -3
- data/app/assets/javascripts/workarea/admin/modules/selects.js +11 -1
- data/app/assets/javascripts/workarea/admin/modules/timeline_report_chart.js +69 -5
- data/app/assets/javascripts/workarea/admin/modules/toggle_elements.js +2 -2
- data/app/assets/javascripts/workarea/admin/modules/tooltips.js +18 -3
- data/app/assets/javascripts/workarea/admin/templates/chart_legend.jst.ejs +2 -1
- data/app/assets/stylesheets/workarea/admin/application.scss.erb +1 -0
- data/app/assets/stylesheets/workarea/admin/components/_button.scss +7 -0
- data/app/assets/stylesheets/workarea/admin/components/_chart_legend.scss +18 -1
- data/app/assets/stylesheets/workarea/admin/components/_timeline_report.scss +30 -0
- data/app/assets/stylesheets/workarea/admin/settings/_grid.scss +1 -0
- data/app/controllers/workarea/admin/content_assets_controller.rb +1 -3
- data/app/controllers/workarea/admin/custom_events_controller.rb +41 -0
- data/app/controllers/workarea/admin/data_file_imports_controller.rb +1 -1
- data/app/controllers/workarea/admin/guest_browsings_controller.rb +1 -2
- data/app/controllers/workarea/admin/segmentables_controller.rb +12 -0
- data/app/helpers/workarea/admin/activities_helper.rb +1 -1
- data/app/helpers/workarea/admin/application_helper.rb +15 -0
- data/app/helpers/workarea/admin/facets_helper.rb +3 -0
- data/app/helpers/workarea/admin/icons_helper.rb +12 -3
- data/app/helpers/workarea/admin/segments_helper.rb +12 -1
- data/app/view_models/workarea/admin/alerts_view_model.rb +12 -1
- data/app/view_models/workarea/admin/reports/timeline_view_model.rb +77 -13
- data/app/view_models/workarea/admin/segment_view_model.rb +15 -0
- data/app/views/layouts/workarea/admin/application.html.haml +8 -2
- data/app/views/workarea/admin/activities/_create.html.haml +1 -1
- data/app/views/workarea/admin/activities/_destroy.html.haml +1 -1
- data/app/views/workarea/admin/activities/_update.html.haml +1 -1
- data/app/views/workarea/admin/catalog_categories/_cards.html.haml +1 -1
- data/app/views/workarea/admin/catalog_categories/index.html.haml +1 -1
- data/app/views/workarea/admin/catalog_products/_cards.html.haml +1 -1
- data/app/views/workarea/admin/catalog_products/index.html.haml +1 -1
- data/app/views/workarea/admin/content/_card.html.haml +3 -0
- data/app/views/workarea/admin/content/_edit.html.haml +11 -3
- data/app/views/workarea/admin/content/_form.html.haml +8 -1
- data/app/views/workarea/admin/content_assets/edit.html.haml +6 -1
- data/app/views/workarea/admin/content_assets/new.html.haml +6 -1
- data/app/views/workarea/admin/content_blocks/_asset.html.haml +3 -2
- data/app/views/workarea/admin/content_pages/_cards.html.haml +1 -1
- data/app/views/workarea/admin/content_pages/index.html.haml +1 -1
- data/app/views/workarea/admin/data_file_imports/new.html.haml +1 -1
- data/app/views/workarea/admin/insights/_cold_searches.html.haml +1 -1
- data/app/views/workarea/admin/insights/_hot_searches.html.haml +1 -1
- data/app/views/workarea/admin/insights/_searches_to_improve.html.haml +1 -1
- data/app/views/workarea/admin/insights/_star_searches.html.haml +1 -1
- data/app/views/workarea/admin/insights/_trending_searches.html.haml +1 -1
- data/app/views/workarea/admin/navigation_menus/index.html.haml +1 -1
- data/app/views/workarea/admin/pricing_discounts/_cards.html.haml +3 -1
- data/app/views/workarea/admin/pricing_discounts/edit.html.haml +16 -5
- data/app/views/workarea/admin/pricing_discounts/index.html.haml +1 -1
- data/app/views/workarea/admin/releases/edit.html.haml +1 -1
- data/app/views/workarea/admin/releases/index.html.haml +25 -0
- data/app/views/workarea/admin/releases/list.html.haml +2 -2
- data/app/views/workarea/admin/reports/timeline.html.haml +89 -1
- data/app/views/workarea/admin/search_customizations/_cards.html.haml +1 -1
- data/app/views/workarea/admin/search_customizations/index.html.haml +1 -1
- data/app/views/workarea/admin/segment_rules/fields/_last_order.html.haml +2 -1
- data/app/views/workarea/admin/segment_rules/fields/_revenue.html.haml +2 -3
- data/app/views/workarea/admin/segment_rules/fields/_traffic_referrer.html.haml +12 -6
- data/app/views/workarea/admin/segment_rules/summaries/_last_order.html.haml +4 -1
- data/app/views/workarea/admin/segment_rules/summaries/_traffic_referrer.html.haml +2 -10
- data/app/views/workarea/admin/segmentables/index.html.haml +46 -0
- data/app/views/workarea/admin/segments/_cards.html.haml +21 -0
- data/app/views/workarea/admin/segments/_publish.html.haml +2 -2
- data/app/views/workarea/admin/shared/_active_field.html.haml +5 -0
- data/app/views/workarea/admin/status_report_mailer/report.html.haml +5 -0
- data/app/views/workarea/admin/toolbar/show.html.haml +1 -0
- data/app/views/workarea/admin/users/index.html.haml +1 -0
- data/config/locales/en.yml +74 -17
- data/config/routes.rb +3 -0
- data/test/helpers/workarea/admin/application_helper_test.rb +24 -0
- data/test/helpers/workarea/admin/facets_helper_test.rb +28 -0
- data/test/integration/workarea/admin/assets_integration_test.rb +4 -2
- data/test/integration/workarea/admin/custom_events_integration_test.rb +54 -0
- data/test/integration/workarea/admin/data_file_imports_integration_test.rb +8 -0
- data/test/integration/workarea/admin/fulfillment_skus_integration_test.rb +2 -2
- data/test/system/workarea/admin/alerts_system_test.rb +7 -3
- data/test/system/workarea/admin/content_system_test.rb +46 -0
- data/test/system/workarea/admin/guest_browsing_system_test.rb +1 -1
- data/test/system/workarea/admin/orders_system_test.rb +3 -3
- data/test/system/workarea/admin/payment_transactions_system_test.rb +3 -3
- data/test/system/workarea/admin/reports_system_test.rb +50 -1
- data/test/system/workarea/admin/segments_system_test.rb +32 -4
- data/test/view_models/workarea/admin/reports/timeline_view_model_test.rb +32 -1
- metadata +14 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5341f457a231d57f8903f5300d3ba014713adb1ae1b18a0497fed5215812e272
|
4
|
+
data.tar.gz: 6bd7f5868b117fd2b837e8020cfda2422fb38e0e21fc3a2f3992d1d9e77cd774
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9aaf000aced6215c42222f10b4b925e1037b18b5782538be8244589194b23f6bc3f4e2ecb6b417459d98427392caa64aff7a4c8a1a1aed029ff7aec45aa544f
|
7
|
+
data.tar.gz: 59934acecd3201289f6346ac94fae1381968137672e41f1dce637a94b958152e9d2104e7f86f39376adcb1df9cea6d25021b26e864f7efb958d47e666d89b1a8
|
@@ -685,7 +685,8 @@
|
|
685
685
|
WORKAREA.config.timelineReportChart = {
|
686
686
|
initiallyActive: {
|
687
687
|
'Revenue': true,
|
688
|
-
'Releases': true
|
688
|
+
'Releases': true,
|
689
|
+
'Custom Events': true
|
689
690
|
},
|
690
691
|
|
691
692
|
datasets: {
|
@@ -698,7 +699,8 @@
|
|
698
699
|
orders: '#011eff',
|
699
700
|
units_sold: '#ff4070',
|
700
701
|
customers: '#ff8100',
|
701
|
-
releases: '#303541'
|
702
|
+
releases: '#303541',
|
703
|
+
custom_events: '#999999'
|
702
704
|
},
|
703
705
|
|
704
706
|
options: {
|
@@ -715,8 +717,14 @@
|
|
715
717
|
tooltips: {
|
716
718
|
mode: 'index',
|
717
719
|
filter: function (item, data) {
|
718
|
-
var label = data.datasets[item.datasetIndex].label
|
719
|
-
|
720
|
+
var label = data.datasets[item.datasetIndex].label,
|
721
|
+
dataset = data.datasets[item.datasetIndex],
|
722
|
+
blockedLabels = [
|
723
|
+
I18n.t('workarea.admin.reports.timeline.releases'),
|
724
|
+
I18n.t('workarea.admin.reports.timeline.custom_events')
|
725
|
+
];
|
726
|
+
|
727
|
+
return ! (dataset.hidden || _.includes(blockedLabels, label));
|
720
728
|
}
|
721
729
|
},
|
722
730
|
scales: {
|
@@ -14,9 +14,7 @@ WORKAREA.registerModule('impersonationNotification', (function () {
|
|
14
14
|
|
15
15
|
confirm = function ($form) {
|
16
16
|
var confirmed = window.confirm(
|
17
|
-
|
18
|
-
name: $form.data('impersonationNotification')
|
19
|
-
})
|
17
|
+
$form.data('impersonationNotification')
|
20
18
|
);
|
21
19
|
|
22
20
|
if (confirmed) { return; }
|
@@ -20,7 +20,17 @@ WORKAREA.registerModule('selects', (function () {
|
|
20
20
|
},
|
21
21
|
|
22
22
|
setup = function(index, select) {
|
23
|
-
|
23
|
+
var config = getConfig(select),
|
24
|
+
$select = $(select);
|
25
|
+
|
26
|
+
if (config.allowClear) {
|
27
|
+
$select.before(JST['workarea/core/templates/hidden_input']({
|
28
|
+
name: $select.attr('name'),
|
29
|
+
value: ''
|
30
|
+
}));
|
31
|
+
}
|
32
|
+
|
33
|
+
$select.select2(config);
|
24
34
|
},
|
25
35
|
|
26
36
|
init = function ($scope) {
|
@@ -8,6 +8,12 @@ WORKAREA.registerModule('timelineReportChart', (function () {
|
|
8
8
|
var $item = $(event.target).closest('.chart-legend__list-item'),
|
9
9
|
dataset = chart.data.datasets[event.target.value];
|
10
10
|
|
11
|
+
if ($item.is('.chart-legend__list-item--no-interact')) {
|
12
|
+
event.preventDefault();
|
13
|
+
event.stopPropagation();
|
14
|
+
return;
|
15
|
+
}
|
16
|
+
|
11
17
|
if (event.target.checked) {
|
12
18
|
dataset.hidden = false;
|
13
19
|
$item.removeClass('chart-legend__list-item--disabled');
|
@@ -19,10 +25,59 @@ WORKAREA.registerModule('timelineReportChart', (function () {
|
|
19
25
|
chart.update();
|
20
26
|
},
|
21
27
|
|
28
|
+
closeTooltip = function (chart) {
|
29
|
+
chart.tooltip._active = [];
|
30
|
+
},
|
31
|
+
|
32
|
+
showTooltip = function (chart, indiciesGroup) {
|
33
|
+
var activeElements = chart.tooltip._active || [];
|
34
|
+
|
35
|
+
_.forEach(indiciesGroup, function (indicies) {
|
36
|
+
activeElements.push(
|
37
|
+
chart.getDatasetMeta(indicies[0]).data[indicies[1]]
|
38
|
+
);
|
39
|
+
});
|
40
|
+
|
41
|
+
chart.tooltip._active = activeElements;
|
42
|
+
},
|
43
|
+
|
44
|
+
toggleTooltip = function (toggle, chart, event) {
|
45
|
+
var $target = $(event.currentTarget),
|
46
|
+
dateChunks = $target.data('timelineReportChartEvent'),
|
47
|
+
date = new Date(dateChunks[0], dateChunks[1] - 1, dateChunks[2]),
|
48
|
+
indiciesGroup = [];
|
49
|
+
|
50
|
+
_.forEach(chart.data.datasets, function (dataset, datasetIndex) {
|
51
|
+
_.forEach(dataset.data, function (data, pointIndex) {
|
52
|
+
if (data.x.getTime() === date.getTime()) {
|
53
|
+
indiciesGroup.push([datasetIndex, pointIndex]);
|
54
|
+
}
|
55
|
+
});
|
56
|
+
});
|
57
|
+
|
58
|
+
if (toggle === 'open') {
|
59
|
+
showTooltip(chart, indiciesGroup);
|
60
|
+
} else if (toggle === 'close') {
|
61
|
+
closeTooltip(chart);
|
62
|
+
}
|
63
|
+
|
64
|
+
chart.tooltip.update(true);
|
65
|
+
chart.draw();
|
66
|
+
},
|
67
|
+
|
68
|
+
setupSidebar = function (chart) {
|
69
|
+
$(chart.canvas)
|
70
|
+
.closest('.view')
|
71
|
+
.find('[data-timeline-report-chart-event]')
|
72
|
+
.on('mouseenter', _.partial(toggleTooltip, 'open', chart))
|
73
|
+
.on('mouseleave', _.partial(toggleTooltip, 'close', chart));
|
74
|
+
},
|
75
|
+
|
22
76
|
setupLegend = function (chart) {
|
23
77
|
var legend = JST['workarea/admin/templates/chart_legend']({
|
24
78
|
datasets: chart.data.datasets,
|
25
|
-
enabled: WORKAREA.config.timelineReportChart.initiallyActive
|
79
|
+
enabled: WORKAREA.config.timelineReportChart.initiallyActive,
|
80
|
+
noInteract: ['Releases', 'Custom Events']
|
26
81
|
});
|
27
82
|
|
28
83
|
$('#timeline-report-chart-legend')
|
@@ -36,9 +91,8 @@ WORKAREA.registerModule('timelineReportChart', (function () {
|
|
36
91
|
return _.map(dataset, function (item) {
|
37
92
|
var data = { x: new Date(item.x) };
|
38
93
|
|
39
|
-
if (type === 'releases') {
|
94
|
+
if (type === 'releases' || type === 'custom_events') {
|
40
95
|
data.y = item.y > 0 ? 0 : null;
|
41
|
-
data.releaseCount = item.y;
|
42
96
|
} else {
|
43
97
|
data.y = item.y || 0;
|
44
98
|
}
|
@@ -63,10 +117,11 @@ WORKAREA.registerModule('timelineReportChart', (function () {
|
|
63
117
|
dataConfig.yAxisID = 'unit-axis';
|
64
118
|
}
|
65
119
|
|
66
|
-
if (
|
67
|
-
dataConfig.pointStyle = 'triangle';
|
120
|
+
if (_.includes(['releases', 'custom_events'], type)) {
|
68
121
|
dataConfig.radius = 10;
|
69
122
|
dataConfig.hoverRadius = 13;
|
123
|
+
dataConfig.showLine = false;
|
124
|
+
dataConfig.pointStyle = 'triangle';
|
70
125
|
}
|
71
126
|
|
72
127
|
dataConfig.data = transformDataset(dataset, type);
|
@@ -93,12 +148,21 @@ WORKAREA.registerModule('timelineReportChart', (function () {
|
|
93
148
|
chart = new Chart(canvas.getContext('2d'), getConfig(data));
|
94
149
|
|
95
150
|
setupLegend(chart);
|
151
|
+
setupSidebar(chart);
|
152
|
+
},
|
153
|
+
|
154
|
+
destroyEventTooltips = function () {
|
155
|
+
$('[data-tooltip]').each(function (_, trigger) {
|
156
|
+
$(trigger).tooltipster('destroy');
|
157
|
+
});
|
96
158
|
},
|
97
159
|
|
98
160
|
init = function ($scope) {
|
99
161
|
$('[data-timeline-report-chart]', $scope).each(setup);
|
100
162
|
};
|
101
163
|
|
164
|
+
$(document).on('turbolinks:before-cache', destroyEventTooltips);
|
165
|
+
|
102
166
|
return {
|
103
167
|
init: init
|
104
168
|
};
|
@@ -10,11 +10,11 @@ WORKAREA.registerModule('toggleElement', (function () {
|
|
10
10
|
* @memberof WORKAREA.toggleElement
|
11
11
|
*/
|
12
12
|
var toggle = function (event) {
|
13
|
-
var
|
13
|
+
var target = $(event.target).data('toggleElement');
|
14
14
|
|
15
15
|
event.preventDefault();
|
16
16
|
|
17
|
-
$target.toggleClass('hidden');
|
17
|
+
$(target).toggleClass('hidden');
|
18
18
|
},
|
19
19
|
|
20
20
|
init = function ($scope) {
|
@@ -55,13 +55,28 @@ WORKAREA.registerModule('tooltips', (function () {
|
|
55
55
|
// Otherwise If the trigger is a link with href use that to populate tooltip
|
56
56
|
// If neither are present, throw an error.
|
57
57
|
getContent = function(trigger, options) {
|
58
|
+
var $content;
|
59
|
+
|
58
60
|
if (!_.isEmpty(options.content)) {
|
59
|
-
|
61
|
+
$content = $('<div />').html(options.content);
|
60
62
|
} else if (!_.isEmpty(options.content_id)) {
|
61
|
-
|
63
|
+
$content = $(options.content_id);
|
62
64
|
} else if(!_.isEmpty($(trigger).attr('href'))) {
|
63
|
-
|
65
|
+
$content = $($(trigger).attr('href'));
|
66
|
+
} else {
|
67
|
+
$content = $('<div />');
|
64
68
|
}
|
69
|
+
|
70
|
+
// Prevent interactive UIs within a tooltip from accidentally
|
71
|
+
// closing the tooltip. A good example of this would be jQuery UI
|
72
|
+
// Datepicker or Datetimepicker being embedded in a tooltip.
|
73
|
+
if (options.interactive && options.trigger === 'click') {
|
74
|
+
$content.on('click', function (event) {
|
75
|
+
event.stopPropagation();
|
76
|
+
});
|
77
|
+
}
|
78
|
+
|
79
|
+
return $content;
|
65
80
|
},
|
66
81
|
|
67
82
|
customTriggerToggle = function ($trigger) {
|
@@ -1,7 +1,8 @@
|
|
1
1
|
<div class="chart-legend">
|
2
2
|
<ul class="chart-legend__list">
|
3
3
|
<% _.forEach(datasets, function (dataset, index) { %>
|
4
|
-
|
4
|
+
<% disable = _.includes(noInteract, dataset.label) %>
|
5
|
+
<li class="chart-legend__list-item <%= disable ? 'chart-legend__list-item--no-interact' : '' %>" style="color: <%= dataset.backgroundColor %>">
|
5
6
|
<span class="checkbox">
|
6
7
|
<% checked = !!enabled[dataset.label] %>
|
7
8
|
<input type="checkbox" value="<%= index %>" class="checkbox__input" id="chart_dataset_<%= index %>"<% if (checked) { %> checked="checked"<% } %>>
|
@@ -141,6 +141,7 @@
|
|
141
141
|
@import 'workarea/admin/components/dashboard_graphs';
|
142
142
|
@import 'workarea/admin/components/jump_to_menu';
|
143
143
|
@import 'workarea/admin/components/chart_legend';
|
144
|
+
@import 'workarea/admin/components/timeline_report';
|
144
145
|
<%= append_stylesheets('admin.components') %>
|
145
146
|
|
146
147
|
@import 'workarea/admin/trumps/break_word';
|
@@ -9,7 +9,9 @@ $button-disabled-opacity: 0.5 !default;
|
|
9
9
|
|
10
10
|
$button-font-size: 16px !default;
|
11
11
|
$button-small-font-size: 14px !default;
|
12
|
+
$button-tiny-font-size: 12px !default;
|
12
13
|
$button-padding: 0.58em 1em !default;
|
14
|
+
$button-tiny-padding: 0.3em 0.6em !default;
|
13
15
|
|
14
16
|
$button-create-bg-color: $green !default;
|
15
17
|
$button-create-hover-bg-color: $bright-green !default;
|
@@ -58,6 +60,11 @@ $button-destroy-hover-bg-color: $bright-red !default;
|
|
58
60
|
font-size: $button-small-font-size;
|
59
61
|
}
|
60
62
|
|
63
|
+
.button--tiny {
|
64
|
+
padding: $button-tiny-padding;
|
65
|
+
font-size: $button-tiny-font-size;
|
66
|
+
}
|
67
|
+
|
61
68
|
.button--create {
|
62
69
|
background: $button-create-bg-color;
|
63
70
|
|
@@ -2,7 +2,8 @@
|
|
2
2
|
#CHART-LEGEND
|
3
3
|
\*------------------------------------*/
|
4
4
|
|
5
|
-
$chart-legend-list-item-disabled-opacity: .25 !default;
|
5
|
+
$chart-legend-list-item-disabled-opacity: 0.25 !default;
|
6
|
+
$chart-legend-item-border-color: $border-color !default;
|
6
7
|
|
7
8
|
.chart-legend {}
|
8
9
|
|
@@ -12,8 +13,24 @@ $chart-legend-list-item-disabled-opacity: .25 !default;
|
|
12
13
|
|
13
14
|
.chart-legend__list-item {
|
14
15
|
margin: 0 $spacing-unit;
|
16
|
+
border: 1px solid $chart-legend-item-border-color;
|
17
|
+
border-radius: $global-border-radius;
|
18
|
+
padding: ($spacing-unit / 2) $spacing-unit;
|
15
19
|
}
|
16
20
|
|
17
21
|
.chart-legend__list-item--disabled {
|
18
22
|
opacity: $chart-legend-list-item-disabled-opacity;
|
19
23
|
}
|
24
|
+
|
25
|
+
.chart-legend__list-item--no-interact {
|
26
|
+
cursor: not-allowed;
|
27
|
+
|
28
|
+
.checkbox__label {
|
29
|
+
cursor: not-allowed;
|
30
|
+
}
|
31
|
+
|
32
|
+
.checkbox__label::before,
|
33
|
+
.checkbox__label::after {
|
34
|
+
display: none;
|
35
|
+
}
|
36
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
/*------------------------------------*\
|
2
|
+
#TIMELINE-REPORT
|
3
|
+
\*------------------------------------*/
|
4
|
+
|
5
|
+
$timeline-report-add-new-color: $green !default;
|
6
|
+
|
7
|
+
.timeline-report {}
|
8
|
+
|
9
|
+
|
10
|
+
.timeline-report__sidebar-header {
|
11
|
+
margin-bottom: $spacing-unit;
|
12
|
+
padding-bottom: $spacing-unit;
|
13
|
+
border-bottom: 1px solid $border-color;
|
14
|
+
}
|
15
|
+
|
16
|
+
|
17
|
+
.timeline-report__event-group {
|
18
|
+
transition: opacity 0.2s ease;
|
19
|
+
opacity: 0.75;
|
20
|
+
}
|
21
|
+
|
22
|
+
.timeline-report__event-group:hover {
|
23
|
+
opacity: 1;
|
24
|
+
}
|
25
|
+
|
26
|
+
|
27
|
+
.timeline-report__events-list {
|
28
|
+
margin-left: $spacing-unit / 2;
|
29
|
+
}
|
30
|
+
|
@@ -7,9 +7,7 @@ module Workarea
|
|
7
7
|
after_action :track_index_filters, only: :index
|
8
8
|
|
9
9
|
def index
|
10
|
-
if Configuration::S3.configured?
|
11
|
-
DirectUpload.ensure_cors!(request.url)
|
12
|
-
end
|
10
|
+
DirectUpload.ensure_cors!(request.url) if Configuration::S3.configured?
|
13
11
|
|
14
12
|
search = Search::AdminAssets.new(params)
|
15
13
|
@search = Admin::SearchViewModel.new(search, view_model_options)
|
@@ -0,0 +1,41 @@
|
|
1
|
+
module Workarea
|
2
|
+
module Admin
|
3
|
+
class CustomEventsController < Admin::ApplicationController
|
4
|
+
before_action :find_event
|
5
|
+
|
6
|
+
def create
|
7
|
+
@custom_event.save!
|
8
|
+
flash[:success] = t('workarea.admin.reports.timeline.flash_messages.created')
|
9
|
+
redirect_back fallback_location: root_path
|
10
|
+
end
|
11
|
+
|
12
|
+
def update
|
13
|
+
if @custom_event.update(params[:custom_event])
|
14
|
+
flash[:success] =
|
15
|
+
t('workarea.admin.reports.timeline.flash_messages.success')
|
16
|
+
else
|
17
|
+
flash[:error] =
|
18
|
+
t('workarea.admin.reports.timeline.flash_messages.error')
|
19
|
+
end
|
20
|
+
|
21
|
+
redirect_back fallback_location: root_path
|
22
|
+
end
|
23
|
+
|
24
|
+
def destroy
|
25
|
+
@custom_event.destroy
|
26
|
+
flash[:success] = t('workarea.admin.reports.timeline.flash_messages.success')
|
27
|
+
redirect_back fallback_location: root_path
|
28
|
+
end
|
29
|
+
|
30
|
+
private
|
31
|
+
|
32
|
+
def find_event
|
33
|
+
@custom_event = if params[:id].present?
|
34
|
+
Workarea::Reports::CustomEvent.find_by(id: params[:id])
|
35
|
+
else
|
36
|
+
Workarea::Reports::CustomEvent.new(params[:custom_event])
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -9,7 +9,7 @@ module Workarea
|
|
9
9
|
|
10
10
|
def sample
|
11
11
|
filename = "#{@import.name.downcase.underscore}.#{@import.file_type}"
|
12
|
-
send_data @import.sample_file_content, filename: filename, type: @import.
|
12
|
+
send_data @import.sample_file_content, filename: filename, type: @import.mime_type, disposition: :attachment
|
13
13
|
end
|
14
14
|
|
15
15
|
def create
|
@@ -2,7 +2,6 @@ module Workarea
|
|
2
2
|
module Admin
|
3
3
|
class GuestBrowsingsController < Admin::ApplicationController
|
4
4
|
include Storefront::CurrentCheckout
|
5
|
-
required_permissions :people
|
6
5
|
|
7
6
|
def create
|
8
7
|
admin_browse_as_guest
|
@@ -18,7 +17,7 @@ module Workarea
|
|
18
17
|
clear_current_order
|
19
18
|
|
20
19
|
flash[:success] = t('workarea.admin.guest_browsing.flash_messages.stopped')
|
21
|
-
|
20
|
+
redirect_back_or root_path
|
22
21
|
end
|
23
22
|
end
|
24
23
|
end
|