Skip to content
Snippets Groups Projects
Commit 7e4293d2 authored by Nathan Bockisch's avatar Nathan Bockisch
Browse files

WS-292: Added potential fix mixed content error when retrieving qa_notes.html

parent 10fc3b1f
No related branches found
No related tags found
1 merge request!837WS-292: Added potential fix mixed content error when retrieving qa_notes.html
Pipeline #4589 passed
......@@ -45,6 +45,7 @@ export class CapabilityRequestComponent implements OnInit, OnDestroy {
public latestVersion: CapabilityVersion;
public qaNotes: string;
private ngUnsubscribe = new Subject(); // to signal when all subscribers should unsubscribe (triggered in tear down)
// Observer for capability request objects
......@@ -100,7 +101,7 @@ export class CapabilityRequestComponent implements OnInit, OnDestroy {
var curCapabilityRequestId = this.currentVersion.current_execution.current_workflow_request_id;
this.qaNotes = await new Promise<string>(resolve =>
this.workflowService.retrieveQaNotes(curCapabilityName, curCapabilityRequestId)
.subscribe(notes => resolve(notes)));
.subscribe(notes => resolve(notes['resp'])));
}
// Observer for capability version objects
......
......@@ -31,13 +31,11 @@ export class WorkflowService {
// Retrieve the contents of qa_notes.html for a given job
retrieveQaNotes(workflowName: string, requestID: string): Observable<string> {
const url = this.endpoint + workflowName + "/requests/" + requestID + "/qa_notes";
return this.httpClient.get(url, {responseType: 'text'});
return this.httpClient.get<any>(url);
}
saveQaNotes(workflowName: string, requestID: string, edits: string): Observable<string> {
const url = this.endpoint + workflowName + "/requests/" + requestID + "/qa_notes";
if (!edits)
return null;
return this.httpClient.post<any>(url, JSON.stringify({"edits":edits}));
}
}
......@@ -188,8 +188,13 @@ class WorkflowWorkingDirRestService:
if d.startswith("pipeline-"):
paths.append(os.path.join(root, d))
redirect_url = self.generate_qa_notes_path(paths[0], results_path)
return Response(status_int=http.HTTPStatus.FOUND, location=redirect_url)
qa_notes_path = paths[0] + "/html/qa_notes.html"
qa_notes_text = ""
with open(qa_notes_path, 'r') as qa_notes:
qa_notes_text = qa_notes.read()
return Response(status_int=http.HTTPStatus.OK, json_body={"resp":f"{qa_notes_text}"})
@view_config(request_method="POST", route_name="get_qa_notes", renderer="json")
def save_qa_notes(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment