Skip to content
Snippets Groups Projects
Commit 4cb84ad6 authored by Nathan Hertz's avatar Nathan Hertz
Browse files

WS-677: `null_dag` capability

parent abea0fb4
No related branches found
No related tags found
1 merge request!507WS-677: `null_dag` capability
Pipeline #2930 passed
......@@ -8,4 +8,4 @@
</div>
</div>
<ng-template #noFilesMessage> <em>No files exist for this request.</em> </ng-template>
<ng-template #noFilesMessage> <em>No files are attached to this request.</em> </ng-template>
<div id="parameters-container" class="container-fluid rounded-top rounded-3 p-3">
<div class="row my-2" *ngFor="let parameter of capabilityRequest.parameters | keyvalue">
<div class="col">
<span class="rounded-pill px-2 py-1 argument-key">{{ parameter.key }}</span>
<span class="px-1"> = </span>
<span class="rounded-pill px-2 py-1 argument-value">{{ parameter.value }}</span>
<div *ngIf="isEmpty(capabilityRequest.parameters) === false; else noParametersMessage">
<div class="row my-2" *ngFor="let parameter of capabilityRequest.parameters | keyvalue">
<div class="col">
<span class="rounded-pill px-2 py-1 argument-key">{{ parameter.key }}</span>
<span class="px-1"> = </span>
<span class="rounded-pill px-2 py-1 argument-value">{{ parameter.value }}</span>
</div>
</div>
</div>
</div>
<ng-template #noParametersMessage> <em>This request has no parameters.</em> </ng-template>
import { Component, Input, OnInit } from "@angular/core";
import { CapabilityRequest } from "../../../../model/capability-request";
import { JsonObject } from "@angular/compiler-cli/ngcc/src/packages/entry_point";
@Component({
selector: "app-parameters",
......@@ -12,4 +13,20 @@ export class ParametersComponent implements OnInit {
constructor() {}
ngOnInit(): void {}
/**
* Check if JsonObject is empty
* Taken from: https://stackoverflow.com/questions/679915/how-do-i-test-for-an-empty-javascript-object
* @param obj Object to be checked
* @return boolean true if object is empty; else false
*/
isEmpty(obj: JsonObject): boolean {
for (const prop in obj) {
if (obj.hasOwnProperty(prop)) {
return false;
}
}
return true;
}
}
......@@ -31,6 +31,16 @@
Launch null at NMT
</button>
</div>
<div class="d-flex px-2">
<button
type="button"
id="launchNullDagCapability"
class="btn btn-secondary btn-lg"
(click)="nullDagButtonOnClick()"
>
Launch multi-stage null capability
</button>
</div>
</div>
</div>
<div class="container border rounded py-3 my-3">
......
import { Component, OnInit } from "@angular/core";
import { CapabilityLauncherService } from "./services/capability-launcher.service";
import { CapabilityRequest } from "./model/capability-request";
import { CapabilityExecution } from "./model/capability-execution";
import { JsonObject } from "@angular/compiler-cli/ngcc/src/packages/entry_point";
import { ActivatedRoute, Router } from "@angular/router";
import { CapabilityRequestService } from "./services/capability-request.service";
@Component({
......@@ -51,6 +49,13 @@ export class WorkspacesComponent implements OnInit {
this.launchCapability("null", { arguments: "-g", remote: true });
}
/**
* OnClick method that creates a capability request for the null_dag capability
*/
nullDagButtonOnClick(): void {
this.launchCapability("null_dag", {});
}
/**
* OnClick method that creates a capability request a given capability and submits it with the standard parameters:
* - Product locator
......
"""add null_dag capability
Revision ID: c717f781828d
Revises: 990c5cd70082
Create Date: 2021-09-15 14:58:45.780793
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = "c717f781828d"
down_revision = "990c5cd70082"
branch_labels = None
depends_on = None
def upgrade():
op.execute(
"INSERT INTO capabilities (capability_name, capability_steps, max_jobs) VALUES "
"('null_dag', 'prepare-and-run-workflow null_dag\nawait-workflow', 2)"
)
def downgrade():
op.execute("DELETE FROM capabilities WHERE capability_name = 'null_dag'")
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