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

Perform a test through the URL directly #334

Merged
11 commits merged into from Aug 19, 2022
Merged

Perform a test through the URL directly #334

11 commits merged into from Aug 19, 2022

Conversation

ghost
Copy link

@ghost ghost commented Jul 19, 2022

Purpose

It has been discussed to be able to easily pass a domain to test to Zonemaster GUI, without interacting with the form. The idea is to pass the domain name in the URL /check/<domain>.
The form's input field will be populated with this domain name and the form will be sent.

No option are currently passed. Only the domain. As I see it, we could extend this work to include options as GET parameters.

Context

Addresses #200 and follow-up on #335

Changes

  • New route /check/<domain>
  • Redirect /domain_check to /check
  • Redirect /test/<test-id> to /result/<test-id>

How to test this PR

  • access /check/<domain> and make sure the test is started for <domain>
  • once on the result page, go back to the previous page, the form should be sent again and the results page should be loaded
  • e2e tests have been added to test both redirections

@ghost ghost added the T-Feature Type: New feature in software or test case description label Jul 19, 2022
@ghost ghost added this to the v2022.2 milestone Jul 19, 2022
@ghost ghost requested review from mattias-p, matsduf and hannaeko July 19, 2022 10:00
@matsduf

This comment was marked as resolved.

@matsduf
Copy link
Contributor

matsduf commented Jul 19, 2022

I also want to come back to comment in the issue (#200 (comment)): "This is a good idea. The first step is the design and specification of the URL schema. It should be documented as an API to make sure that we do not change anything without an explicit decision."

@ghost
Copy link
Author

ghost commented Jul 19, 2022

Would it be relevant to be able to include the language setting?

I don't think it is. Since the language is only used to display the results, it does not impact how a test is run.

The first step is the design and specification of the URL schema.

This PR proposes a simple design for the URL schema that can be easily extended. Is this good enough to document this feature?

@matsduf

This comment was marked as resolved.

@ghost ghost requested review from marc-vanderwal and tgreenx July 21, 2022 09:37
docs/API.md Outdated Show resolved Hide resolved
@matsduf

This comment was marked as resolved.

@ghost ghost mentioned this pull request Jul 25, 2022
@ghost
Copy link
Author

ghost commented Jul 25, 2022

We have already had a request from a main user on being able to include language setting in the call.

Could you point to this request? I can't find it.

In the code it looks like history is also a path used by the GUI. Could you explain?

Nope. It's been here since the beginning. Maybe there was an idea to make it possible to easily access a test history at that time already. Maybe something else. Who knows...

@ghost
Copy link
Author

ghost commented Jul 25, 2022

I've rebased and applied the suggestions from #335.

@matsduf
Copy link
Contributor

matsduf commented Jul 25, 2022

We have already had a request from a main user on being able to include language setting in the call.

Could you point to this request? I can't find it.

I will try to find it. It was probably in a mail directly to me.

In the code it looks like history is also a path used by the GUI. Could you explain?

Nope. It's been here since the beginning. Maybe there was an idea to make it possible to easily access a test history at that time already. Maybe something else. Who knows...

OK. Thanks. It then seems like https://github.com/zonemaster/zonemaster-gui/blob/master/src/app/app.module.ts#L54 could be removed without any side effects. And I think it should.

@matsduf
Copy link
Contributor

matsduf commented Jul 25, 2022

I've rebased and applied the suggestions from #335.

Do you think I should merge now or should we wait for more reviewers?

Alexandre Pion added 4 commits July 25, 2022 11:49
matsduf
matsduf previously approved these changes Jul 25, 2022
Copy link
Contributor

@matsduf matsduf left a comment

Choose a reason for hiding this comment

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

This looks fine. Tested, and all works as it should. I have only tested with a default base path, not with a custom path.

#335 should be merged first.

Copy link
Member

@hannaeko hannaeko left a comment

Choose a reason for hiding this comment

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

Nice feature (also thank you for removing the underscore in the url), I still have a couple of comments

src/app/components/form/form.component.ts Outdated Show resolved Hide resolved
src/app/components/form/form.component.ts Outdated Show resolved Hide resolved
Comment on lines 74 to 75
this.domainName = params['domain'];
this.form.controls.domain.setValue(this.domainName);
Copy link
Member

@hannaeko hannaeko Jul 28, 2022

Choose a reason for hiding this comment

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

Is the domainName property used anywhere else? If not would it make sense to remove it?

Copy link
Member

@hannaeko hannaeko left a comment

Choose a reason for hiding this comment

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

looks good to me

Copy link
Contributor

@matsduf matsduf left a comment

Choose a reason for hiding this comment

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

#335 has been merged and as far as I can see this could be merged.

@ghost ghost merged commit 544d439 into zonemaster:develop Aug 19, 2022
@tgreenx tgreenx added the S-ReleaseTested Status: The PR has been successfully tested in release testing label Dec 7, 2022
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-ReleaseTested Status: The PR has been successfully tested in release testing T-Feature Type: New feature in software or test case description
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants