Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: resource cards #791

Closed
wants to merge 31 commits into from
Closed

feature: resource cards #791

wants to merge 31 commits into from

Conversation

adrianthedev
Copy link
Collaborator

@adrianthedev adrianthedev commented Apr 6, 2022

Description

Fixes #1072
Fixes #766
Pre-release: 2.11.3.pre.3
Docs
Example on how to use: https://github.com/avo-hq/avo/pull/791/files#diff-ca106bcd1c807c902c1f474e33c2833de1f9a0436f7346a9e884eb834e1c0e33R111-R121

CleanShot 2023-08-25 at 13 50 20@2x CleanShot 2023-08-25 at 13 50 42@2x

This is still a work in progress. Todo:

  • refactor the card controller methods into their own, in order to avoid conflicts
  • refactor the dashboard controller actions too

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

Manual review steps

Description...

  1. Step 1
  2. Step 2

Manual reviewer: please leave a comment with output from the test if that's the case.

@@ -0,0 +1,211 @@
module Avo
class BaseCard
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Class BaseCard has 23 methods (exceeds 20 allowed). Consider refactoring.

end
end

def card_classes
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method card_classes has 32 lines of code (exceeds 25 allowed). Consider refactoring.

@codeclimate
Copy link

codeclimate bot commented Apr 6, 2022

Code Climate has analyzed commit 7ec0b09 and detected 3 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 3

View more on Code Climate.

@adrianthedev adrianthedev changed the title feature: card take options feature: cards take options Apr 6, 2022
@adrianthedev adrianthedev changed the title feature: cards take options feature: resource cards Apr 6, 2022

delegate :item_at_index, to: :class

def cards(params: nil, view: nil)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method cards has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.


def initialize(id, **args, &block)
def initialize_visibility(args = {})
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method initialize_visibility has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.


delegate :item_at_index, to: :class

def cards
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method cards has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.

@github-actions
Copy link
Contributor

This PR has been marked as stale because there was no activity for the past 15 days.


delegate :item_at_index, to: :class

def cards
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method cards has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.

before_action :set_card, only: :show

def show
end

def show_for_resource
abort ['show_for_resource', params].inspect
show
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[rubocop] reported by reviewdog 🐶
Lint/UnreachableCode: Unreachable code detected.


def show_for_record
abort ['show_for_record', params].inspect
show
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[rubocop] reported by reviewdog 🐶
Lint/UnreachableCode: Unreachable code detected.

@github-actions
Copy link
Contributor

This PR has been marked as stale because there was no activity for the past 15 days.

@adrianthedev
Copy link
Collaborator Author

Closing in favor to bring it in Avo 3.0.

@adrianthedev
Copy link
Collaborator Author

adrianthedev commented Aug 25, 2023

For better syncing with this PR https://github.com/avo-hq/avo-3/pull/29, let's first build the feature where the cards sit on top of everything nomatter what with def cards method.

Second iteration add cards do block inside fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Resource cards
1 participant