Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sistent/sistent",
"version": "0.21.0",
"version": "0.22.0",
"description": "Reusable React Components and SVG Icons library",
"repository": {
"type": "git",
Expand Down Expand Up @@ -46,7 +46,7 @@
"@emotion/cache": "^11.14.0",
"@eslint/eslintrc": "^3.3.5",
"@eslint/js": "^10.0.1",
"@meshery/schemas": "^1.2.7",
"@meshery/schemas": "^1.2.8",
"@mui/icons-material": "^9.0.0",
"@mui/material": "^9.0.0",
"@mui/system": "^9.0.0",
Expand Down
60 changes: 26 additions & 34 deletions src/schemas/createAndEditEnvironment/schema.tsx
Original file line number Diff line number Diff line change
@@ -1,34 +1,26 @@
import EnvironmentDefinitionV1Beta3OpenApiSchema from '@meshery/schemas/constructs/v1beta3/environment/EnvironmentSchema';

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const environmentSchema = (EnvironmentDefinitionV1Beta3OpenApiSchema as any).components.schemas;
const createAndEditEnvironmentSchema = {
title: 'Environment',
required: ['name'],
properties: {
description: {
description: environmentSchema.EnvironmentPayload.properties.description.description,
format: 'textarea',
title: 'Description',
type: environmentSchema.EnvironmentPayload.properties.description.type,
'x-rjsf-grid-area': '12'
},
name: {
description: environmentSchema.EnvironmentPayload.properties.name.description,
title: 'Name',
type: environmentSchema.EnvironmentPayload.properties.name.type,
'x-rjsf-grid-area': '12'
},
organization: {
type: environmentSchema.EnvironmentPayload.properties.organizationId.type,
title: 'Organization',
description: environmentSchema.EnvironmentPayload.properties.organizationId.description,
enum: [],
enumNames: [],
'x-rjsf-grid-area': '12'
}
},
type: 'object'
};

export default createAndEditEnvironmentSchema;
/**
* Schema for the create-or-edit environment modal.
*
* Source-of-truth: re-exported from `@meshery/schemas` per the form-schema
* canonicalization tracked in
* https://github.com/meshery/schemas/issues/866 (Phase 3).
*
* The previously hand-authored object literal has moved to
* `meshery/schemas` at
* `schemas/constructs/v1beta3/environment/forms/createOrEdit.json`,
* where a Go subset-validator (`validation/forms_test.go`) keeps it
* structurally aligned with the canonical OpenAPI Environment construct.
*
* Wire-level change: the field formerly keyed as `organization` is
* now keyed as `organizationId`, matching canonical
* `EnvironmentPayload.organizationId`. The Meshery server's
* Environment endpoint already accepts the canonical key per its
* OpenAPI; this brings the form payload into alignment.
*
* The published Sistent export name (`createAndEditEnvironmentSchema`)
* is unchanged — only the source of the schema has flipped. Consumers
* in `meshery` and `meshery-cloud` keep working without source-level
* changes; submission payloads now use `organizationId` for that
* field.
*/
export { EnvironmentCreateOrEditRjsfSchemaV1Beta3 as default } from '@meshery/schemas';
21 changes: 13 additions & 8 deletions src/schemas/createAndEditEnvironment/uiSchema.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
const createAndEditEnvironmentUiSchema = {
organization: {
'ui:disabled': false
},
'ui:order': ['organization', 'name', 'description']
};

export default createAndEditEnvironmentUiSchema;
/**
* UI schema for the create-or-edit environment modal.
*
* Source-of-truth: re-exported from `@meshery/schemas` per the
* form-schema canonicalization tracked in
* https://github.com/meshery/schemas/issues/866 (Phase 3).
*
* The published Sistent export name (`createAndEditEnvironmentUiSchema`)
* is unchanged. The canonical UI schema already keys
* `ui:disabled` and `ui:order` on the canonical field name
* `organizationId`.
*/
export { EnvironmentCreateOrEditRjsfUiSchemaV1Beta3 as default } from '@meshery/schemas';
84 changes: 41 additions & 43 deletions src/schemas/createAndEditWorkspace/schema.tsx
Original file line number Diff line number Diff line change
@@ -1,49 +1,47 @@
/**
* Schema for create or edit workspace modals
* Schemas for the create-or-edit workspace modals.
*
* Source-of-truth: re-exported from `@meshery/schemas` per the form-schema
* canonicalization tracked in
* https://github.com/meshery/schemas/issues/866 (Phase 3).
*
* The previously hand-authored object literal has moved to
* `meshery/schemas` at
* `schemas/constructs/v1beta3/workspace/forms/createOrEdit.json`,
* where a Go subset-validator (`validation/forms_test.go`) keeps it
* structurally aligned with the canonical OpenAPI Workspace construct.
*
* Wire-level change: the field formerly keyed as `organization` is
* now keyed as `organizationId`, matching canonical
* `WorkspacePayload.organizationId`.
*
* Two exports are published:
*
* - default (`createAndEditWorkspaceSchema`): the create-or-edit
* form with `name` and `organizationId` required.
* - named (`editWorkspaceSchema`): a relaxed variant where only
* `organizationId` is required — used by the edit-only modal
* where the existing workspace name is preserved if blank.
*
* The relaxed-`required` variant is derived locally from the
* canonical schema by spreading the canonical and overriding
* `required`. Once `@meshery/schemas` ships an
* `WorkspaceEditRjsfSchemaV1Beta3` (a relaxed-required canonical
* variant), this derivation can be deleted in favor of a direct
* re-export.
*/
import WorkspaceDefinitionV1Beta3OpenApiSchema from '@meshery/schemas/constructs/v1beta3/workspace/WorkspaceSchema';
import { WorkspaceCreateOrEditRjsfSchemaV1Beta3 } from '@meshery/schemas';

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const workspaceSchema = (WorkspaceDefinitionV1Beta3OpenApiSchema as any).components.schemas;

/**
* Create workspace schema - name is required
*/
const createAndEditWorkspace = {
properties: {
description: {
description: workspaceSchema.WorkspacePayload.properties.description.description,
format: 'textarea',
title: 'Description',
type: workspaceSchema.WorkspacePayload.properties.description.type,
'x-rjsf-grid-area': '12'
},
name: {
description: workspaceSchema.WorkspacePayload.properties.name.description,
title: 'Name',
type: workspaceSchema.WorkspacePayload.properties.name.type,
'x-rjsf-grid-area': '12'
},
organization: {
type: workspaceSchema.WorkspacePayload.properties.organizationId.type,
description: workspaceSchema.WorkspacePayload.properties.organizationId.description,
title: 'Organization',
enum: [],
enumNames: [],
'x-rjsf-grid-area': '12'
}
},
type: 'object',
required: ['name', 'organization']
};

/**
* Edit workspace schema - name is optional (derived from WorkspacePayload with relaxed requirements)
*/
const editWorkspace = {
...createAndEditWorkspace,
required: ['organization']
// `editWorkspace` is intentionally typed as a loose record so its
// emitted `.d.ts` doesn't reference @meshery/schemas's internal
// `RJSFSchema` type (declared but not currently re-exported by that
// package — see the follow-up issue against meshery/schemas to add
// `export type { RJSFSchema, UiSchema }` to the public surface).
// Once that type is exportable, this annotation can be tightened.
const editWorkspace: Record<string, unknown> = {
...WorkspaceCreateOrEditRjsfSchemaV1Beta3,
required: ['organizationId']
};

export default createAndEditWorkspace;
export default WorkspaceCreateOrEditRjsfSchemaV1Beta3;
export { editWorkspace };
22 changes: 13 additions & 9 deletions src/schemas/createAndEditWorkspace/uiSchema.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
const createAndEditWorkspaceUiSchema = {
organization: {
'ui:disabled': false,
'ui:widget': 'select'
},
'ui:order': ['organization', 'name', 'description']
};

export default createAndEditWorkspaceUiSchema;
/**
* UI schema for the create-or-edit workspace modals.
*
* Source-of-truth: re-exported from `@meshery/schemas` per the
* form-schema canonicalization tracked in
* https://github.com/meshery/schemas/issues/866 (Phase 3).
*
* The published Sistent export name (`createAndEditWorkspaceUiSchema`)
* is unchanged. The canonical UI schema already keys
* `ui:disabled` / `ui:widget` and `ui:order` on the canonical
* field name `organizationId`.
*/
export { WorkspaceCreateOrEditRjsfUiSchemaV1Beta3 as default } from '@meshery/schemas';
53 changes: 20 additions & 33 deletions src/schemas/grafanaCredential/schema.tsx
Original file line number Diff line number Diff line change
@@ -1,35 +1,22 @@
/**
* Schema for creating grafana credential;
* Schema for the Grafana credential modal.
*
* Source-of-truth: re-exported from `@meshery/schemas` per the form-schema
* canonicalization tracked in
* https://github.com/meshery/schemas/issues/866 (Phase 3).
*
* The previously hand-authored object literal has moved to
* `meshery/schemas` at
* `schemas/constructs/v1beta1/credential/forms/grafana.json`,
* where a Go subset-validator (`validation/forms_test.go`) keeps it
* structurally aligned with the canonical OpenAPI Credential construct
* (the grafana-specific shape lives inside the canonical free-form
* `secret` map).
*
* Wire-level change: the field formerly keyed as `credentialName` is
* now keyed as `name`, matching canonical `Credential.name`.
*
* The published Sistent export name (`grafanaCredentialSchema`)
* is unchanged.
*/
const grafanaCredentialSchema = {
type: 'object',
title: 'Grafana',
properties: {
credentialName: {
title: 'Credential Name',
type: 'string',
description: 'Name of your credential'
},
secret: {
type: 'object',
title: 'Credential Secret',
description: 'Credential secret for the Grafana instance',
properties: {
grafanaURL: {
type: 'string',
title: 'URL',
description: 'URL of the Grafana instance'
},
grafanaAPIKey: {
type: 'string',
title: 'API Key',
description: 'API Key for the Grafana instance'
}
},
required: ['grafanaURL', 'grafanaAPIKey']
}
},
required: ['credentialName']
};

export default grafanaCredentialSchema;
export { GrafanaCredentialRjsfSchemaV1Beta1 as default } from '@meshery/schemas';
14 changes: 11 additions & 3 deletions src/schemas/grafanaCredential/uiSchema.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
const grafanaCredentialUiSchema = {};

export default grafanaCredentialUiSchema;
/**
* UI schema for the Grafana credential modal.
*
* Source-of-truth: re-exported from `@meshery/schemas` per the
* form-schema canonicalization tracked in
* https://github.com/meshery/schemas/issues/866 (Phase 3).
*
* The published Sistent export name (`grafanaCredentialUiSchema`)
* is unchanged.
*/
export { GrafanaCredentialRjsfUiSchemaV1Beta1 as default } from '@meshery/schemas';
8 changes: 8 additions & 0 deletions src/schemas/helmConnection/schema.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
* Schema for configuring Helm repository connections. This schema is designed for use in a wizard or form
* where users can provide information about connecting to a Helm repository for initiating connection.
*/
// TODO(meshery/schemas#866 — Phase 3): once `@meshery/schemas` ships
// `HelmConnectionRjsfSchemaV1Beta2` (canonical home:
// `typescript/forms/v1beta2/connection/`), flip this file to:
//
// export { HelmConnectionRjsfSchemaV1Beta2 as default } from '@meshery/schemas';
//
// The published Sistent export name (`helmConnectionSchema`) MUST
// stay the same; only the source flips.
const helmConnectionSchema = {
type: 'object',
properties: {
Expand Down
8 changes: 8 additions & 0 deletions src/schemas/importDesign/schema.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
// TODO(meshery/schemas#866 — Phase 3): once `@meshery/schemas` ships
// `DesignImportRjsfSchemaV1Beta3` (canonical home: `typescript/forms/v1beta3/design/`),
// flip this file to:
//
// export { DesignImportRjsfSchemaV1Beta3 as default } from '@meshery/schemas';
//
// The published Sistent export name (`importDesignSchema`) MUST stay
// the same; only the source flips.
import { DesignDefinitionV1Beta1OpenApiSchema } from '@meshery/schemas';

// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down
9 changes: 9 additions & 0 deletions src/schemas/importFilter/schema.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
// TODO(meshery/schemas#866 — Phase 3): once `@meshery/schemas` ships
// `FilterImportRjsfSchemaV1Beta2` (canonical home: `typescript/forms/v1beta2/catalog/`
// — filter is part of the catalog/design family per the form-schemas
// roadmap), flip this file to:
//
// export { FilterImportRjsfSchemaV1Beta2 as default } from '@meshery/schemas';
//
// The published Sistent export name (`importFilterSchema`) MUST stay
// the same; only the source flips.
const importFilterSchema = {
type: 'object',
properties: {
Expand Down
8 changes: 8 additions & 0 deletions src/schemas/importModel/schema.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
// TODO(meshery/schemas#866 — Phase 3): once `@meshery/schemas` ships
// `ModelImportRjsfSchemaV1Beta2` (canonical home: `typescript/forms/v1beta2/model/`),
// flip this file to:
//
// export { ModelImportRjsfSchemaV1Beta2 as default } from '@meshery/schemas';
//
// The published Sistent export name (`importModelSchema`) MUST stay
// the same; only the source flips.
import ModelDefinitionV1Beta2OpenApiSchema from '@meshery/schemas/constructs/v1beta2/model/ModelSchema';

// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down
Loading
Loading