Skip to content

Commit 990adfb

Browse files
committed
adjusted dummy app to final 2.0.0 changes
1 parent 2a8fde1 commit 990adfb

File tree

7 files changed

+31
-31
lines changed

7 files changed

+31
-31
lines changed

spec/dummy/app/javascript/packs/application.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ window.MatestackUiCore = MatestackUiCore // making MatestackUiCore globally avai
1919
MatestackUiCore.Vue = Vue // test compatability
2020

2121

22+
console.log("fooo")
2223
let matestackUiApp = undefined
2324

2425
document.addEventListener('DOMContentLoaded', () => {

spec/dummy/app/matestack/dummy/components/chart_js.js

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Vue.component('chart-js-component', {
3131
},
3232
drawBarChart: function(chartElement){
3333
const self = this;
34-
this.componentConfig["datasets"].forEach(function(item){
34+
this.props["datasets"].forEach(function(item){
3535
if (item["backgroundColor"] === undefined){
3636
item["backgroundColor"] = self.getThemeColor("primary")
3737
}else{
@@ -49,16 +49,16 @@ Vue.component('chart-js-component', {
4949
this.chartJsInstance = new Chart(chartElement, {
5050
type: 'bar',
5151
data: {
52-
labels: this.componentConfig["labels"],
53-
datasets: this.componentConfig["datasets"]
52+
labels: this.props["labels"],
53+
datasets: this.props["datasets"]
5454
},
5555
options: {
5656
legend: {
57-
display: this.componentConfig["display_legend"],
57+
display: this.props["display_legend"],
5858
},
5959
scales: {
6060
yAxes: [{
61-
display: this.componentConfig["display_y_axes"],
61+
display: this.props["display_y_axes"],
6262
gridLines: {
6363
display: false,
6464
},
@@ -67,7 +67,7 @@ Vue.component('chart-js-component', {
6767
}
6868
}],
6969
xAxes: [{
70-
display: this.componentConfig["display_x_axes"],
70+
display: this.props["display_x_axes"],
7171
gridLines: {
7272
display: false,
7373
},
@@ -81,7 +81,7 @@ Vue.component('chart-js-component', {
8181
},
8282
drawLineChart: function(chartElement){
8383
const self = this;
84-
this.componentConfig["datasets"].forEach(function(item){
84+
this.props["datasets"].forEach(function(item){
8585
if (item["borderColor"] === undefined){
8686
item["borderColor"] = self.getThemeColor("primary")
8787
}else{
@@ -95,16 +95,16 @@ Vue.component('chart-js-component', {
9595
this.chartJsInstance = new Chart(chartElement, {
9696
type: 'line',
9797
data: {
98-
labels: this.componentConfig["labels"],
99-
datasets: this.componentConfig["datasets"]
98+
labels: this.props["labels"],
99+
datasets: this.props["datasets"]
100100
},
101101
options: {
102102
legend: {
103-
display: this.componentConfig["display_legend"],
103+
display: this.props["display_legend"],
104104
},
105105
scales: {
106106
yAxes: [{
107-
display: this.componentConfig["display_y_axes"],
107+
display: this.props["display_y_axes"],
108108
gridLines: {
109109
display: false,
110110
},
@@ -113,7 +113,7 @@ Vue.component('chart-js-component', {
113113
}
114114
}],
115115
xAxes: [{
116-
display: this.componentConfig["display_x_axes"],
116+
display: this.props["display_x_axes"],
117117
gridLines: {
118118
display: false,
119119
},
@@ -127,7 +127,7 @@ Vue.component('chart-js-component', {
127127
},
128128
drawDoughnutChart: function(chartElement){
129129
const self = this;
130-
this.componentConfig["datasets"].forEach(function(item){
130+
this.props["datasets"].forEach(function(item){
131131
if (item["backgroundColor"] === undefined){
132132
item["backgroundColor"] = self.getThemeColor("primary")
133133
}else{
@@ -158,20 +158,20 @@ Vue.component('chart-js-component', {
158158
this.chartJsInstance = new Chart(chartElement, {
159159
type: 'doughnut',
160160
data: {
161-
labels: this.componentConfig["labels"],
162-
datasets: this.componentConfig["datasets"]
161+
labels: this.props["labels"],
162+
datasets: this.props["datasets"]
163163
},
164164
options: {
165165
legend: {
166-
display: this.componentConfig["display_legend"],
166+
display: this.props["display_legend"],
167167
},
168-
cutoutPercentage: this.componentConfig["cutout_percentage"]
168+
cutoutPercentage: this.props["cutout_percentage"]
169169
}
170170
});
171171
},
172172
drawPieChart: function(chartElement){
173173
const self = this;
174-
this.componentConfig["datasets"].forEach(function(item){
174+
this.props["datasets"].forEach(function(item){
175175
if (item["backgroundColor"] === undefined){
176176
item["backgroundColor"] = self.getThemeColor("primary")
177177
}else{
@@ -186,12 +186,12 @@ Vue.component('chart-js-component', {
186186
this.chartJsInstance = new Chart(chartElement, {
187187
type: 'pie',
188188
data: {
189-
labels: this.componentConfig["labels"],
190-
datasets: this.componentConfig["datasets"]
189+
labels: this.props["labels"],
190+
datasets: this.props["datasets"]
191191
},
192192
options: {
193193
legend: {
194-
display: this.componentConfig["display_legend"],
194+
display: this.props["display_legend"],
195195
}
196196
}
197197
});
@@ -211,16 +211,16 @@ Vue.component('chart-js-component', {
211211

212212
const chartElement = this.$refs.chart
213213

214-
if(this.componentConfig["type"] == "bar"){
214+
if(this.props["type"] == "bar"){
215215
this.drawBarChart(chartElement);
216216
}
217-
if(this.componentConfig["type"] == "line"){
217+
if(this.props["type"] == "line"){
218218
this.drawLineChart(chartElement);
219219
}
220-
if(this.componentConfig["type"] == "doughnut"){
220+
if(this.props["type"] == "doughnut"){
221221
this.drawDoughnutChart(chartElement);
222222
}
223-
if(this.componentConfig["type"] == "pie"){
223+
if(this.props["type"] == "pie"){
224224
this.drawPieChart(chartElement);
225225
}
226226

spec/dummy/app/matestack/dummy/components/chart_js.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Dummy::Components::ChartJs < ApplicationVueJsComponent
1212
optional :cutout_percentage
1313
optional class: { as: :bs_class }
1414

15-
def config
15+
def vue_props
1616
# injected into vue.js components
1717
{}.tap do |props|
1818
props[:type] = context.type

spec/dummy/app/matestack/dummy/components/form/flatpickr.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ Vue.component('form-flatpickr-component', {
1010
},
1111
mounted: function(){
1212
flatpickr(this.$el.querySelector('.flatpickr'), {
13-
defaultDate: this.componentConfig["init_value"],
14-
enableTime: (this.componentConfig["enable_time"] == true)
13+
defaultDate: this.props["init_value"],
14+
enableTime: (this.props["enable_time"] == true)
1515
});
1616
}
1717
});

spec/dummy/app/matestack/dummy/components/form/flatpickr.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class Dummy::Components::Form::Flatpickr < Matestack::Ui::Bootstrap::Form::Input
77

88
vue_name "form-flatpickr-component"
99

10-
def config
10+
def vue_props
1111
{
1212
init_value: init_value,
1313
enable_time: context.enable_time

spec/dummy/app/matestack/dummy/pages/dashboard/show.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ def response
88

99
def dummy_tab_content
1010
bs_page_heading title: t("dashboard.title"), subtitle: t("dashboard.subtitle")
11-
# bs_icon name: "x"
1211
bs_row do
1312
bs_col md: 6 do
1413
analytics_partial

spec/dummy/app/matestack/dummy/pages/products/form.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ def product_form_partial form_config
44
matestack_form form_config do
55

66
div class: "mb-3" do
7-
bs_form_input key: :name, label: "Name", type: :text, required: true
7+
bs_form_input key: :name, label: "Name", type: :text
88
end
99
div class: "mb-3" do
1010
bs_form_input key: :description, label: "Description", type: :text

0 commit comments

Comments
 (0)