Skip to content

Commit

Permalink
Abandon Avo Literal types.
Browse files Browse the repository at this point in the history
  • Loading branch information
simi committed Oct 31, 2024
1 parent 10b1851 commit 2003238
Show file tree
Hide file tree
Showing 16 changed files with 19 additions and 35 deletions.
1 change: 1 addition & 0 deletions app/views/application_view.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class ApplicationView < ApplicationComponent
# By default, it inherits from `ApplicationComponent`, but you
# can change that to `Phlex::HTML` if you want to keep views and
# components independent.
extend PropInitializer::Properties

Check warning on line 9 in app/views/application_view.rb

View check run for this annotation

Codecov / codecov/patch

app/views/application_view.rb#L9

Added line #L9 was not covered by tests

def title=(title)
@_view_context.instance_variable_set :@title, title
Expand Down
1 change: 1 addition & 0 deletions app/views/components/application_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

class ApplicationComponent < Phlex::HTML
include Phlex::Rails::Helpers::Routes
extend PropInitializer::Properties

Check warning on line 5 in app/views/components/application_component.rb

View check run for this annotation

Codecov / codecov/patch

app/views/components/application_component.rb#L5

Added line #L5 was not covered by tests

class TranslationHelper
include ActionView::Helpers::TranslationHelper
Expand Down
4 changes: 1 addition & 3 deletions app/views/components/events/table_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ class Events::TableComponent < ApplicationComponent
register_value_helper :page_entries_info
register_value_helper :paginate

extend Literal::Properties

prop :security_events, _Union(ActiveRecord::Relation, Array), reader: :private
prop :security_events

Check warning on line 15 in app/views/components/events/table_component.rb

View check run for this annotation

Codecov / codecov/patch

app/views/components/events/table_component.rb#L15

Added line #L15 was not covered by tests

def view_template
header(class: "gems__header push--s") do
Expand Down
4 changes: 2 additions & 2 deletions app/views/components/events/table_details_component.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class Events::TableDetailsComponent < ApplicationComponent
extend Literal::Properties
extend PropInitializer::Properties

Check warning on line 2 in app/views/components/events/table_details_component.rb

View check run for this annotation

Codecov / codecov/patch

app/views/components/events/table_details_component.rb#L2

Added line #L2 was not covered by tests

prop :event, _Any, reader: :private
prop :event

Check warning on line 4 in app/views/components/events/table_details_component.rb

View check run for this annotation

Codecov / codecov/patch

app/views/components/events/table_details_component.rb#L4

Added line #L4 was not covered by tests
delegate :additional, :rubygem, to: :event

def view_template
Expand Down
3 changes: 1 addition & 2 deletions app/views/components/oidc/api_key_role/table_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

class OIDC::ApiKeyRole::TableComponent < ApplicationComponent
include Phlex::Rails::Helpers::LinkTo
extend Literal::Properties

prop :api_key_roles, _Any, reader: :private
prop :api_key_roles

Check warning on line 6 in app/views/components/oidc/api_key_role/table_component.rb

View check run for this annotation

Codecov / codecov/patch

app/views/components/oidc/api_key_role/table_component.rb#L6

Added line #L6 was not covered by tests

def view_template
table(class: "t-body") do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# frozen_string_literal: true

class OIDC::IdToken::KeyValuePairsComponent < ApplicationComponent
extend Literal::Properties
prop :pairs, _Any, reader: :private
prop :pairs

Check warning on line 4 in app/views/components/oidc/id_token/key_value_pairs_component.rb

View check run for this annotation

Codecov / codecov/patch

app/views/components/oidc/id_token/key_value_pairs_component.rb#L4

Added line #L4 was not covered by tests

def view_template
dl(class: "t-body provider_attributes full-width overflow-wrap") do
Expand Down
3 changes: 1 addition & 2 deletions app/views/components/oidc/id_token/table_component.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# frozen_string_literal: true

class OIDC::IdToken::TableComponent < ApplicationComponent
extend Literal::Properties
prop :id_tokens, _Any, reader: :private
prop :id_tokens

Check warning on line 4 in app/views/components/oidc/id_token/table_component.rb

View check run for this annotation

Codecov / codecov/patch

app/views/components/oidc/id_token/table_component.rb#L4

Added line #L4 was not covered by tests

include Phlex::Rails::Helpers::TimeTag
include Phlex::Rails::Helpers::LinkToUnlessCurrent
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# frozen_string_literal: true

class OIDC::TrustedPublisher::GitHubAction::FormComponent < ApplicationComponent
extend Literal::Properties

prop :github_action_form, _Any, reader: :private
prop :github_action_form

Check warning on line 4 in app/views/components/oidc/trusted_publisher/github_action/form_component.rb

View check run for this annotation

Codecov / codecov/patch

app/views/components/oidc/trusted_publisher/github_action/form_component.rb#L4

Added line #L4 was not covered by tests

def view_template
github_action_form.fields_for :trusted_publisher do |trusted_publisher_form|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
class OIDC::TrustedPublisher::GitHubAction::TableComponent < ApplicationComponent
extend Literal::Properties

prop :github_action, _Any, reader: :private
prop :github_action

Check warning on line 2 in app/views/components/oidc/trusted_publisher/github_action/table_component.rb

View check run for this annotation

Codecov / codecov/patch

