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

Budi 9006 allow automation test data modal to select real data to #15425

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

samwho
Copy link
Collaborator

@samwho samwho commented Jan 22, 2025

Description

Describe the problem or feature in addition to a link to the relevant github issues.

Addresses

  • <Enter the Link to the issue(s) this PR addresses>
  • ...more if required

App Export

  • If possible, attach an app export file along with your request template to make QA testing easier, with minimal setup.

Screenshots

If a UI facing feature, a short video of the happy path, and some screenshots of the new functionality.

Launchcontrol

Add a small description in layman's terms of what this PR achieves. This will be used in the release notes.

Copy link

qa-wolf bot commented Jan 22, 2025

QA Wolf here! As you write new code it's important that your test coverage is keeping up.
Click here to request test coverage for this PR!

Copy link

linear bot commented Jan 22, 2025

@github-actions github-actions bot added firestorm Data/Infra/Revenue Team size/l labels Jan 22, 2025
Copy link
Member

@aptkingston aptkingston left a comment

Choose a reason for hiding this comment

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

I'll let Dean comment on the files that contain automation-specific logic (TestDataModal and AutomationBlockSetup) as my knowledge of those isn't great, but all the BBUI and other builder changes look good to me.

const onChange = event => {
dispatch("change", event.target.checked)
const onChange: ChangeEventHandler<HTMLInputElement> = event => {
dispatch("change", event.currentTarget.checked)
Copy link
Member

Choose a reason for hiding this comment

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

currentTarget can differ from target depending on how listeners are set up and if the event is bubbling. In this case they should be the same as the element that triggers the event (target) is the same as the element which the event listener is attached to (currentTarget), as they should both be the input element. But just something to keep in mind in future as this could be a breaking change if we were manually adding the listener at a higher level (like on the full document).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

.target doesn't exist on the event type, which is the only reason I changed it.

Copy link
Member

Choose a reason for hiding this comment

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

This is sort of what I was alluding to in my comment below about the event types being difficult to work with - target 100% does exist in the real event, so I'm not sure why it doesn't in the type.

export let disabled = false
export let readonly = false
export let size
export let size: string = "M"
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 probably take this further and type this as "S" | "M" | "L". Not sure if XS and XL are valid options here but they might be as well - would need to check the CSS file imported at the top here.

dispatch("change", event.target.value)
const onChange = (event: FocusEvent) => {
const target: HTMLTextAreaElement | null =
event.target as HTMLTextAreaElement
Copy link
Member

Choose a reason for hiding this comment

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

I've found the typing around events to be pretty awful to work with. Target is not actually nullable - it will always exist, so I usually just forcefully cast this to be an element type.

): ((...params: Parameters<T>) => Promise<R>) => {
let queue: (() => Promise<void>)[] = []
return (...params: Parameters<T>): Promise<R> => {
return new Promise<R>((resolve, reject) => {
Copy link
Member

Choose a reason for hiding this comment

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

I'm sure this was fun to type 😂 Nice one.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was readily admit that I got help from ChatGPT 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
firestorm Data/Infra/Revenue Team size/l
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants