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

WIP: [FEAT] Custom Links in Dropdown Menu #5718

Draft
wants to merge 33 commits into
base: main
Choose a base branch
from

Conversation

nepaakash
Copy link
Contributor

What github issue is this PR for, if any?

Resolves #5704

What changed, and why?

How is this tested? (please write tests!) 💖💪

Note: if you see a flake in your test build in github actions, please post in slack #casa "Flaky test: " :) 💪
Note: We love capybara tests! If you are writing both haml/js and ruby, please try to test your work with tests at every level including system tests like https://github.com/rubyforgood/casa/tree/main/spec/system

Screenshots please :)

Run your local server and take a screenshot of your work! Try to include the URL of the page as well as the contents of the page.

Feelings gif (optional)

What gif best describes your feeling working on this issue? https://giphy.com/
How to embed:

![alt text](https://media.giphy.com/media/1nP7ThJFes5pgXKUNf/giphy.gif)

@nepaakash nepaakash marked this pull request as draft May 13, 2024 16:01
@github-actions github-actions bot added the ruby Pull requests that update Ruby code label May 13, 2024
@@ -52,7 +52,6 @@ def user_org_learning_topic_enable?
# id :bigint not null, primary key
# duration_hours :integer not null
# duration_minutes :integer not null
# learning_type :integer default(5)
Copy link
Collaborator

Choose a reason for hiding this comment

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

interesting diff - at some point we need to figure out why this keeps appearing and disappearing

Copy link
Collaborator

Choose a reason for hiding this comment

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

Agreed. This thing drives me nuts in my code. Also I feel like I messed it up. @elasticspoon any ideas?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this should be removed. It looks like :learning_type was adding in

t.integer :learning_type, default: 5, not_null: true
but then removed in
class RemoveLearningType < ActiveRecord::Migration[7.0]

It probably should have been removed but somehow got left in?

I suspect what is going on is it exists in the schema because someone forgot to commit the removal. Most people do a schema:load to they have it. But when people run migrations it attempts to remove the column. And every time the removal is attempted we think "thats weird, we should leave the column".

Copy link
Collaborator

Choose a reason for hiding this comment

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

I would leave it in for now simply because I think the removal might mess up the seeding.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@nepaakash revert this change for now

require 'rails_helper'

RSpec.describe CustomLink, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

please add tests before merging

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes sure... It is still a work in progress

Comment on lines 1 to 3
class CustomLink < ApplicationRecord
belongs_to :casa_org
end
Copy link
Collaborator

@schoork schoork May 23, 2024

Choose a reason for hiding this comment

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

Should add some validation on the url and the text

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 task is still in progress... Will definitely add those

db/schema.rb Outdated
@@ -420,7 +429,6 @@

create_table "learning_hours", force: :cascade do |t|
t.bigint "user_id", null: false
t.integer "learning_type", default: 5
Copy link
Collaborator

Choose a reason for hiding this comment

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

revert this change for now

@bcastillo32
Copy link
Collaborator

@nepaakash how are you coming along here? :) do you need any help?

@github-actions github-actions bot added the erb label Jun 23, 2024
@nepaakash
Copy link
Contributor Author

@nepaakash how are you coming along here? :) do you need any help?

Thankyou for asking. Everything is good , Apologies for the delay. Just a quick question, are we not showing any icons for the custom links?

@elasticspoon
Copy link
Collaborator

elasticspoon commented Jun 23, 2024

Just a quick question, are we not showing any icons for the custom links?

@nepaakash Thats a good question. We should. You can just use a basic link icon <i class="lni lni-link"></i>.

Also, we don't need the soft delete behavior for these links. Soft delete is needed with topics because deletion would impact historical data but that is not the case here.

@schoork
Copy link
Collaborator

schoork commented Jun 29, 2024

@nepaakash Getting this when spinning up locally.
Screenshot 2024-06-29 at 7 57 38 AM

Probably these references.

Screenshot 2024-06-29 at 8 00 15 AM

@nepaakash
Copy link
Contributor Author

@nepaakash Getting this when spinning up locally. Screenshot 2024-06-29 at 7 57 38 AM

Probably these references.

Screenshot 2024-06-29 at 8 00 15 AM

@schoork Sorry! I have already fixed that issue locally. I will just push it.

Copy link

This PR has been open for a long time without any pushes or comments! What's up?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
erb no-pr-activity ruby Pull requests that update Ruby code Tests! 🎉💖👏
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom Links in Dropdown Menu
5 participants