app/views/components/oidc/trusted_publisher/github_action/table_component.rb#L2

Added line #L2 was not covered by tests

def view_template
dl(class: "tw-flex tw-flex-col sm:tw-grid sm:tw-grid-cols-2 tw-items-baseline tw-gap-4 full-width overflow-wrap") do
Expand Down
3 changes: 1 addition & 2 deletions app/views/oidc/id_tokens/show_view.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# frozen_string_literal: true

class OIDC::IdTokens::ShowView < ApplicationView
extend Literal::Properties
include Phlex::Rails::Helpers::TimeTag
include Phlex::Rails::Helpers::LinkTo

prop :id_token, OIDC::IdToken, reader: :private
prop :id_token

Check warning on line 7 in app/views/oidc/id_tokens/show_view.rb

View check run for this annotation

Codecov / codecov/patch

app/views/oidc/id_tokens/show_view.rb#L7

Added line #L7 was not covered by tests

def view_template # rubocop:disable Metrics/AbcSize
self.title = t(".title")
Expand Down
3 changes: 1 addition & 2 deletions app/views/oidc/pending_trusted_publishers/index_view.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ class OIDC::PendingTrustedPublishers::IndexView < ApplicationView
include Phlex::Rails::Helpers::ContentFor
include Phlex::Rails::Helpers::DistanceOfTimeInWordsToNow
include Phlex::Rails::Helpers::LinkTo
extend Literal::Properties

prop :trusted_publishers, _Any, reader: :private
prop :trusted_publishers

Check warning on line 9 in app/views/oidc/pending_trusted_publishers/index_view.rb

View check run for this annotation

Codecov / codecov/patch

app/views/oidc/pending_trusted_publishers/index_view.rb#L9

Added line #L9 was not covered by tests

def view_template
title_content
Expand Down
4 changes: 1 addition & 3 deletions app/views/oidc/pending_trusted_publishers/new_view.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ class OIDC::PendingTrustedPublishers::NewView < ApplicationView
include Phlex::Rails::Helpers::OptionsForSelect
include Phlex::Rails::Helpers::FormWith

extend Literal::Properties

prop :pending_trusted_publisher, OIDC::PendingTrustedPublisher, reader: :private
prop :pending_trusted_publisher

Check warning on line 9 in app/views/oidc/pending_trusted_publishers/new_view.rb

View check run for this annotation

Codecov / codecov/patch

app/views/oidc/pending_trusted_publishers/new_view.rb#L9

Added line #L9 was not covered by tests

def view_template
self.title = t(".title")
Expand Down
5 changes: 2 additions & 3 deletions app/views/oidc/rubygem_trusted_publishers/index_view.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ class OIDC::RubygemTrustedPublishers::IndexView < ApplicationView
include Phlex::Rails::Helpers::LinkTo
include Phlex::Rails::Helpers::ContentFor
include OIDC::RubygemTrustedPublishers::Concerns::Title
extend Literal::Properties

prop :rubygem, Rubygem, reader: :private
prop :trusted_publishers, _Any, reader: :private
prop :rubygem
prop :trusted_publishers

Check warning on line 11 in app/views/oidc/rubygem_trusted_publishers/index_view.rb

View check run for this annotation

Codecov / codecov/patch

app/views/oidc/rubygem_trusted_publishers/index_view.rb#L9-L11

Added lines #L9 - L11 were not covered by tests
def view_template
title_content
Expand Down
4 changes: 1 addition & 3 deletions app/views/oidc/rubygem_trusted_publishers/new_view.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ class OIDC::RubygemTrustedPublishers::NewView < ApplicationView
include Phlex::Rails::Helpers::SelectTag
include OIDC::RubygemTrustedPublishers::Concerns::Title

extend Literal::Properties

prop :rubygem_trusted_publisher, OIDC::RubygemTrustedPublisher, reader: :private
prop :rubygem_trusted_publisher

def view_template
title_content
Expand Down
3 changes: 1 addition & 2 deletions app/views/profiles/security_events_view.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ class Profiles::SecurityEventsView < ApplicationView
include Phlex::Rails::Helpers::DistanceOfTimeInWordsToNow
include Phlex::Rails::Helpers::TimeTag
include Phlex::Rails::Helpers::LinkTo
extend Literal::Properties

prop :security_events, _Any, reader: :private
prop :security_events

Check warning on line 10 in app/views/profiles/security_events_view.rb

View check run for this annotation

Codecov / codecov/patch

app/views/profiles/security_events_view.rb#L10

Added line #L10 was not covered by tests

def view_template
title_content
Expand Down
5 changes: 2 additions & 3 deletions app/views/rubygems/security_events_view.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ class Rubygems::SecurityEventsView < ApplicationView
include Phlex::Rails::Helpers::ButtonTo
include Phlex::Rails::Helpers::ContentFor
include Phlex::Rails::Helpers::LinkTo
extend Literal::Properties

prop :rubygem, Rubygem, reader: :private
prop :security_events, _Any, reader: :private
prop :rubygem
prop :security_events

Check warning on line 9 in app/views/rubygems/security_events_view.rb

View check run for this annotation

Codecov / codecov/patch

app/views/rubygems/security_events_view.rb#L8-L9

Added lines #L8 - L9 were not covered by tests

def view_template
title_content
Expand Down

0 comments on commit 2003238

Please sign in to comment.