Skip to content
Snippets Groups Projects
Commit 490f86ab authored by Charlotte Hausman's avatar Charlotte Hausman
Browse files

WS-549: UI for restore capabilities

parent b62a522f
No related branches found
No related tags found
1 merge request!351WS-549: UI for restore capabilities
Pipeline #2211 passed
......@@ -128,3 +128,62 @@
</div>
</div>
</div>
<div class="container border rounded py-3 my-3">
<h4>Standard Restore or Restore & Image</h4>
<div class="row p-3 mt-4">
<div class="col-4">
<div class="md-form">
<label for="splInput" class="">Science Product</label>
<input
type="text"
id="splInput"
(change)="setProductLocator($event.target.value)"
class="form-control"
/>
</div>
</div>
<div class="col-3">
<div class="md-form">
<label for="calSplInput" class="">Calibration Science Product</label>
<input
type="text"
id="calSplInput"
(change)="setCalProductLocator($event.target.value)"
class="form-control"
/>
</div>
</div>
<div class="col-3">
<div class="md-form">
<label for="userEmail" class="">Email Address</label>
<input
type="text"
id="userEmail"
[value]="userEmail"
(change)="setUserEmail($event.target.value)"
class="form-control"
/>
</div>
</div>
</div>
<div id="restore-button-container" class="d-flex justify-content-left py-2">
<div class="d-flex px-2">
<button
class="btn btn-lg btn-success"
id="restore-submit"
(click)="LaunchRestoreCapabilityOnClick('restore_cms')"
>
Launch standard restore
</button>
</div>
<div class="d-flex px-2">
<button
class="btn btn-lg btn-dark"
id="restore-imaging-submit"
(click)="LaunchRestoreCapabilityOnClick('std_restore_imaging')"
>
Launch standard restore imaging
</button>
</div>
</div>
</div>
......@@ -13,6 +13,7 @@ import { CapabilityRequestService } from "./services/capability-request.service"
})
export class WorkspacesComponent implements OnInit {
public productLocator: string;
public calProductLocator: string;
public userEmail: string;
public inputFileList: FileList;
public cmsPath: string;
......@@ -43,7 +44,9 @@ export class WorkspacesComponent implements OnInit {
* FIXME: Remove check for calibration once it is implemented
*/
standardLaunchCapabilityOnClick(capabilityName: string): void {
if (capabilityName == "std_cms_imaging") { this.productLocator = undefined; }
if (capabilityName === "std_cms_imaging") {
this.productLocator = undefined;
}
this.launchCapability(capabilityName, {
product_locator: this.productLocator,
user_email: this.userEmail,
......@@ -64,6 +67,20 @@ export class WorkspacesComponent implements OnInit {
});
}
/**
* OnClick method that creates a capability request for a restore capability and submits it with the restore parameters:
* - EB Product Locator
* - Calibration Product Locator
* - User email
*/
LaunchRestoreCapabilityOnClick(capabilityName: string): void {
this.launchCapability(capabilityName, {
product_locator: this.productLocator,
cal_locator: this.calProductLocator,
user_email: this.userEmail,
});
}
/**
* method that sets the user input Science Product Locator for the download capability
* @param spl the Science Product Locator to download
......@@ -72,6 +89,14 @@ export class WorkspacesComponent implements OnInit {
this.productLocator = spl;
}
/**
* method that sets the user input Calibration Science Product Locator
* @param calSpl the calibration SPL to use
*/
setCalProductLocator(calSpl: string): void {
this.calProductLocator = calSpl;
}
/**
* method to set the user email for notifications
* @param email user specified email
......
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