Skip to content

Conversation

ElliottAYoung
Copy link
Contributor

@ElliottAYoung ElliottAYoung commented Dec 14, 2016

@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

screen shot 2016-12-14 at 3 21 26 pm

@toastercup
Copy link
Member

@ElliottAYoung Reminder to follow PR naming conventions + attach labels + assign milestone

@ElliottAYoung ElliottAYoung changed the title Topic/cor 526 featured image button COR-526: featured image button Dec 14, 2016
@ElliottAYoung
Copy link
Contributor Author

@toastercup - shoot I thought I got this one, never hit save

@ElliottAYoung ElliottAYoung self-assigned this Dec 14, 2016
@ElliottAYoung ElliottAYoung added this to the Custom Content milestone Dec 14, 2016
@toastercup toastercup changed the title COR-526: featured image button COR-526: Featured Image Button Dec 14, 2016
]
},
{
"name": "Add Featured Image",
Copy link
Member

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 {
Copy link
Member

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 {
Copy link
Member

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'
Copy link
Member

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){
Copy link
Member

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

Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Member

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 {
Copy link
Member

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 {
Copy link
Member

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;
Copy link
Member

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?

Copy link
Contributor

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;
Copy link
Member

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;
Copy link
Member

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

Copy link
Contributor

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;
Copy link
Contributor

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;
Copy link
Contributor

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;
Copy link
Contributor

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

@ElliottAYoung ElliottAYoung force-pushed the topic/COR-526-Featured-Image-Button branch from 56f4ed4 to 3e4e7d4 Compare December 15, 2016 15:33
@ElliottAYoung ElliottAYoung merged commit 61dcae6 into develop Dec 15, 2016
@ElliottAYoung ElliottAYoung deleted the topic/COR-526-Featured-Image-Button branch December 15, 2016 20:02
Copy link
Member

@toastercup toastercup left a 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
Copy link
Member

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){
Copy link
Member

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": [
{
Copy link
Member

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)?

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

Successfully merging this pull request may close these issues.

3 participants