Skip to content
Snippets Groups Projects
Commit b5704e36 authored by Daniel Lyons's avatar Daniel Lyons
Browse files

Prefill the form with a product locator (for testing)

parent c75aee83
No related branches found
No related tags found
1 merge request!119Prefill the form with a product locator
Pipeline #830 waiting for manual action
......@@ -20,16 +20,14 @@ export class CapabilityLauncherService {
*/
createRequest(
capabilityName: string,
parameters: string
parameters: any
): Observable<CapabilityRequest> {
const url =
environment.workspacesUrl +
this.endpoint +
capabilityName +
'/request/create';
const requestParams = JSON.stringify({
parameters,
});
const requestParams = JSON.stringify({'parameters': parameters});
return this.httpClient.post<CapabilityRequest>(url, requestParams);
}
......
......@@ -10,7 +10,7 @@
<div class="md-form">
<label for="splInput" class="">Science Product</label>
<input type="text" id="splInput" [value]="splInput" (change)="setSPLInput($event.target.value)" class="form-control">
<input type="text" id="splInput" [value]="productLocator" (change)="setProductLocator($event.target.value)" class="form-control" placeholder="e.g. uid://evla/execblock/27561b56-4c6a-4614-bc26-67e436b5e92c">
</div>
<br/>
......
......@@ -13,11 +13,12 @@ export class WorkspacesComponent implements OnInit {
public capabilityRequests: Array<CapabilityRequest> = [];
public capabilityExecutions: Array<CapabilityExecution> = [];
public splInput: string;
public productLocator: string;
public userEmail: string;
constructor(private capabilityLauncher: CapabilityLauncherService) {
this.splInput = null;
// this is the famous 394 MB 13B-014 execblock, a useful smallish test
this.productLocator = "uid://evla/execblock/27561b56-4c6a-4614-bc26-67e436b5e92c";
this.userEmail = null;
}
......@@ -36,8 +37,7 @@ export class WorkspacesComponent implements OnInit {
downloadButtonOnClick(): void {
this.launchCapability(
'test_download',
this.splInput,
this.userEmail
{'product_locator': this.productLocator, 'user_email': this.userEmail}
);
}
......@@ -45,8 +45,8 @@ export class WorkspacesComponent implements OnInit {
* method that sets the user input Science Product Locator for the download capability
* @param spl the Science Product Locator to download
*/
setSPLInput(spl: string){
this.splInput = spl;
setProductLocator(spl: string){
this.productLocator = spl;
}
/**
......@@ -63,7 +63,7 @@ export class WorkspacesComponent implements OnInit {
* @param parameters Parameters of capability request
* @param email User email for notifications (Optional)
*/
launchCapability(capabilityName: string, parameters: string, email?: string): void {
launchCapability(capabilityName: string, parameters: any): void {
// Create capability request
this.capabilityLauncher.createRequest(capabilityName, parameters).subscribe(
(requestResponse) => {
......
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