spree_admin 5.2.1 → 5.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/spree/admin/components/_dialogs.scss +11 -3
- data/app/controllers/spree/admin/reports_controller.rb +21 -15
- data/app/views/spree/admin/products/form/_status.html.erb +19 -33
- data/app/views/spree/admin/reports/_no_report_data.html.erb +6 -0
- data/app/views/spree/admin/reports/_report.html.erb +24 -16
- data/app/views/spree/admin/reports/index.html.erb +3 -3
- data/app/views/spree/admin/reports/new.html.erb +15 -0
- data/app/views/spree/admin/shared/_product_image.html.erb +2 -1
- metadata +8 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5177ccf868e9028112abe40a50bd111c1fe985b8b1b6830383f4050b5be3f53a
|
|
4
|
+
data.tar.gz: c0beb911d0f70f98c62ac5dad7e0539ff0463a4415bdfa3f98fc0153714184f8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fe80c378126af76654774bb6e5cce0b5478a4223ae9267c59411ddd1faf7335ca571ecd8392ed847b52e2b9002228776829c34d7171021060e080549b3997412
|
|
7
|
+
data.tar.gz: 7f968a6f96c14d51db8287213f74bdb2691c6fbf3d1569f349d9d8c4edbc6cec268563228954a4dab1276b4e7ca62c940f039be4cbb717bc6b7906d078a1dfe6
|
|
@@ -50,7 +50,7 @@ dialog {
|
|
|
50
50
|
overflow-x: hidden;
|
|
51
51
|
}
|
|
52
52
|
dialog:open {
|
|
53
|
-
display:
|
|
53
|
+
display: flex;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
.drawer {
|
|
@@ -119,6 +119,10 @@ dialog:open {
|
|
|
119
119
|
background-color: $gray-25;
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
|
+
// safari fix
|
|
123
|
+
.drawer[open] {
|
|
124
|
+
display: flex;
|
|
125
|
+
}
|
|
122
126
|
|
|
123
127
|
// Native Dialog component (centered modal replacement)
|
|
124
128
|
.dialog {
|
|
@@ -159,9 +163,9 @@ dialog:open {
|
|
|
159
163
|
> turbo-frame:not(#dialog_alerts), turbo-frame > form {
|
|
160
164
|
display: flex;
|
|
161
165
|
width: 100%;
|
|
162
|
-
|
|
166
|
+
flex: 1 1 auto;
|
|
167
|
+
min-height: 0;
|
|
163
168
|
flex-direction: column;
|
|
164
|
-
justify-content: space-between;
|
|
165
169
|
}
|
|
166
170
|
|
|
167
171
|
.dialog-header {
|
|
@@ -200,3 +204,7 @@ dialog:open {
|
|
|
200
204
|
}
|
|
201
205
|
}
|
|
202
206
|
}
|
|
207
|
+
// safari fix
|
|
208
|
+
.dialog[open] {
|
|
209
|
+
display: flex;
|
|
210
|
+
}
|
|
@@ -7,6 +7,7 @@ module Spree
|
|
|
7
7
|
add_breadcrumb Spree.t(:reports), :admin_reports_path
|
|
8
8
|
|
|
9
9
|
before_action :set_user, only: [:new, :create]
|
|
10
|
+
before_action :load_report_line_items, only: [:new, :create]
|
|
10
11
|
|
|
11
12
|
def show
|
|
12
13
|
redirect_to @object.attachment.url, status: :see_other, allow_other_host: true
|
|
@@ -18,6 +19,10 @@ module Spree
|
|
|
18
19
|
@object.user = try_spree_current_user
|
|
19
20
|
end
|
|
20
21
|
|
|
22
|
+
def load_report_line_items
|
|
23
|
+
@report_line_items = @object.line_items
|
|
24
|
+
end
|
|
25
|
+
|
|
21
26
|
def create_turbo_stream_enabled?
|
|
22
27
|
true
|
|
23
28
|
end
|
|
@@ -31,30 +36,31 @@ module Spree
|
|
|
31
36
|
end
|
|
32
37
|
|
|
33
38
|
def build_resource
|
|
34
|
-
model_class.new(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
39
|
+
report_resource = model_class.new(
|
|
40
|
+
store: current_store,
|
|
41
|
+
date_from: parse_date_param(params[:date_from]),
|
|
42
|
+
date_to: parse_date_param(params[:date_to])&.end_of_day,
|
|
43
|
+
currency: params[:currency]
|
|
44
|
+
)
|
|
45
|
+
report_resource.vendor_id = params[:vendor_id] if defined?(Spree::Vendor)
|
|
46
|
+
report_resource
|
|
38
47
|
end
|
|
39
48
|
|
|
40
49
|
def model_class
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
50
|
+
report_type = params[:type] || params.dig(:report, :type)
|
|
51
|
+
@model_class = if report_type.present?
|
|
52
|
+
report_class = find_report_class(report_type)
|
|
53
|
+
raise "Unknown report type: #{report_type}" if report_class.blank?
|
|
45
54
|
|
|
46
|
-
|
|
47
|
-
Object.const_get(report_class)
|
|
48
|
-
else
|
|
49
|
-
raise 'Unknown report type'
|
|
50
|
-
end
|
|
55
|
+
report_class
|
|
51
56
|
else
|
|
52
57
|
Spree::Report
|
|
53
58
|
end
|
|
54
59
|
end
|
|
55
60
|
|
|
56
|
-
def
|
|
57
|
-
Spree.
|
|
61
|
+
def find_report_class(report_type)
|
|
62
|
+
prefixed_type = "Spree::Reports::#{report_type.classify}"
|
|
63
|
+
Spree.reports.find { |klass| [report_type, prefixed_type].include?(klass.to_s) }
|
|
58
64
|
end
|
|
59
65
|
|
|
60
66
|
def permitted_resource_params
|
|
@@ -2,48 +2,34 @@
|
|
|
2
2
|
<div class="card-body">
|
|
3
3
|
<div class="row mb-3">
|
|
4
4
|
<div class="col-6">
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
} %>
|
|
15
|
-
<%= f.select(:status, available_status_options(@product), { selected: @product.status }, select_html) %>
|
|
16
|
-
<%= f.error_message_on :status %>
|
|
17
|
-
</div>
|
|
5
|
+
<%= f.spree_select :status,
|
|
6
|
+
available_status_options(@product),
|
|
7
|
+
{ selected: @product.status, help_bubble: show_product_status_help_bubble? ? Spree.t('admin.products.status_form.status') : nil },
|
|
8
|
+
{ data: {
|
|
9
|
+
action: 'change->product-form#switchAvailabilityDatesFields',
|
|
10
|
+
'product-form-target': 'status'
|
|
11
|
+
}
|
|
12
|
+
} %>
|
|
18
13
|
</div>
|
|
19
|
-
<div class="col-6
|
|
14
|
+
<div class="col-6 <%= 'd-none' if @product.active? %>" data-product-form-target="makeActiveAt">
|
|
20
15
|
<% if can?(:activate, @product) %>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<%= f.error_message_on :make_active_at %>
|
|
25
|
-
<%= f.datetime_field :make_active_at, class: 'form-control', max: @product.discontinue_on %>
|
|
26
|
-
</div>
|
|
16
|
+
<%= f.spree_datetime_field :make_active_at,
|
|
17
|
+
help_bubble: Spree.t('admin.products.status_form.make_active_at'),
|
|
18
|
+
max: @product.discontinue_on %>
|
|
27
19
|
<% end %>
|
|
28
20
|
</div>
|
|
29
21
|
</div>
|
|
30
22
|
<div class="row">
|
|
31
23
|
<div data-product-form-target="availableOn" class="col-6">
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
<%= f.error_message_on :available_on %>
|
|
36
|
-
<%= f.datetime_field :available_on, class: 'form-control', max: @product.discontinue_on %>
|
|
37
|
-
</div>
|
|
24
|
+
<%= f.spree_datetime_field :available_on,
|
|
25
|
+
help_bubble: Spree.t('admin.products.status_form.available_on'),
|
|
26
|
+
max: @product.discontinue_on %>
|
|
38
27
|
</div>
|
|
39
28
|
<div data-product-form-target="discontinueOn" class="col-6">
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
<%= f.error_message_on :discontinue_on %>
|
|
44
|
-
<%= f.datetime_field :discontinue_on, class: 'form-control', min: @product.make_active_at %>
|
|
45
|
-
</div>
|
|
29
|
+
<%= f.spree_datetime_field :discontinue_on,
|
|
30
|
+
help_bubble: Spree.t('admin.products.status_form.discontinue_on'),
|
|
31
|
+
min: @product.make_active_at %>
|
|
46
32
|
</div>
|
|
47
33
|
</div>
|
|
48
34
|
</div>
|
|
49
|
-
</div>
|
|
35
|
+
</div>
|
|
@@ -1,22 +1,30 @@
|
|
|
1
|
+
<% if @report.try(:summary_partial_name) %>
|
|
2
|
+
<%= render "spree/admin/reports/summaries/#{@report.summary_partial_name}", report: @report %>
|
|
3
|
+
<% end %>
|
|
4
|
+
|
|
1
5
|
<div class="card-lg">
|
|
2
6
|
<div class="table-responsive">
|
|
3
|
-
|
|
4
|
-
<
|
|
5
|
-
<
|
|
6
|
-
<% @report.line_item_class.headers.each do |header| %>
|
|
7
|
-
<th scope="col"><%= header[:label] %></th>
|
|
8
|
-
<% end %>
|
|
9
|
-
</tr>
|
|
10
|
-
</thead>
|
|
11
|
-
<tbody>
|
|
12
|
-
<% @report.line_items.each do |line_item| %>
|
|
7
|
+
<% if @report_line_items.any? %>
|
|
8
|
+
<table class="table">
|
|
9
|
+
<thead>
|
|
13
10
|
<tr>
|
|
14
|
-
<%
|
|
15
|
-
<
|
|
11
|
+
<% @report.line_item_class.headers.each do |header| %>
|
|
12
|
+
<th scope="col"><%= header[:label] %></th>
|
|
16
13
|
<% end %>
|
|
17
14
|
</tr>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
</thead>
|
|
16
|
+
<tbody>
|
|
17
|
+
<% @report_line_items.each do |line_item| %>
|
|
18
|
+
<tr>
|
|
19
|
+
<% line_item.class.attribute_types.keys.each do |key| %>
|
|
20
|
+
<td><%= line_item.send(key) %></td>
|
|
21
|
+
<% end %>
|
|
22
|
+
</tr>
|
|
23
|
+
<% end %>
|
|
24
|
+
</tbody>
|
|
25
|
+
</table>
|
|
26
|
+
<% else %>
|
|
27
|
+
<%= render @report.no_report_data_partial_path %>
|
|
28
|
+
<% end %>
|
|
21
29
|
</div>
|
|
22
|
-
</div>
|
|
30
|
+
</div>
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
</tr>
|
|
19
19
|
</thead>
|
|
20
20
|
<tbody>
|
|
21
|
-
<% Spree.
|
|
21
|
+
<% Spree.reports.each do |report_class| %>
|
|
22
22
|
<tr data-controller="row-link">
|
|
23
23
|
<td class="cursor-pointer w-90" data-action="click->row-link#openLink">
|
|
24
|
-
<%= Spree.t("report_names.#{report_type}") %>
|
|
24
|
+
<%= Spree.t("report_names.#{report_class.report_type}") %>
|
|
25
25
|
</td>
|
|
26
26
|
<td class="text-right w-10">
|
|
27
|
-
<%= link_to Spree.t(:show_report), spree.new_admin_report_path(type: report_type), class: 'btn btn-light btn-sm', data: { row_link_target: :link, turbo_frame: '_top' } %>
|
|
27
|
+
<%= link_to Spree.t(:show_report), spree.new_admin_report_path(type: report_class.report_type), class: 'btn btn-light btn-sm', data: { row_link_target: :link, turbo_frame: '_top' } %>
|
|
28
28
|
</td>
|
|
29
29
|
</tr>
|
|
30
30
|
<% end %>
|
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
<%= f.hidden_field :date_from %>
|
|
10
10
|
<%= f.hidden_field :date_to %>
|
|
11
11
|
<%= f.hidden_field :currency %>
|
|
12
|
+
|
|
13
|
+
<% if defined?(Spree::Vendor) %>
|
|
14
|
+
<%= f.hidden_field :vendor_id %>
|
|
15
|
+
<% end %>
|
|
16
|
+
|
|
12
17
|
<button class="btn btn-primary" data-controller="tooltip">
|
|
13
18
|
<%= icon('table-export') %>
|
|
14
19
|
<%= Spree.t(:export) %>
|
|
@@ -33,6 +38,16 @@
|
|
|
33
38
|
class: 'custom-select bg-transparent',
|
|
34
39
|
data: { action: 'change->auto-submit#submit' } %>
|
|
35
40
|
</div>
|
|
41
|
+
|
|
42
|
+
<% if defined?(Spree::Vendor) %>
|
|
43
|
+
<div class="form-group">
|
|
44
|
+
<%= select_tag :vendor_id,
|
|
45
|
+
options_for_select(Spree::Vendor.pluck(:name, :id), @report.vendor_id),
|
|
46
|
+
include_blank: "-- #{Spree.t(:select_vendor)} --",
|
|
47
|
+
class: 'custom-select bg-transparent',
|
|
48
|
+
data: { action: 'change->auto-submit#submit' } %>
|
|
49
|
+
</div>
|
|
50
|
+
<% end %>
|
|
36
51
|
</div>
|
|
37
52
|
<% end %>
|
|
38
53
|
</div>
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<% width ||= 50 %>
|
|
2
2
|
<% height ||= 50 %>
|
|
3
|
+
<% variant ||= :mini %>
|
|
3
4
|
<% image ||= object.default_image %>
|
|
4
5
|
|
|
5
6
|
<% if image.present? && image.attached? && image.variable? %>
|
|
6
7
|
<% alt ||= image.alt || object.name %>
|
|
7
8
|
<div class="admin-product-image-container">
|
|
8
|
-
<%= spree_image_tag(image, width: width, height: height
|
|
9
|
+
<%= spree_image_tag(image, variant: variant, alt: alt, width: width, height: height) %>
|
|
9
10
|
</div>
|
|
10
11
|
<% else %>
|
|
11
12
|
<%= render 'spree/admin/shared/no_image', width: width, height: height %>
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: spree_admin
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 5.2.
|
|
4
|
+
version: 5.2.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Vendo Connect Inc.
|
|
@@ -15,28 +15,28 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - ">="
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 5.2.
|
|
18
|
+
version: 5.2.3
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - ">="
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 5.2.
|
|
25
|
+
version: 5.2.3
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: spree_api
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
29
29
|
requirements:
|
|
30
30
|
- - ">="
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: 5.2.
|
|
32
|
+
version: 5.2.3
|
|
33
33
|
type: :runtime
|
|
34
34
|
prerelease: false
|
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
37
37
|
- - ">="
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: 5.2.
|
|
39
|
+
version: 5.2.3
|
|
40
40
|
- !ruby/object:Gem::Dependency
|
|
41
41
|
name: active_link_to
|
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -931,6 +931,7 @@ files:
|
|
|
931
931
|
- app/views/spree/admin/reimbursement_types/new.html.erb
|
|
932
932
|
- app/views/spree/admin/reimbursements/edit.html.erb
|
|
933
933
|
- app/views/spree/admin/reimbursements/show.html.erb
|
|
934
|
+
- app/views/spree/admin/reports/_no_report_data.html.erb
|
|
934
935
|
- app/views/spree/admin/reports/_report.html.erb
|
|
935
936
|
- app/views/spree/admin/reports/create.turbo_stream.erb
|
|
936
937
|
- app/views/spree/admin/reports/index.html.erb
|
|
@@ -1271,9 +1272,9 @@ licenses:
|
|
|
1271
1272
|
- AGPL-3.0-or-later
|
|
1272
1273
|
metadata:
|
|
1273
1274
|
bug_tracker_uri: https://github.com/spree/spree/issues
|
|
1274
|
-
changelog_uri: https://github.com/spree/spree/releases/tag/v5.2.
|
|
1275
|
+
changelog_uri: https://github.com/spree/spree/releases/tag/v5.2.3
|
|
1275
1276
|
documentation_uri: https://docs.spreecommerce.org/
|
|
1276
|
-
source_code_uri: https://github.com/spree/spree/tree/v5.2.
|
|
1277
|
+
source_code_uri: https://github.com/spree/spree/tree/v5.2.3
|
|
1277
1278
|
rdoc_options: []
|
|
1278
1279
|
require_paths:
|
|
1279
1280
|
- lib
|