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

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 73ab139e60d82fa6cde5ba6da5b16c816aeaa736d6b687e56edf4c9593b18ce1
4
- data.tar.gz: 3356071c23c83e81044322e9a01f3ecd7f1ccfbd5a0115b2fc874ecc3118ded7
3
+ metadata.gz: 118163d623910662c376737948af610fd3c06182a869b9887138a71fe6cffaa0
4
+ data.tar.gz: ff60a71dccac3a9dfad7b037c1bfa5b0650ee8d9ad3c8a2d9b2fa43141f1a671
5
5
  SHA512:
6
- metadata.gz: 392f48b520c2f1598192dbe096cc22c8367d87f8d5ab53f933079c99605542c1b45924e2b0f356bddb93782721e803e86226e8d2900c1cb5de9d60db67ce4d64
7
- data.tar.gz: d4babcf7d71c49486d64fa4f48955062f96fae8ee942347ccd22c933d3f1c899f773018fd7f1b613fc199e77252e51cb1cd7cd5f820b477143790698e0a74cc9
6
+ metadata.gz: 0eec58c2174c2e5a9e3853cec9090c660f3e6b468f96c32d9719d39366c3ca182d9857c8bad2abdba13bf4c8ca30ef5d1960ef4ecdf74320b955725e7d3a8f3f
7
+ data.tar.gz: a12b801c8a13493698fca9328ca9593e2aeff849fd95adcb0c902a6ce99b2aff746913e0fedcb4f00f4a4fcdfdae0819ea4b5501e82de4c5e0e00e051997c4dc
@@ -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.rc3'
7
7
  end
8
8
  end
9
9
  end
@@ -16,9 +16,12 @@ class WCC::Contentful::Model::MenuButton < WCC::Contentful::Model
16
16
  return external_link if external_link
17
17
 
18
18
  url = (link&.try(:slug) || link&.try(:url))
19
+ return if url.blank? && fragment.blank?
20
+
19
21
  url = URI(url || '')
20
22
 
21
- url.path = "/#{sys.locale}#{url.path}" if sys.locale != WCC::Contentful.configuration.default_locale
23
+ url = rewrite_to_locale(url, sys.locale) if default_locale && sys.locale != default_locale
24
+
22
25
  url.fragment = fragment if fragment.present?
23
26
  url.to_s
24
27
  end
@@ -26,4 +29,16 @@ class WCC::Contentful::Model::MenuButton < WCC::Contentful::Model
26
29
  def fragment
27
30
  WCC::Contentful::App::SectionHelper.section_id(section_link) if section_link
28
31
  end
32
+
33
+ private
34
+
35
+ def default_locale
36
+ WCC::Contentful.configuration&.default_locale
37
+ end
38
+
39
+ def rewrite_to_locale(uri, locale)
40
+ uri = URI(uri)
41
+ uri.path = File.join("/#{locale}", uri.path)
42
+ uri.to_s
43
+ end
29
44
  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.rc3
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-05-01 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.rc3
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.rc3
349
349
  description: Models, Controllers, and Views common to Watermark Church apps
350
350
  email:
351
351
  - dev@watermark.org