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

Rapid exp title changes dependent on new or edit fixes #2901 #2994

Merged
merged 4 commits into from
Jul 8, 2020

Conversation

tiftran
Copy link
Contributor

@tiftran tiftran commented Jul 7, 2020

Screen Shot 2020-07-07 at 1 48 37 PM

Not entirely sure if it's desirable but when changing the public name, the title will change to match it....

@tiftran tiftran requested review from jaredlockhart and pdehaan July 7, 2020 20:48
Copy link
Collaborator

@jaredlockhart jaredlockhart left a comment

Choose a reason for hiding this comment

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

Awesome, updating the url in real time is super neat, this is where using react really starts to shine >:D

See if you can use the experiment data instead of the url.

I like the behaviour of the default header for the create page vs the name on the edit page. If you can use the experiment data itself, we might get that fancy real time updating behaviour on both pages which would be neat.

Good job!

const ExperimentFormPage: React.FC = () => {
const { location } = useHistory();
let pageHeading = "Create a New A/A Experiment";
if (location.pathname.includes("edit")) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can't we look at the experiment data to see if it has a name instead of looking at the url?

Copy link
Contributor Author

@tiftran tiftran Jul 7, 2020

Choose a reason for hiding this comment

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

so... i took a stab at only using experiment data. Since the name data value changes when a user changes the name in the text field, I couldn't think of a way how would that indicate whether the experiment was new, or an edit. I decided on using the presence of a slug in the experiment data instead?

}

return (
<div className="mb-4">
Copy link
Contributor

Choose a reason for hiding this comment

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

Below this was wrapped in a <div className="col pt-3"> (see deleted L9 in app/experimenter/static/rapid/components/pages/ExperimentFormPage.tsx).
Not sure if that is still needed, but 🤷 .

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I intially had it, but it gave me a weird indent 🤷‍♀️. Not exactly the best with front end stuff 😅

@tiftran tiftran requested a review from jaredlockhart July 7, 2020 23:56
Copy link
Collaborator

@jaredlockhart jaredlockhart left a comment

Choose a reason for hiding this comment

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

Ah yes using slug is exactly correct, good thinking 👍

@tiftran tiftran merged commit 6a1c22a into mozilla:main Jul 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants