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

ROAD-536 Add VersionJump model and admin integration #299

Merged
merged 4 commits into from
Sep 6, 2023

Conversation

arielj
Copy link
Contributor

@arielj arielj commented Aug 31, 2023

Jira Ticket

https://ombulabs.atlassian.net/browse/ROAD-536

Motivation / Context

This issue #296

QA / Testing Instructions

  • Create a Version Jump object in the admin panel
  • Then it can be asigned to projects (new or existing)
  • Then, for each version jump, the admin panel will show all the projects associated

Screenshots:

image
image
image


I will abide by the code of conduct.

@@ -52,6 +53,10 @@ def archived?
status == "archived"
end

def locked?
locked_at.present?
end
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can revert this change, but was really simple to add (I updated some code that was using project.locekd_at.nil? directly)

@@ -0,0 +1,2 @@
class StoryPolicy < ApplicationPolicy
end
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had to create all the policies to be able to use this Pundit feature in the admin panel

<%= link_to resource.new_path, class: "bg-white hover:bg-gray-100 text-gray-800 font-semibold py-2 px-4 border border-gray-400 rounded shadow" do %>
New <span class="hidden md:inline"><%= resource.friendly_name %></span>
<% end %>
<% end %>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I took this back from the original gem

Copy link
Contributor

Choose a reason for hiding this comment

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

What's the original gem? madmin?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

record.to_label
end

# Uncomment this to customize the default sort column and direction.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can/should we get rid of these comments if we aren't customizing the default_sort_column?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was already there commented out in the other resources. Not sure why that was not removed before, so I'd say to note remove it just for this resource (maybe some low-priority story can be about cleaning up these comments, I don't want to change files that I don't need to change for a comment)

@torresga
Copy link
Contributor

torresga commented Sep 1, 2023

@arielj One thing I noticed when testing the admin panel is that there is no way to prevent admins from creating the same version jump multiple times. For example, an admin can create multiple Rails projects that have an initial version of 6.0 and a target version of 6.1. There's also nothing stopping admins from creating a version jump that has more than one jump (think a version jump from 6.0 to 7.1 for example) This might lead to users being confused and possibly disjointed data. I don't know whether we should explore this further, or for our purposes, we can trust our users to not make mistakes. What do you think?

@arielj
Copy link
Contributor Author

arielj commented Sep 1, 2023

@arielj One thing I noticed when testing the admin panel is that there is no way to prevent admins from creating the same version jump multiple times. For example, an admin can create multiple Rails projects that have an initial version of 6.0 and a target version of 6.1. There's also nothing stopping admins from creating a version jump that has more than one jump (think a version jump from 6.0 to 7.1 for example) This might lead to users being confused and possibly disjointed data. I don't know whether we should explore this further, or for our purposes, we can trust our users to not make mistakes. What do you think?

@torresga I'll add a validation to prevent adding the same jump twice

About a jump of more than 1 version I think it's fine? at least I did that intentionally: I was thinking of using, for example, Rails / 4.2 - 6.0 for the parent project, and then Rails / 4.2 - 5.0 Rails / 5.0 - 5.1, Rails / 5.1 - 5.2 and Rails / 5.2 - 6.0 for each of the sub-projects.

I guess we'll need ernesto to define this better.

@hmdros
Copy link
Contributor

hmdros commented Sep 4, 2023

I would leave a small suggestion to add a badge, maybe a small one inside the box, indicating the subproject version jump:

Captura de tela 2023-09-04 152751
Captura de tela 2023-09-04 152720
Captura de tela 2023-09-04 152743

@arielj
Copy link
Contributor Author

arielj commented Sep 4, 2023

I would leave a small suggestion to add a badge, maybe a small one inside the box, indicating the [subproject]

I did that initially, but then I realized this is how we name subprojects and it was redundant to have the same information in the name of the subproject and the label
image

@arielj arielj linked an issue Sep 4, 2023 that may be closed by this pull request
2 tasks
@etagwerker
Copy link
Member

I guess we'll need ernesto to define this better.

@torresga @arielj We can trust that admins will know enough to not create jumps that span multiple versions, so I don't think this is a blocker.

@aisayo aisayo temporarily deployed to points-road-536-better--mo4e2h September 5, 2023 15:23 Inactive
@arielj
Copy link
Contributor Author

arielj commented Sep 6, 2023

Pushed 2 updates:

  • version jump column/field for projects in admin panel
    image
    image

And CSS issue fix:
image

@aisayo aisayo temporarily deployed to points-road-536-better--wckcqg September 6, 2023 20:07 Inactive
@etagwerker
Copy link
Member

@arielj Looks good, thank you!

@etagwerker etagwerker merged commit 1f1b405 into main Sep 6, 2023
4 checks passed
@etagwerker etagwerker deleted the ROAD-536-better-tracking-filtering branch September 6, 2023 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Better tracking for version jumps and projects
5 participants