-
Notifications
You must be signed in to change notification settings - Fork 6
COR-526: Featured Image Button #406
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
Conversation
@ElliottAYoung Reminder to follow PR naming conventions + attach labels + assign milestone |
@toastercup - shoot I thought I got this one, never hit save |
] | ||
}, | ||
{ | ||
"name": "Add Featured Image", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you don't have anything to add for heading
, remember that it's optional - we can remove it here
padding: 0; | ||
} | ||
|
||
.content_item_button { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this may be our first significant example of a plugin requiring styling. We can push this off for V2, but in V3, this styling must live in the plugin engine.
padding-bottom: 20px; | ||
} | ||
|
||
.content_item_button-text { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not required for this PR, but noteworthy for the future: BEM would suggest you name dependent elements as such: content-item-button__text
Note the hyphens instead of underscores for multi-word element names, and the double-underscore for signifying a dependent element
Gemfile
Outdated
gem 'acts-as-taggable-on', '~> 4.0' | ||
gem 'bcrypt', '~> 3.1.11' | ||
gem 'grape-kaminari', git: 'https://github.com/toastercup/grape-kaminari.git', branch: 'set-only-pagination-headers' | ||
gem 'grape-kaminari', git: 'https://github.com/toastercup/grape-kaminari.git', branch: 'master' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll want to switch grape-kaminari
's branch back before a merge
window.setModals() | ||
} | ||
|
||
$(".popup--open").on("click", function(ev){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm okay with the SASS living in Cortex, but this I feel should definitely live in the engine. Additionally, popup--open
should be renamed to be specific to the featured
button. Since the button is generically rendered, how will you determine which popup needs to be opened? I believe it should be passed as a config option at the field level, /or/ use the name of the field, underscored
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also valid: you could just spit out the name of the field in a data
attribute on the popup button, then use that in this event callback to determine which popup to open. This is the simplest solution, I think. We could think harder about a better solution in V3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As of right now the actual modal code only allows for one popup to ever exist - I agree that we should be differentiating between potential popups, but it won't actually do anything
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are 3 modals hardcoded with 3 different IDs, with 3 convenience methods for invoking each - not sure I'm following. This story is meant to iron out the logic for triggering the correct popup, so I don't know what story this bit would live in if not this one
text-align: center; | ||
} | ||
|
||
.logo { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this used for? It seems like an overly ambiguous name to be used in the global namespace
} | ||
} | ||
|
||
.text-center { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're wanting to use re-usable classes such as these, make them mixins and include them in the semantic class that needs them
} | ||
|
||
.content_item_button-text { | ||
font-size: 12px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this could be pulled from a variable that's already defined, but do we need to specify a different font size here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the font sizes deviated a bit from the brand doc after Susan reviewed, so I'd make whatever directive you need if there's nothing that matches and add it to typography.scss with a comment to document how it's being used. Then we can look back at typography.scss and use it to update the brand doc. Start by trying to pick the closest thing from the brand doc though
} | ||
|
||
.button_content { | ||
padding-top: 30px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd recommend doin' some maths on the padding/margin sizing variables to derive the padding here
margin-bottom: 10px; | ||
width: 100%; | ||
background-color: white; | ||
color: #747D8E; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The colors contained in this class might also be defined in variables. I'm nitpicking here not because I care dearly for the styling/html/etc in V2, but because it could make our job easier when we have to port these overridden Material Design styles to the new React base - and also because @arelia spent some time recently to define these variables
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what you need is some $color-anchor-blue-light
I also made a $color-white: white
but i think that's kind of silly
color: #747D8E; | ||
|
||
&:active { | ||
background-color: #DDD; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$color-grey-lightest
} | ||
|
||
.logo { | ||
font-size: 56px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe use the largest font style?
%display-text { // Cortex Logo
color: $color-grey-dark;
font-family: $cortex-font-stack;
font-weight: normal;
font-size: 2.1775rem;
}
} | ||
|
||
.content_item_button { | ||
border: 1px solid #BBB; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$color-grey
, also as you're adding color variables, update the comments next to the colors in colors.scss, at least for the greys. we have 5 shades of grey so far and I want to keep track of why
56f4ed4
to
3e4e7d4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still needed to go through a last round of reviews, rather than a rush for verification
|
||
GIT | ||
remote: https://github.com/cortex-cms/cortex-plugins-core.git | ||
revision: 889b620a1260f9b4412293812017c1f07e69f7cc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ElliottAYoung this is still pointing to a branch
window.setModals() | ||
} | ||
|
||
$(".popup--open").on("click", function(ev){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are 3 modals hardcoded with 3 different IDs, with 3 convenience methods for invoking each - not sure I'm following. This story is meant to iron out the logic for triggering the correct popup, so I don't know what story this bit would live in if not this one
"name": "Add Featured Image", | ||
"description": "Add an image to feature with this Blog Post.", | ||
"columns": [ | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this say (optional heading)
?
@toastercup @arelia @MKwenhua
Uses the changes from cortex-cms/cortex-plugins-core#22 to add the open popup button to the form. Tested locally and works when the core gem is even with Cortex