Skip to content

Commit

Permalink
CB-3454 ai (#2033)
Browse files Browse the repository at this point in the history
* CB-3999 add ai plugin

* CB-3454 review fixes

* CB-3454 gql since directive fix

* CB-3454 update tsconfig

* fix: npm dependencies

* CB-4045 add hint property

* CB-3454 add hints

---------

Co-authored-by: Ainur <[email protected]>
Co-authored-by: Alexey <[email protected]>
Co-authored-by: Daria Marutkina <[email protected]>
  • Loading branch information
4 people authored Oct 13, 2023
1 parent d0a820d commit 49f3214
Show file tree
Hide file tree
Showing 46 changed files with 63 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ public String getDescription() {
}
}

@Property
public String getHint() {
return property.getHint();
}

@Property
public int getOrder() {
return property instanceof ObjectPropertyDescriptor ? ((ObjectPropertyDescriptor) property).getOrderNumber() : -1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ input PageInput {
offset: Int
}

directive @since(version: String!) on OBJECT|SCALAR|QUERY|MUTATION|FIELD|VARIABLE_DEFINITION|OBJECT|FIELD_DEFINITION|ARGUMENT_DEFINITION|INTERFACE|ENUM|ENUM_VALUE|INPUT_OBJECT|INPUT_FIELD_DEFINITION
directive @since(version: String!) repeatable on OBJECT|SCALAR|QUERY|MUTATION|FIELD|VARIABLE_DEFINITION|OBJECT|FIELD_DEFINITION|ARGUMENT_DEFINITION|INTERFACE|ENUM|ENUM_VALUE|INPUT_OBJECT|INPUT_FIELD_DEFINITION

type Query

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ type ObjectPropertyInfo {
displayName: String
# Property description
description: String
# Property hint
hint: String @since(version: "23.2.3")
# Property category (may be used if object has a lot of properties)
category: String
# Property data type (int, String, etc)
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/core-administration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@cloudbeaver/core-theming": "~0.1.0",
"@cloudbeaver/core-utils": "~0.1.0",
"mobx": "^6.10.2",
"reshadow": "~0.x.x"
"reshadow": "^0.0.1"
},
"peerDependencies": {},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/core-blocks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"react": "^18.2.0",
"reakit": "~1.x.x",
"reakit-utils": "^0.15.2",
"reshadow": "~0.x.x"
"reshadow": "^0.0.1"
},
"peerDependencies": {},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ export const RenderField = observer<RenderFieldProps>(function RenderField({
title={property.description}
disabled={disabled}
readOnly={readOnly}
description={property.hint}
className={className}
>
{property.displayName ?? ''}
Expand All @@ -175,6 +176,7 @@ export const RenderField = observer<RenderFieldProps>(function RenderField({
title={property.description}
disabled={disabled}
readOnly={readOnly}
description={property.hint}
className={className}
>
{property.displayName ?? ''}
Expand Down Expand Up @@ -225,7 +227,7 @@ export const RenderField = observer<RenderFieldProps>(function RenderField({
name={property.id!}
state={state}
defaultValue={defaultValue}
description={description}
description={description ?? property.hint}
disabled={disabled}
readOnly={readOnly}
autoHide={autoHide}
Expand All @@ -247,7 +249,7 @@ export const RenderField = observer<RenderFieldProps>(function RenderField({
name={property.id!}
value={value}
defaultValue={defaultValue}
description={description}
description={description ?? property.hint}
disabled={disabled}
readOnly={readOnly}
autoComplete={RESERVED_KEYWORDS.includes(autofillToken) ? autofillToken : `${autofillToken} ${property.id}`}
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/core-bootstrap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"mobx": "^6.10.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"reshadow": "~0.x.x"
"reshadow": "^0.0.1"
},
"peerDependencies": {},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/core-notifications/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"mobx-react-lite": "^4.0.5",
"react": "^18.2.0",
"reakit": "~1.x.x",
"reshadow": "~0.x.x"
"reshadow": "^0.0.1"
},
"peerDependencies": {},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ fragment ObjectPropertyInfo on ObjectPropertyInfo {
id
displayName
description
hint
category
dataType
value
validValues
defaultValue
length
features
order
}
order
}
2 changes: 1 addition & 1 deletion webapp/packages/core-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"react-dnd": "^16.0.1",
"react-dnd-html5-backend": "^16.0.1",
"reakit": "~1.x.x",
"reshadow": "~0.x.x"
"reshadow": "^0.0.1"
},
"peerDependencies": {},
"devDependencies": {
Expand Down
10 changes: 9 additions & 1 deletion webapp/packages/core-ui/src/Form/FormPart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,22 @@ export abstract class FormPart<TPartState, TFormState = any> implements IFormPar
await this.load();
}

reset() {
this.setState(toJS(this.initialState));
}

protected setInitialState(initialState: TPartState) {
this.initialState = initialState;

if (this.isChanged()) {
return;
}

this.state = toJS(this.initialState);
this.setState(toJS(this.initialState));
}

protected setState(state: TPartState) {
this.state = state;
}

protected configure(data: IFormState<TFormState>, contexts: IExecutionContextProvider<IFormState<TFormState>>): void | Promise<void> {}
Expand Down
1 change: 1 addition & 0 deletions webapp/packages/core-ui/src/Form/IFormPart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ export interface IFormPart<TState> extends ILoadableState {

load(): Promise<void>;
save(): Promise<void>;
reset(): void;
}
2 changes: 1 addition & 1 deletion webapp/packages/core-view/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"mobx-react-lite": "^4.0.5",
"react": "^18.2.0",
"react-hotkeys-hook": "^4.4.1",
"reshadow": "~0.x.x"
"reshadow": "^0.0.1"
},
"peerDependencies": {},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/plugin-administration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"mobx": "^6.10.2",
"mobx-react-lite": "^4.0.5",
"react": "^18.2.0",
"reshadow": "~0.x.x"
"reshadow": "^0.0.1"
},
"peerDependencies": {},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"mobx": "^6.10.2",
"mobx-react-lite": "^4.0.5",
"react": "^18.2.0",
"reshadow": "~0.x.x"
"reshadow": "^0.0.1"
},
"peerDependencies": {},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/plugin-authentication/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"mobx": "^6.10.2",
"mobx-react-lite": "^4.0.5",
"react": "^18.2.0",
"reshadow": "~0.x.x"
"reshadow": "^0.0.1"
},
"peerDependencies": {},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/plugin-codemirror6/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"mobx-react-lite": "^4.0.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"reshadow": "~0.x.x"
"reshadow": "^0.0.1"
},
"peerDependencies": {},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/plugin-connection-search/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"mobx": "^6.10.2",
"mobx-react-lite": "^4.0.5",
"react": "^18.2.0",
"reshadow": "~0.x.x"
"reshadow": "^0.0.1"
},
"peerDependencies": {},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/plugin-connection-template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"mobx": "^6.10.2",
"mobx-react-lite": "^4.0.5",
"react": "^18.2.0",
"reshadow": "~0.x.x"
"reshadow": "^0.0.1"
},
"peerDependencies": {},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"mobx": "^6.10.2",
"mobx-react-lite": "^4.0.5",
"react": "^18.2.0",
"reshadow": "~0.x.x"
"reshadow": "^0.0.1"
},
"peerDependencies": {},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/plugin-connections/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"mobx": "^6.10.2",
"mobx-react-lite": "^4.0.5",
"react": "^18.2.0",
"reshadow": "~0.x.x"
"reshadow": "^0.0.1"
},
"peerDependencies": {},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/plugin-data-export/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"mobx": "^6.10.2",
"mobx-react-lite": "^4.0.5",
"react": "^18.2.0",
"reshadow": "~0.x.x"
"reshadow": "^0.0.1"
},
"peerDependencies": {},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/plugin-data-spreadsheet-new/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-popper": "^2.3.0",
"reshadow": "~0.x.x"
"reshadow": "^0.0.1"
},
"peerDependencies": {},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"mobx": "^6.10.2",
"mobx-react-lite": "^4.0.5",
"react": "^18.2.0",
"reshadow": "~0.x.x"
"reshadow": "^0.0.1"
},
"peerDependencies": {},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/plugin-data-viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"mobx": "^6.10.2",
"mobx-react-lite": "^4.0.5",
"react": "^18.2.0",
"reshadow": "~0.x.x"
"reshadow": "^0.0.1"
},
"peerDependencies": {},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"mobx": "^6.10.2",
"mobx-react-lite": "^4.0.5",
"react": "^18.2.0",
"reshadow": "~0.x.x"
"reshadow": "^0.0.1"
},
"peerDependencies": {},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/plugin-ddl-viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@cloudbeaver/plugin-sql-editor-new": "~0.1.0",
"mobx-react-lite": "^4.0.5",
"react": "^18.2.0",
"reshadow": "~0.x.x"
"reshadow": "^0.0.1"
},
"peerDependencies": {},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/plugin-devtools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"mobx": "^6.10.2",
"mobx-react-lite": "^4.0.5",
"react": "^18.2.0",
"reshadow": "~0.x.x"
"reshadow": "^0.0.1"
},
"peerDependencies": {},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/plugin-gis-viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"mobx-react-lite": "^4.0.5",
"react": "^18.2.0",
"react-leaflet": "^4.2.1",
"reshadow": "~0.x.x",
"reshadow": "^0.0.1",
"wellknown": "^0.5.0"
},
"peerDependencies": {},
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/plugin-help/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@cloudbeaver/plugin-sql-editor": "~0.1.0",
"@cloudbeaver/plugin-top-app-bar": "~0.1.0",
"react": "^18.2.0",
"reshadow": "~0.x.x"
"reshadow": "^0.0.1"
},
"peerDependencies": {},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/plugin-log-viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"mobx": "^6.10.2",
"mobx-react-lite": "^4.0.5",
"react": "^18.2.0",
"reshadow": "~0.x.x"
"reshadow": "^0.0.1"
},
"peerDependencies": {},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/plugin-navigation-tabs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"mobx": "^6.10.2",
"mobx-react-lite": "^4.0.5",
"react": "^18.2.0",
"reshadow": "~0.x.x"
"reshadow": "^0.0.1"
},
"peerDependencies": {},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/plugin-navigation-tree-rm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@cloudbeaver/plugin-resource-manager": "~0.1.0",
"mobx-react-lite": "^4.0.5",
"react": "^18.2.0",
"reshadow": "~0.x.x"
"reshadow": "^0.0.1"
},
"peerDependencies": {},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/plugin-navigation-tree/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"mobx": "^6.10.2",
"mobx-react-lite": "^4.0.5",
"react": "^18.2.0",
"reshadow": "~0.x.x"
"reshadow": "^0.0.1"
},
"peerDependencies": {},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/plugin-object-viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"mobx-react-lite": "^4.0.5",
"react": "^18.2.0",
"reakit": "~1.x.x",
"reshadow": "~0.x.x"
"reshadow": "^0.0.1"
},
"peerDependencies": {},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"mobx": "^6.10.2",
"mobx-react-lite": "^4.0.5",
"react": "^18.2.0",
"reshadow": "~0.x.x"
"reshadow": "^0.0.1"
},
"peerDependencies": {},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/plugin-root/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@cloudbeaver/core-utils": "~0.1.0",
"mobx-react-lite": "^4.0.5",
"react": "^18.2.0",
"reshadow": "~0.x.x"
"reshadow": "^0.0.1"
},
"peerDependencies": {},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/plugin-settings-menu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@cloudbeaver/plugin-top-app-bar": "~0.1.0",
"mobx-react-lite": "^4.0.5",
"react": "^18.2.0",
"reshadow": "~0.x.x"
"reshadow": "^0.0.1"
},
"peerDependencies": {},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/plugin-settings-panel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@cloudbeaver/plugin-settings-menu": "~0.1.0",
"mobx-react-lite": "^4.0.5",
"react": "^18.2.0",
"reshadow": "~0.x.x"
"reshadow": "^0.0.1"
},
"peerDependencies": {},
"devDependencies": {
Expand Down
Loading

0 comments on commit 49f3214

Please sign in to comment.