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

feat: add message banner API hooks #5078

Merged
merged 2 commits into from
Oct 18, 2023
Merged

feat: add message banner API hooks #5078

merged 2 commits into from
Oct 18, 2023

Conversation

nunogois
Copy link
Member

https://linear.app/unleash/issue/2-1510/create-message-banner-hooks-that-connect-to-the-new-api-endpoints

Adds new message banner API hooks that will allow us to do CRUD operations for message banners in the UI.

@vercel
Copy link

vercel bot commented Oct 18, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 18, 2023 4:52pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview Oct 18, 2023 4:52pm

Base automatically changed from refactor-move-message-banner-interface to main October 18, 2023 09:32
Copy link
Contributor

@gastonfournier gastonfournier left a comment

Choose a reason for hiding this comment

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

LGTM, I feel some changes are also in another PR you just missed rebasing master, but that's fine

import { IInternalMessageBanner } from 'interfaces/messageBanner';
import useAPI from '../useApi/useApi';

const ENDPOINT = 'api/admin/message-banners';
Copy link
Contributor

Choose a reason for hiding this comment

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

Just wondering, should we just call them "banners" instead of "message-banners"? I feel we might regret in the future for not giving it a more general name

Copy link
Member Author

Choose a reason for hiding this comment

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

I see "banner" as the type of component itself. Right now we have:

  • DraftBanner (CR)
  • MaintenanceBanner
  • DemoBanner

So I think MessageBanner (or in this case, message-banners) is a good representation of what it does. Do you think it's worth making this rename now?

Copy link
Contributor

Choose a reason for hiding this comment

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

Well, you know more than I do, so I trust your judgment. It was just an observation because message-banner seems weird... a banner is by definition a message you want to deliver... the fact that it's a "message banner" type is an implementation detail IMO. But again, take it for what it is: opinions without a lot of context :D

import { useUiFlag } from 'hooks/useUiFlag';
import { IInternalMessageBanner } from 'interfaces/messageBanner';

const ENDPOINT = 'api/admin/message-banners';
Copy link
Contributor

Choose a reason for hiding this comment

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

This is re-defined here, I believe you can just export this const in the API definition

@nunogois nunogois merged commit 5456d1d into main Oct 18, 2023
14 checks passed
@nunogois nunogois deleted the feat-message-banner-hooks branch October 18, 2023 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants