|
| 1 | +# Form Component <Badge type="warning" text="beta" /> |
| 2 | + |
| 3 | +<div class="component-name"><ecc-client-lit-ga4gh-wes-create-run></div> |
| 4 | +This component is used to create workflows runs using WES API. |
| 5 | +<ClientOnly> |
| 6 | + <div :class="isDark ? 'component-dark component' : 'component-light component'"> |
| 7 | + <ecc-client-lit-ga4gh-wes-create-run /> |
| 8 | + |
| 9 | +::: details Code Blocks |
| 10 | +::: code-group |
| 11 | + |
| 12 | +```js [HTML] |
| 13 | +import "@elixir-cloud/lit-wes"; |
| 14 | + |
| 15 | +<ecc-utils-design-form />; |
| 16 | +``` |
| 17 | + |
| 18 | + <!-- ```jsx [React] |
| 19 | +
|
| 20 | + ``` --> |
| 21 | + |
| 22 | +::: |
| 23 | + |
| 24 | + </div> |
| 25 | +</ClientOnly> |
| 26 | + |
| 27 | +## Importing |
| 28 | + |
| 29 | +```js [HTML] |
| 30 | +import "@elixir-cloud/lit-wes"; |
| 31 | +``` |
| 32 | + |
| 33 | +## Properties |
| 34 | + |
| 35 | +| Property | Required | Default | Type | Description | |
| 36 | +| --------------------- | -------- | ----------------------------------------- | -------- | ----------- | |
| 37 | +| [`baseURL`](#baseURL) | `false` | `https://prowes.rahtiapp.fi/ga4gh/wes/v1` | `String` | Base URL | |
| 38 | + |
| 39 | +### baseURL |
| 40 | + |
| 41 | +This property is used to give `POST` endpoint to create workflow. The provided baseURL is concatinated with `/runs` and is used as an endpoint to create a `POST` request. |
| 42 | + |
| 43 | +## Parts |
| 44 | + |
| 45 | +TODO: |
| 46 | + |
| 47 | +<!-- | Part Name | Description | |
| 48 | +| --------------- | --------------------------------------------------------------------------------- | |
| 49 | +| `` | Component's internal form. | --> |
| 50 | + |
| 51 | +## CSS Variables |
| 52 | + |
| 53 | +## Examples |
| 54 | + |
| 55 | +### With baseURL |
| 56 | + |
| 57 | +<ClientOnly> |
| 58 | + <div :class="isDark ? 'component-dark component' : 'component-light component'"> |
| 59 | + <!-- Render ecc-utils-design-form component only after the component is loaded --> |
| 60 | + <ecc-client-lit-ga4gh-wes-create-run |
| 61 | + baseURL="http://localhost:8090/ga4gh/wes/v1" |
| 62 | + /> |
| 63 | + |
| 64 | +::: details Code Blocks |
| 65 | +::: code-group |
| 66 | + |
| 67 | +```js [HTML] |
| 68 | +import "@elixir-cloud/lit-wes"; |
| 69 | + |
| 70 | +<ecc-client-lit-ga4gh-wes-create-run baseURL="http://localhost:8090/ga4gh/wes/v1" />; |
| 71 | +``` |
| 72 | + |
| 73 | + <!-- ```jsx [React] |
| 74 | +
|
| 75 | + ``` --> |
| 76 | + |
| 77 | +::: |
| 78 | + |
| 79 | + </div> |
| 80 | +</ClientOnly> |
| 81 | + |
| 82 | +> The baseURL provided is localhost:8090, for this to work, have a WES implementation running on PORT 8090 or locally deploy [proWES](https://github.com/elixir-cloud-aai/proWES). |
| 83 | +
|
| 84 | +<script setup> |
| 85 | + import { onMounted } from "vue"; |
| 86 | +import { useData } from "vitepress"; |
| 87 | +const { isDark } = useData(); |
| 88 | +onMounted(() => { |
| 89 | + import("@elixir-cloud/lit-wes").then((module) => { |
| 90 | + renderComponent.value = false; |
| 91 | + renderComponent.value = true; |
| 92 | + document.querySelectorAll("ecc-client-lit-ga4gh-wes-create-run").forEach((element) => { |
| 93 | + element.addEventListener("form-submit", (e) => { |
| 94 | + console.log("form-submitted", e.detail); |
| 95 | + }); |
| 96 | + }); |
| 97 | + }); |
| 98 | +}); |
| 99 | +</script> |
0 commit comments