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

Notification: split the WebComponent in, at least, two (latest/stable and external) #201

Open
humitos opened this issue Nov 22, 2023 · 2 comments
Labels
Needed: design decision A core team decision is required

Comments

@humitos
Copy link
Member

humitos commented Nov 22, 2023

It seems better to split the NotificationAddon in two (or three) different addons: NonLatestVersionWarning, NonStableVersionWarning and ExternalVersionWarning (or simlar names).

There are different reasons to do this. The main reason to me (among code isolation per addon), is the ability to enable and disable each of them based on data validation. Currently, if there is only one field missing, all the notifications are disabled but maybe that field is only used for the "latest version warning".

I think all those addons should share some of the logic by extending the Notification class but they should be different addons. I'm not sure if they should be different WebComponent as well or not (e.g. readthedocs-notification-latest-version-warning or just readthedocs-notification but with different initial setup)

@zanderle
Copy link
Collaborator

zanderle commented Apr 8, 2024

Couldn't this be controlled with simple attributes of the Notification web component?

@humitos
Copy link
Member Author

humitos commented Apr 8, 2024

Yes. I understand this is how it currently works, right? We have all the logic mixed into the same class and depending on some values we decide what path to follow. IMO, this is more confusing than helpful.

I think we could share the common login between these addons in a NotificationBase class or similar and implement only the different chunk of login in the addon specific class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needed: design decision A core team decision is required
Projects
Status: Planned
Development

No branches or pull requests

2 participants