From 4e43b9c869f562579b0bfe8c1b263dc0e00476d0 Mon Sep 17 00:00:00 2001 From: Daniel Nemergut <dnemergu@nrao.edu> Date: Tue, 24 Oct 2023 23:41:58 -0400 Subject: [PATCH] Added the ability to send a curator capability request on the home page --- .../workspaces/ws-home/ws-home.component.html | 68 ++++++++++++++++++ .../workspaces/ws-home/ws-home.component.ts | 69 +++++++++++++++++++ 2 files changed, 137 insertions(+) diff --git a/apps/web/src/app/workspaces/ws-home/ws-home.component.html b/apps/web/src/app/workspaces/ws-home/ws-home.component.html index 31f2c9ae4..e89939075 100644 --- a/apps/web/src/app/workspaces/ws-home/ws-home.component.html +++ b/apps/web/src/app/workspaces/ws-home/ws-home.component.html @@ -143,3 +143,71 @@ </div> </div> </div> +<div class="container border rounded py-3 my-3"> + <h4>Curator</h4> + <div class="row p-3 mt-4"> + <div class="col-6"> + <div class="md-form"> + <label for="curSplInput" class="">Science Product</label> + <input type="text" id="curSplInput" class="form-control" + (change)="setProductLocator($event.target.value)"/> + </div> + </div> + <div class="col-6"> + <div class="md-form"> + <label for="curDataInput" class="">Data Location (Optional)</label> + <input type="text" id="curDataInput" class="form-control" + (change)="setDataLocation($event.target.value)"/> + </div> + </div> + <div class="col-2"> + <div class="md-form"> + <label for="curTypeInput" class="">Product Type</label> + <input type="text" id="curTypeInput" class="form-control" + (change)="setProductType($event.target.value)"/> + </div> + </div> + <div class="col-2"> + <div class="md-form"> + <label for="curTelescopeInput" class="">Telescope</label> + <input type="text" id="curTelescopeInput" class="form-control" + (change)="setTelescope($event.target.value)"/> + </div> + </div> + <div class="col-2"> + <div class="md-form"> + <label for="curProjectInput" class="">Project Code</label> + <input type="text" id="curProjectInput" class="form-control" + (change)="setProjectCode($event.target.value)"/> + </div> + </div> + <div class="col-3"> + <div class="md-form"> + <label for="curTargetInput" class="">Target List (Optional)</label> + <input type="text" id="curTargetInput" class="form-control" + (change)="setTargetList($event.target.value)"/> + </div> + </div> + <div class="col-3"> + <div class="md-form"> + <label for="curUserEmail" class="">Email Address</label> + <input type="text" id="curUserEmail" class="form-control" + [value]="userEmail" (change)="setUserEmail($event.target.value)"/> + </div> + </div> + </div> + <div id="full-curator-button-container" class="d-flex justify-content-left py-2"> + <div class="d-flex px-2"> + <button type="button" class="btn btn-lg btn-primary" id="full-curator-submit" + (click)="LaunchCuratorCapabilityOnClick('full')"> + Launch full curation + </button> + </div> + <div id="partial-curator-button-container" class="d-flex px-2"> + <button type="button" class="btn btn-lg btn-info" id="partial-curator-submit" + (click)="LaunchCuratorCapabilityOnClick('partial')"> + Launch partial curation + </button> + </div> + </div> +</div> diff --git a/apps/web/src/app/workspaces/ws-home/ws-home.component.ts b/apps/web/src/app/workspaces/ws-home/ws-home.component.ts index 539dcd324..4f69d3c6f 100644 --- a/apps/web/src/app/workspaces/ws-home/ws-home.component.ts +++ b/apps/web/src/app/workspaces/ws-home/ws-home.component.ts @@ -34,6 +34,11 @@ export class WsHomeComponent implements OnInit { public inputFileList: FileList; public cmsPath: string; public sdmId: string; + public dataLocation: string; + public productType: string; + public telescope: string; + public projectCode: string; + public targetList: string; constructor( private capabilityLauncher: CapabilityLauncherService, @@ -117,6 +122,30 @@ export class WsHomeComponent implements OnInit { }); } + /** + * OnClick method that creates a capability request for a curator capability and submits it with the parameters: + * - Curator type (full or partial) + * - EB Product Locator + * - Data location path + * - Product type + * - Target list + * - Telescope + * - Project code + * - User email + */ + LaunchCuratorCapabilityOnClick(curatorType: string): void { + this.launchCapability('curator', { + curator_type: curatorType, + product_locator: this.productLocator, + data_location: this.dataLocation, + product_type: this.productType, + target_list: this.targetList, + telescope: this.telescope, + project_code: this.projectCode, + 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 @@ -165,6 +194,46 @@ export class WsHomeComponent implements OnInit { this.sdmId = id; } + /** + * Sets the data location for curator + * @param path Data location path for curator + */ + setDataLocation(path: string): void { + this.dataLocation = path; + } + + /** + * Sets the product type for curator + * @param type Product type for curator + */ + setProductType(type: string): void { + this.productType = type; + } + + /** + * Sets the telescope for curator + * @param telescope Telescope for curator + */ + setTelescope(telescope: string): void { + this.telescope = telescope; + } + + /** + * Sets the project code for curator + * @param projectCode Project code for curator + */ + setProjectCode(projectCode: string): void { + this.projectCode = projectCode; + } + + /** + * Sets the target list for curator + * @param targetList Target list for curator + */ + setTargetList(targetList: string): void { + this.targetList = targetList; + } + /** * Method that uses the capabilityLauncher service to launch a capability * @param capabilityName Name of capability -- GitLab