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

Hybridize alert. #13

Merged
merged 8 commits into from
Nov 23, 2017
Merged

Hybridize alert. #13

merged 8 commits into from
Nov 23, 2017

Conversation

dbatiste
Copy link
Contributor

No description provided.

@@ -133,21 +158,19 @@
<div class="message-highlight"></div>
<slot></slot>
</div>
<button is="d2l-button" on-tap="_dispatchButtonPressedEvent" hidden$="[[!hasButton]]">
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Turns out we weren't relying on d2l-button for anything, so there wasn't any need to switch to d2l-button hybrid. In fact, doing so makes things difficult since it would require lots of style overrides.

@@ -92,6 +111,7 @@
padding: 1.15em 1.43em;
border-left: none;
font: inherit;
margin: 0;
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 needed just for Safari.

@@ -1,66 +1,100 @@
# d2l-alert
[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/BrightspaceUI/alert)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will still need to get this component registered.

type: {
type: String,
value: 'call-to-action',
reflectToAttribute: true
},
hasButton: {
_hasButton: {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Made this computed property private (ala "_" prefix), since it's not really part of the public API, and we don't really want it showing as such in the generated docs.

.editorconfig Outdated
@@ -8,6 +8,6 @@ insert_final_newline = true
indent_style = tab
indent_size = 4

[{*.json,*.yml}]
[{package.json,bower.json,.travis.yml,.eslintrc}]
Copy link
Member

Choose a reason for hiding this comment

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

Any reason for changing from the .json extension to no extension? I've been switching things to be the opposite lately as I think it's more standard.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Haha - I was trying to follow new convention... since I think someone recently recommended I should omit the extension. Looks like text-input omits it too.

Copy link
Member

Choose a reason for hiding this comment

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

Ha so I wouldn't trust text-input totally. Their docs seem to like having the extension.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok cool.

README.md Outdated
A [Polymer](https://www.polymer-project.org/1.0/)-based web component for alerts.
[Polymer](https://www.polymer-project.org)-based web component for D2L alerts.

![screenshot of text input component](/alert.gif?raw=true)
Copy link
Member

Choose a reason for hiding this comment

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

Alt text is wrong

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. I will correct. Copy & paste. ;)

@dbatiste
Copy link
Contributor Author

I am also playing around with inline demo. I am gonna try and add it to see how it looks.

hasCloseButton: {
type: Boolean,
value: false
}
},

/**
* Closes/hides the alert.
*/
Copy link
Member

Choose a reason for hiding this comment

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

I think ideally we'd want this to be a closed attribute, but that's a major breaking change so we can defer for now.

package.json Outdated
"eslint": "^3.14.0",
"eslint-config-brightspace": "^0.2.4",
"eslint-plugin-html": "^1.7.0",
"polymer-cli": "^0.16.0"
"polymer-cli": "^1.2.0"
Copy link
Member

Choose a reason for hiding this comment

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

You can likely go higher on the CLI version... I think it's up to 1.5 or higher now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok cool - I will update.

@dbatiste
Copy link
Contributor Author

Got Inline Demo working. It's just a preview. I seemed to get a lot of errors initially - I think they do some processing on first request, and it takes some time for it. Had to keep refreshing the page, but once loaded it seemed to work fine. Anyway, assuming it loads, you can update the code, for example by changing the type, button-text, or has-close-button, and it will do a live update.

The Polymer folks seem to place these at the top of the readme files, but we could put it anywhere in the readme.

@dbatiste dbatiste merged commit 914782d into master Nov 23, 2017
@dbatiste dbatiste deleted the dbatiste/hybridize branch November 23, 2017 16:01
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.

None yet

2 participants