Skip to content
Snippets Groups Projects
Verified Commit f76642db authored by Philipp S. Sommer's avatar Philipp S. Sommer
Browse files

rename FunctionContainerArgs to FunctionContainerOptions

parent f0d3d661
No related branches found
No related tags found
1 merge request!1Initial implementation
......@@ -17,6 +17,6 @@ SPDX-License-Identifier: CC-BY-4.0
## Options
```{eval-rst}
.. autoclass:: FunctionContainerArgs
.. autoclass:: FunctionContainerOptions
:members:
```
......@@ -6,7 +6,7 @@ import FunctionForm from './FunctionForm';
import { IChangeEvent } from '@rjsf/core';
import OutputContainer from './OutputContainer';
import getConnection from '../resources/connection';
import { FunctionContainerArgs } from '../resources/FunctionContainerArgs';
import { FunctionContainerOptions } from '../resources/FunctionContainerOptions';
import { DASFConnection, DASFProgressReport } from '@dasf/dasf-messaging';
import { useState, FormEvent, useRef } from 'react';
......@@ -19,18 +19,18 @@ import Grid from '@mui/material/Grid2';
*
* This react component can be used to render a single function of a DASF
* backend module. You can either provide the
* :attr:`connection <FunctionContainerArgs.connection?>`, or the details
* (:attr:`websocketUrl <FunctionContainerArgs.websocketUrl?>` and
* :attr:`topic <FunctionContainerArgs.topic?>`) how to create one. And you can
* :attr:`connection <FunctionContainerOptions.connection?>`, or the details
* (:attr:`websocketUrl <FunctionContainerOptions.websocketUrl?>` and
* :attr:`topic <FunctionContainerOptions.topic?>`) how to create one. And you can
* either provide the JSONschema for the function directly (via
* :attr:`schema <FunctionContainerArgs.schema?>`), or pass the id of
* :attr:`schema <FunctionContainerOptions.schema?>`), or pass the id of
* an HTML `script` element that holds the schema (via
* :attr:`schemaElement <FunctionContainerArgs.schemaElement?>`).
* :attr:`schemaElement <FunctionContainerOptions.schemaElement?>`).
* If none of this is specified, we will get the JSONschema from the backend
* module and render the form upon response.
*
* For more information on the available options, see
* :class:`FunctionContainerArgs`.
* :class:`FunctionContainerOptions`.
*
* **Example**
*
......@@ -43,7 +43,7 @@ import Grid from '@mui/material/Grid2';
* />
*
* @param options - Options for the component, see
* :class:`FunctionContainerArgs` for documentation
* :class:`FunctionContainerOptions` for documentation
*/
function FunctionContainer({
schemaElement,
......@@ -58,7 +58,7 @@ function FunctionContainer({
onError,
onProgress,
constructorData,
}: FunctionContainerArgs) {
}: FunctionContainerOptions) {
if (typeof schemaElement != 'undefined') {
schema = JSON.parse(
// @ts-expect-error:next-line
......
......@@ -54,4 +54,4 @@ customElements.define('dasf-module', WebModuleContainer);
export { FunctionContainer, ClassContainer, ModuleContainer };
export type { FunctionContainerArgs } from './resources/FunctionContainerArgs';
export type { FunctionContainerOptions } from './resources/FunctionContainerOptions';
......@@ -5,8 +5,8 @@
import { RJSFSchema, UiSchema } from '@rjsf/utils';
import { DASFConnection, DASFProgressReport } from '@dasf/dasf-messaging';
/** Arguments for the FunctionContainer component */
export interface FunctionContainerArgs {
/** Options for the :func:`FunctionContainer <FunctionContainer.default>` component */
export interface FunctionContainerOptions {
/** The id of a ``<script>`` element with JSON-encoded JSONSchema that is
* used to render the function form.
*
......
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