wcc-contentful-app 1.4.0.rc1 → 1.4.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 73ab139e60d82fa6cde5ba6da5b16c816aeaa736d6b687e56edf4c9593b18ce1
4
- data.tar.gz: 3356071c23c83e81044322e9a01f3ecd7f1ccfbd5a0115b2fc874ecc3118ded7
3
+ metadata.gz: cb8544accdf8bb9c26bcf200d5fdff9b4ae21c1292e6878958bc72d99cf38bb2
4
+ data.tar.gz: 955a3aaeb9d8bbee66955e29df093637a005fd58886369c2114a7df178cb53a7
5
5
  SHA512:
6
- metadata.gz: 392f48b520c2f1598192dbe096cc22c8367d87f8d5ab53f933079c99605542c1b45924e2b0f356bddb93782721e803e86226e8d2900c1cb5de9d60db67ce4d64
7
- data.tar.gz: d4babcf7d71c49486d64fa4f48955062f96fae8ee942347ccd22c933d3f1c899f773018fd7f1b613fc199e77252e51cb1cd7cd5f820b477143790698e0a74cc9
6
+ metadata.gz: 7a7e458f40876b6eb374f7916b55854ead7ff0b619ae741b068a2c3871699ca9f31dc87cbf450a5474bf8f3026baaa109519ff2030ecb49981f6b8abd2cb0386
7
+ data.tar.gz: 81c39f1053eff4f0144b5a1b536bf1cec297c4c061b7a2eefd789e3d8668654b8dcfa4ce17e0fe883ee1ee8fccfc4fc39e174a2886542ad80aab30eb976762c8
@@ -3,7 +3,7 @@
3
3
  module WCC
4
4
  module Contentful
5
5
  module App
6
- VERSION = '1.4.0.rc1'
6
+ VERSION = '1.4.0.rc2'
7
7
  end
8
8
  end
9
9
  end
@@ -18,7 +18,8 @@ class WCC::Contentful::Model::MenuButton < WCC::Contentful::Model
18
18
  url = (link&.try(:slug) || link&.try(:url))
19
19
  url = URI(url || '')
20
20
 
21
- url.path = "/#{sys.locale}#{url.path}" if sys.locale != WCC::Contentful.configuration.default_locale
21
+ url = rewrite_to_locale(url, sys.locale) if default_locale && sys.locale != default_locale
22
+
22
23
  url.fragment = fragment if fragment.present?
23
24
  url.to_s
24
25
  end
@@ -26,4 +27,16 @@ class WCC::Contentful::Model::MenuButton < WCC::Contentful::Model
26
27
  def fragment
27
28
  WCC::Contentful::App::SectionHelper.section_id(section_link) if section_link
28
29
  end
30
+
31
+ private
32
+
33
+ def default_locale
34
+ WCC::Contentful.configuration&.default_locale
35
+ end
36
+
37
+ def rewrite_to_locale(uri, locale)
38
+ uri = URI(uri)
39
+ uri.path = File.join("/#{locale}", uri.path)
40
+ uri.to_s
41
+ end
29
42
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wcc-contentful-app
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0.rc1
4
+ version: 1.4.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Watermark Dev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-28 00:00:00.000000000 Z
11
+ date: 2023-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
@@ -338,14 +338,14 @@ dependencies:
338
338
  requirements:
339
339
  - - "~>"
340
340
  - !ruby/object:Gem::Version
341
- version: 1.4.0.rc1
341
+ version: 1.4.0.rc2
342
342
  type: :runtime
343
343
  prerelease: false
344
344
  version_requirements: !ruby/object:Gem::Requirement
345
345
  requirements:
346
346
  - - "~>"
347
347
  - !ruby/object:Gem::Version
348
- version: 1.4.0.rc1
348
+ version: 1.4.0.rc2
349
349
  description: Models, Controllers, and Views common to Watermark Church apps
350
350
  email:
351
351
  - dev@watermark.org