diff --git a/apps/web/src/app/workspaces/workspaces.component.html b/apps/web/src/app/workspaces/workspaces.component.html index 9920bc6debdfd5dbd16337bdfa204dfcf4f2ad2c..89d6a4e75e9162e8d42f395a38f3aeaef2ff5e22 100644 --- a/apps/web/src/app/workspaces/workspaces.component.html +++ b/apps/web/src/app/workspaces/workspaces.component.html @@ -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> diff --git a/apps/web/src/app/workspaces/workspaces.component.ts b/apps/web/src/app/workspaces/workspaces.component.ts index f6433f39957660dccaa4b22660a7194c25e61146..945c7cb2b79a78aa67ddc5682b28f9a007e93517 100644 --- a/apps/web/src/app/workspaces/workspaces.component.ts +++ b/apps/web/src/app/workspaces/workspaces.component.ts @@ -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