Skip to content

Commit 6fc8032

Browse files
committed
Merge branch 'develop' into 232
2 parents 4eea2d6 + 61142d4 commit 6fc8032

File tree

16 files changed

+119
-54
lines changed

16 files changed

+119
-54
lines changed

Gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ group :development, :test do
2626
gem 'puma'
2727
gem 'simplecov', require: false, group: :test
2828
gem 'byebug'
29-
gem 'pry-byebug'
3029
gem 'webmock'
3130
gem 'pry-rails'
3231
gem 'pry-byebug'

Gemfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
matestack-ui-core (0.7.3)
4+
matestack-ui-core (0.7.4)
55
cells-haml
66
cells-rails
77
haml
@@ -121,7 +121,7 @@ GEM
121121
mini_portile2 (2.4.0)
122122
minitest (5.14.0)
123123
nio4r (2.5.2)
124-
nokogiri (1.10.7)
124+
nokogiri (1.10.8)
125125
mini_portile2 (~> 2.4.0)
126126
pipetree (0.1.1)
127127
pry (0.12.2)
@@ -133,7 +133,7 @@ GEM
133133
pry-rails (0.3.9)
134134
pry (>= 0.10.4)
135135
public_suffix (4.0.3)
136-
puma (4.3.1)
136+
puma (4.3.3)
137137
nio4r (~> 2.0)
138138
rack (2.2.1)
139139
rack-proxy (0.6.5)

app/concepts/matestack/ui/core/app/app.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,20 @@ const componentDef = {
1010
},
1111
computed: Vuex.mapState({
1212
asyncTemplate: state => state.pageTemplate,
13+
currentPathName: state => state.currentPathName,
14+
currentSearch: state => state.currentSearch,
15+
currentOrigin: state => state.currentOrigin,
1316
}),
1417
mounted: function(){
18+
const self = this;
1519
window.onpopstate = (event) => {
16-
if (isNavigatingToAnotherPage(document.location, event)) {
17-
this.$store.dispatch("navigateTo", {url: document.location.pathname, backwards: true} );
18-
};
20+
if (isNavigatingToAnotherPage({
21+
origin: self.currentOrigin,
22+
pathName: self.currentPathName,
23+
search: self.currentSearch
24+
}, document.location)){
25+
self.$store.dispatch("navigateTo", {url: document.location.pathname, backwards: true} );
26+
}
1927
}
2028
},
2129
components: {

app/concepts/matestack/ui/core/app/location.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
const isNavigatingToAnotherPage = function(currentLocation, popstateEvent) {
2-
const targetLocation = popstateEvent.target.location;
1+
const isNavigatingToAnotherPage = function(currentLocation, targetLocation) {
32

43
// omits hash by design
5-
return currentLocation.pathname !== targetLocation.pathname ||
4+
return currentLocation.pathName !== targetLocation.pathname ||
65
currentLocation.origin !== targetLocation.origin ||
76
currentLocation.search !== targetLocation.search
87
}

app/concepts/matestack/ui/core/app/store.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,18 @@ Vue.use(Vuex)
88
const store = new Vuex.Store({
99
state: {
1010
pageTemplate: null,
11-
currentPath: document.location.pathname
11+
currentPathName: document.location.pathname,
12+
currentSearch: document.location.search,
13+
currentOrigin: document.location.origin
1214
},
1315
mutations: {
1416
setPageTemplate (state, serverResponse){
1517
state.pageTemplate = serverResponse
1618
},
17-
setCurrentPath (state, path){
18-
state.currentPath = path
19+
setCurrentLocation (state, current){
20+
state.currentPathName = current.path
21+
state.currentSearch = current.search
22+
state.currentOrigin = current.origin
1923
}
2024
},
2125
actions: {
@@ -46,7 +50,7 @@ const store = new Vuex.Store({
4650
setTimeout(function () {
4751
resolve(response["data"])
4852
commit('setPageTemplate', response["data"])
49-
commit('setCurrentPath', url)
53+
commit('setCurrentLocation', { path: url, search: document.location.search, origin: document.location.origin })
5054
matestackEventHub.$emit("page_loaded", url);
5155
if (typeof matestackUiCoreTransitionSuccess !== 'undefined') {
5256
matestackUiCoreTransitionSuccess(url);

app/concepts/matestack/ui/core/form/form.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ const componentDef = {
137137
&& self.componentConfig["success"]["transition"]["follow_response"] === true
138138
&& self.$store != undefined
139139
) {
140-
let path = response.data["transition_to"]
140+
let path = response.data["transition_to"] || response.request.responseURL
141141
self.$store.dispatch('navigateTo', {url: path, backwards: false})
142142
return;
143143
}

app/lib/matestack/ui/core/has_view_context.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ def initialize(model = nil, options = {})
55
end
66

77
def method_missing(*args, &block)
8-
@view_context.send(*args, &block)
8+
if @view_context.respond_to? args.first
9+
@view_context.send(*args, &block)
10+
else
11+
super
12+
end
913
end
1014
end

builder/Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ruby '2.6.5'
66
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
77
gem 'rails', '~> 5.2.0'
88
# Use Puma as the app server
9-
gem 'puma', '~> 3.11'
9+
gem 'puma', '~> 3.12'
1010
# Use SCSS for stylesheets
1111
gem 'sass-rails', '~> 5.0'
1212
# Use Uglifier as compressor for JavaScript assets

builder/Gemfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ GEM
8484
minitest (5.14.0)
8585
msgpack (1.3.1)
8686
nio4r (2.5.2)
87-
nokogiri (1.10.7)
87+
nokogiri (1.10.8)
8888
mini_portile2 (~> 2.4.0)
89-
puma (3.12.2)
89+
puma (3.12.4)
9090
rack (2.1.2)
9191
rack-proxy (0.6.5)
9292
rack
@@ -168,7 +168,7 @@ DEPENDENCIES
168168
coffee-rails (~> 4.2)
169169
jbuilder (~> 2.5)
170170
listen (>= 3.0.5, < 3.2)
171-
puma (~> 3.11)
171+
puma (~> 3.12)
172172
rails (~> 5.2.0)
173173
sass-rails (~> 5.0)
174174
tzinfo-data

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"v-runtime-template": "^1.5.2",
1010
"vue": "^2.5.17",
1111
"vuex": "^3.0.1",
12-
"yarn": "^1.17.3"
12+
"yarn": "^1.22.0"
1313
},
1414
"exports": {
1515
"./concepts/": "./app/concepts/matestack/ui/core/"

0 commit comments

Comments
 (0)