pageflow-external-links 2.2.0 → 2.2.1

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: 1238f8a7790db04f3106262157e7de423636835b8b54d51dffb372323d95e907
4
- data.tar.gz: 7fffd9d6757b2f808f839cf7bfa438228c7895293e10c0df6f62e1a218461a4d
3
+ metadata.gz: d667192454267997136db2359354bf6736861c4b663b4b042f3902db5be31bd0
4
+ data.tar.gz: 053ceeea26282f5fe1e7777e6439f24f57a92ce094ae778e6221586eedab8790
5
5
  SHA512:
6
- metadata.gz: 854344f01b6c50908abe8f192a592e941481469a7dd71beb7963b59ba5f12bf27444e28c6343a1d34d5e5ed885b2d783c23d7a2cbe2a4a1aeaa6a67b5f738d8d
7
- data.tar.gz: 27cd62ab68a17527325a107d66f29d5448cdbf296d71c15332143e982db211c1a7f28b34daa47218e8f6e3c0180e31a8b6033d638c199db4e3464b55e9573c78
6
+ metadata.gz: 14bdc1df07ec6053138e40302c8b295a8716f3af48db2b82eec89c2767e2e1d8cef8ea2d8d8a002616c17784789c117a5a5379120e86a90b68bf5dd8de9a7329
7
+ data.tar.gz: 5aa73cf35b0ed78de23ae36d23eb877c829291b9194c4a8014f06d5350651a4641c7727bbbbbe53ca3930a3eeb6e15a849c29f5f136dddbf8abb072459078e41
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # CHANGELOG
2
2
 
3
+ ### Version 2.2.1
4
+
5
+ 2020-02-11
6
+
7
+ [Compare changes](https://github.com/codevise/pageflow-external-links/compare/v2.2.0...v2.2.1)
8
+
9
+ - Prevent error with missing site urls in Pageflow 15.1
10
+ ([#45](https://github.com/codevise/pageflow-external-links/pull/45))
11
+
3
12
  ### Version 2.2.0
4
13
 
5
14
  2019-11-04
data/Gemfile CHANGED
@@ -2,3 +2,6 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in chart.gemspec
4
4
  gemspec
5
+
6
+ # Give a hint to Bundler to prevent endless loop
7
+ gem 'rails', '~> 5.2.0'
data/Gemfile.ci CHANGED
@@ -3,3 +3,6 @@ source 'https://rubygems.org'
3
3
  gemspec
4
4
 
5
5
  gem 'pageflow-theme-doc-publisher', git: 'https://github.com/tf/pageflow-theme-doc-publisher'
6
+
7
+ # Give a hint to Bundler to prevent endless loop
8
+ gem 'rails', '~> 5.2.0'
@@ -1,4 +1,4 @@
1
- <%= link_to(site.url,
1
+ <%= link_to(site.url || '',
2
2
  class: external_links_site_css_class(site),
3
3
  target: site.open_in_new_tab? ? '_blank' : nil) do %>
4
4
 
@@ -1,5 +1,30 @@
1
1
  module PageflowExternalLinks
2
- class InstallGenerator < Pageflow::PageTypeInstallGenerator
2
+ class InstallGenerator < Rails::Generators::Base
3
+ desc 'Install the Pageflow plugin and the necessary migrations.'
4
+
5
+ def register_plugin
6
+ inject_into_file('config/initializers/pageflow.rb',
7
+ after: "Pageflow.configure do |config|\n") do
8
+
9
+ " config.plugin(Pageflow::#{engine_name_suffix.camelize}.plugin)\n"
10
+ end
11
+ end
12
+
13
+ def mount_engine
14
+ route("mount #{engine.name}, at: '/#{engine_name_suffix}'\n")
15
+ end
16
+
17
+ def install_migrations
18
+ rake "pageflow_#{engine_name_suffix}:install:migrations"
19
+ rake 'pageflow_external_links:install:migrations'
20
+ end
21
+
22
+ private
23
+
24
+ def engine_name_suffix
25
+ engine.engine_name.gsub(/^pageflow_/, '')
26
+ end
27
+
3
28
  def engine
4
29
  Pageflow::ExternalLinks::Engine
5
30
  end
@@ -1,5 +1,5 @@
1
1
  module Pageflow
2
2
  module ExternalLinks
3
- VERSION = '2.2.0'.freeze
3
+ VERSION = '2.2.1'.freeze
4
4
  end
5
5
  end
@@ -2,3 +2,49 @@ require 'spec_helper'
2
2
  require 'pageflow/lint'
3
3
 
4
4
  Pageflow::Lint.page_type(Pageflow::ExternalLinks.page_type)
5
+
6
+ module Pageflow
7
+ module ExternalLinks
8
+ describe 'built in video page type', type: :helper do
9
+ include RenderPageTestHelper
10
+
11
+ it 'renders links to referenced sites' do
12
+ revision = FactoryBot.create(:revision, :published)
13
+ Site.create!(revision: revision,
14
+ perma_id: 10,
15
+ url: 'https://example.com',
16
+ title: 'Example')
17
+
18
+ page = FactoryBot.create(:page,
19
+ template: 'external_links',
20
+ revision: revision,
21
+ configuration: {
22
+ linked_external_site_perma_ids: [10]
23
+ })
24
+
25
+ html = render_page(page)
26
+
27
+ expect(html).to have_selector('.link-title', text: 'Example')
28
+ end
29
+
30
+ it 'can handle sites with missing url' do
31
+ revision = FactoryBot.create(:revision, :published)
32
+ Site.create!(revision: revision,
33
+ perma_id: 10,
34
+ url: nil,
35
+ title: 'Example')
36
+
37
+ page = FactoryBot.create(:page,
38
+ template: 'external_links',
39
+ revision: revision,
40
+ configuration: {
41
+ linked_external_site_perma_ids: [10]
42
+ })
43
+
44
+ html = render_page(page)
45
+
46
+ expect(html).to have_selector('.link-title', text: 'Example')
47
+ end
48
+ end
49
+ end
50
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pageflow-external-links
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Codevise Solutions Ltd
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-04 00:00:00.000000000 Z
11
+ date: 2020-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pageflow