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

Rares/webhook UI changes #2419

Merged
merged 23 commits into from
Jul 5, 2023
Merged

Rares/webhook UI changes #2419

merged 23 commits into from
Jul 5, 2023

Conversation

teodosii
Copy link
Member

@teodosii teodosii commented Jul 4, 2023

What this PR does

Which issue(s) this PR fixes

Checklist

  • Unit, integration, and e2e (if applicable) tests updated
  • Documentation added (or pr:no public docs PR label added if not required)
  • CHANGELOG.md updated (or pr:no changelog PR label added if not required)

@teodosii teodosii requested a review from a team July 4, 2023 07:59
Copy link
Contributor

@joeyorlando joeyorlando left a comment

Choose a reason for hiding this comment

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

wdyt about adding some basic e2e tests for the new webhooks? ex. ability to CRUD them + webhook is called when when we would expect (for this one you'd have to run ngrok or localtunnel to port forward a public URL to a server running on the tests; I can help out with this if you're interested)

@teodosii teodosii added the pr:no public docs Added to a PR that does not require public documentation updates label Jul 4, 2023
!outgoingWebhook2Store.items[id]
) {
return null;
}

const data =
id === 'new'
Copy link
Contributor

Choose a reason for hiding this comment

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

it's confusing a bit, what the difference between action === WebhookFormActionType.NEW and id === 'new'

Copy link
Member Author

Choose a reason for hiding this comment

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

Agree, I'll refactor it

(action === WebhookFormActionType.EDIT_SETTINGS || action === WebhookFormActionType.VIEW_LAST_RUN) &&
!outgoingWebhook2Store.items[id]
) {
// nothing to show if we open invalid ID for edit/last_run
Copy link
Contributor

Choose a reason for hiding this comment

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

can it be unloaded in store yet at the moment this code is running?

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'm not sure what you mean by this. This is when you're hitting an ID that was previously deleted or it just doesn't exist. There's no such object in the store.

Copy link
Contributor

Choose a reason for hiding this comment

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

as I understand we don't show anything if there is no such item in the store, but in this case we need to force load it within this component

}

if (action === WebhookFormActionType.NEW || action === WebhookFormActionType.COPY) {
// show just the creation form, not the tabs
Copy link
Contributor

Choose a reason for hiding this comment

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

mabe just make LastRun tab disabled for those cases?

Copy link
Member Author

Choose a reason for hiding this comment

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

This follows the figma where on new/copy there's no tabs shown, plus the content is slightly different.

import { useStore } from 'state/useStore';
import { KeyValuePair } from 'utils';
Copy link
Contributor

Choose a reason for hiding this comment

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

what the pros of using this data structure?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's a key-value structure for when you need to keep groups of key/value pairs. It's used in other places as well.

{({ openMenu }) => (
<HamburgerMenu openMenu={openMenu} listBorder={ACTIONS_LIST_BORDER} listWidth={ACTIONS_LIST_WIDTH} />
)}
{({ openMenu }) => <HamburgerMenu openMenu={openMenu} listBorder={2} listWidth={200} />}
Copy link
Contributor

Choose a reason for hiding this comment

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

@teodosii
Copy link
Member Author

teodosii commented Jul 5, 2023

Will postpone adding the tests as I need to help Maxim add the template editor for webhooks.

@teodosii teodosii added this pull request to the merge queue Jul 5, 2023
Merged via the queue into dev with commit 7195646 Jul 5, 2023
@teodosii teodosii deleted the rares/webhook-ui-changes branch July 5, 2023 09:11
brojd pushed a commit that referenced this pull request Sep 18, 2024
# What this PR does

## Which issue(s) this PR fixes

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required)
- [ ] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:no public docs Added to a PR that does not require public documentation updates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants