Commit 0f2a22e7 authored by Simon Knox's avatar Simon Knox

Merge branch 'fix-dast-site-validation' into 'master'

Realign DAST site validation frontend with backend

See merge request gitlab-org/gitlab!46475
parents e5c1f23e cab75d57
...@@ -214,9 +214,7 @@ export default { ...@@ -214,9 +214,7 @@ export default {
try { try {
const { const {
data: { data: {
project: { project: { dastSiteValidation },
dastSiteValidation: { status },
},
}, },
} = await this.$apollo.query({ } = await this.$apollo.query({
query: dastSiteValidationQuery, query: dastSiteValidationQuery,
...@@ -226,7 +224,7 @@ export default { ...@@ -226,7 +224,7 @@ export default {
}, },
fetchPolicy: fetchPolicies.NETWORK_ONLY, fetchPolicy: fetchPolicies.NETWORK_ONLY,
}); });
this.validationStatus = status; this.validationStatus = dastSiteValidation?.status || null;
if (this.validationStatusMatches(INPROGRESS)) { if (this.validationStatusMatches(INPROGRESS)) {
await new Promise(resolve => { await new Promise(resolve => {
...@@ -254,7 +252,7 @@ export default { ...@@ -254,7 +252,7 @@ export default {
} = await this.$apollo.mutate({ } = await this.$apollo.mutate({
mutation: dastSiteTokenCreateMutation, mutation: dastSiteTokenCreateMutation,
variables: { variables: {
projectFullPath: this.fullPath, fullPath: this.fullPath,
targetUrl: this.form.fields.targetUrl.value, targetUrl: this.form.fields.targetUrl.value,
}, },
}); });
......
mutation dastSiteTokenCreate($projectFullPath: ID!, $targetUrl: String!) { mutation dastSiteTokenCreate($fullPath: ID!, $targetUrl: String!) {
dastSiteTokenCreate(input: { projectFullPath: $projectFullPath, targetUrl: $targetUrl }) { dastSiteTokenCreate(input: { fullPath: $fullPath, targetUrl: $targetUrl }) {
id id
token token
errors errors
......
...@@ -237,7 +237,7 @@ describe('DastSiteProfileForm', () => { ...@@ -237,7 +237,7 @@ describe('DastSiteProfileForm', () => {
await waitForPromises(); await waitForPromises();
expect(requestHandlers.dastSiteTokenCreate).toHaveBeenCalledWith({ expect(requestHandlers.dastSiteTokenCreate).toHaveBeenCalledWith({
projectFullPath: fullPath, fullPath,
targetUrl, targetUrl,
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment