Skip to content
This repository was archived by the owner on Aug 7, 2020. It is now read-only.

Conversation

AxelPeter
Copy link
Contributor

@AxelPeter AxelPeter commented Sep 7, 2018

http://angular_feature_closable_message.ui-kit.ovh/#!/oui-angular/message

  • Add an attribute to force the dismissable state


$onInit () {
// Guidelines default value for dismissable attribute
addDefaultParameter(this, "dismissable", this.type === "info" || this.type === "success");
Copy link
Contributor

Choose a reason for hiding this comment

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

Could have an array of types that are dissimisable by default

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What's your proposition ?

Copy link
Contributor

Choose a reason for hiding this comment

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

message.constants.js

angular
	.module("moduleName")
	.constant("MESSAGE_CONSTANTS", () => {
		TYPES: {
			info: {
				dismissableByDefault: true
			},
			...
		}
})

message.controller.js

addDefaultParameter(this, "dismissable", this.MESSAGE_CONSTANTS.TYPES[this.type].isDismissableByDefault

The constants could contain more data about types and would make it easier to add new types, if the need ever rise.

I would understand if you considered it over-engineering 😄

@AxelPeter AxelPeter merged commit 3450292 into develop Sep 7, 2018
@AxelPeter AxelPeter deleted the feature/closable-message branch September 7, 2018 14:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Development

Successfully merging this pull request may close these issues.

4 participants