@gridsuite/commons-ui 0.68.3 → 0.68.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -30,15 +30,10 @@ To fix this, run this command from the app **after** running "npm install"
30
30
  If you want to deploy a new version of commons-ui in the [NPM package registry](https://www.npmjs.com/package/@gridsuite/commons-ui),
31
31
  you need to follow the steps below:
32
32
 
33
- - Update to the new version in [package.json](https://github.com/gridsuite/commons-ui/blob/main/package.json) (example `0.6.0`)
34
- - Build it: `npm install`
35
- - Commit the package.json and package-lock.json files, push to a branch, make a PR, have it reviewed and merged to main.
36
- - [Make a release](https://github.com/gridsuite/commons-ui/releases/new) on GitHub by creating a new tag on the last commit. On the release creation page:
37
- - In "Choose a tag": type the tag you want to create (ex.: v0.6.0) and select "create new tag"
38
- - In "Target": click on "recent commit" tab and select your release commit
39
- - Click on "Generate release note"
40
- - Click on "Publish release"
41
- - It will trigger a job that will publish the release on NPM
33
+ - [Make a release action](https://github.com/gridsuite/commons-ui/actions/workflows/release.yml)
34
+ - In the 'run workflow' combobox select, let the branch on main
35
+ - Enter the type of evolution (major | minor | patch)
36
+ - Click 'run workflow'
42
37
 
43
38
  #### License Headers and dependencies checking
44
39
 
@@ -32,7 +32,6 @@ export interface CustomMuiDialogProps {
32
32
  export declare const unscrollableDialogStyles: {
33
33
  fullHeightDialog: {
34
34
  '.MuiDialog-paper': {
35
- width: string;
36
35
  minWidth: string;
37
36
  margin: string;
38
37
  height: string;
@@ -18,8 +18,7 @@ const styles = {
18
18
  const unscrollableDialogStyles = {
19
19
  fullHeightDialog: {
20
20
  ".MuiDialog-paper": {
21
- width: "auto",
22
- minWidth: "1024px",
21
+ minWidth: "90vw",
23
22
  margin: "auto",
24
23
  height: "95vh"
25
24
  }
@@ -1,6 +1,7 @@
1
1
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
2
  import { Box } from "@mui/material";
3
- import { useWatch } from "react-hook-form";
3
+ import { useFormContext, useWatch } from "react-hook-form";
4
+ import { useEffect } from "react";
4
5
  import { HeaderFilterForm } from "./HeaderFilterForm.js";
5
6
  import { FieldConstants } from "../../utils/constants/fieldConstants.js";
6
7
  import { CriteriaBasedFilterForm } from "./criteriaBased/CriteriaBasedFilterForm.js";
@@ -9,7 +10,6 @@ import { ExpertFilterForm } from "./expert/ExpertFilterForm.js";
9
10
  import { FilterType } from "./constants/FilterConstants.js";
10
11
  import { unscrollableDialogStyles } from "../dialogs/customMuiDialog/CustomMuiDialog.js";
11
12
  import "../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
12
- import "react";
13
13
  import "react-intl";
14
14
  import "@mui/icons-material";
15
15
  import "../treeViewFinder/TreeViewFinder.js";
@@ -26,7 +26,16 @@ function FilterForm({
26
26
  activeDirectory,
27
27
  elementExists
28
28
  }) {
29
+ const { setValue } = useFormContext();
29
30
  const filterType = useWatch({ name: FieldConstants.FILTER_TYPE });
31
+ const handleFilterTypeChange = (_event, value) => {
32
+ setValue(FieldConstants.FILTER_TYPE, value);
33
+ };
34
+ useEffect(() => {
35
+ if (sourceFilterForExplicitNamingConversion) {
36
+ setValue(FieldConstants.FILTER_TYPE, FilterType.EXPLICIT_NAMING.id);
37
+ }
38
+ }, [sourceFilterForExplicitNamingConversion, setValue]);
30
39
  return /* @__PURE__ */ jsxs(Fragment, { children: [
31
40
  /* @__PURE__ */ jsx(Box, { sx: unscrollableDialogStyles.unscrollableHeader, children: /* @__PURE__ */ jsx(
32
41
  HeaderFilterForm,
@@ -34,7 +43,8 @@ function FilterForm({
34
43
  creation,
35
44
  activeDirectory,
36
45
  elementExists,
37
- sourceFilterForExplicitNamingConversion
46
+ sourceFilterForExplicitNamingConversion,
47
+ handleFilterTypeChange
38
48
  }
39
49
  ) }),
40
50
  filterType === FilterType.CRITERIA_BASED.id && /* @__PURE__ */ jsx(CriteriaBasedFilterForm, {}),
@@ -9,5 +9,6 @@ export interface FilterFormProps {
9
9
  id: UUID;
10
10
  equipmentType: string;
11
11
  };
12
+ handleFilterTypeChange?: (event: React.ChangeEvent<HTMLInputElement>, value: string) => void;
12
13
  }
13
- export declare function HeaderFilterForm({ sourceFilterForExplicitNamingConversion, creation, activeDirectory, elementExists, }: Readonly<FilterFormProps>): import("react/jsx-runtime").JSX.Element;
14
+ export declare function HeaderFilterForm({ sourceFilterForExplicitNamingConversion, creation, activeDirectory, elementExists, handleFilterTypeChange, }: Readonly<FilterFormProps>): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,4 @@
1
1
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
- import { useFormContext } from "react-hook-form";
3
- import { useEffect } from "react";
4
2
  import { Grid } from "@mui/material";
5
3
  import { FieldConstants } from "../../utils/constants/fieldConstants.js";
6
4
  import { FilterType } from "./constants/FilterConstants.js";
@@ -12,17 +10,9 @@ function HeaderFilterForm({
12
10
  sourceFilterForExplicitNamingConversion,
13
11
  creation,
14
12
  activeDirectory,
15
- elementExists
13
+ elementExists,
14
+ handleFilterTypeChange
16
15
  }) {
17
- const { setValue } = useFormContext();
18
- useEffect(() => {
19
- if (sourceFilterForExplicitNamingConversion) {
20
- setValue(FieldConstants.FILTER_TYPE, FilterType.EXPLICIT_NAMING.id);
21
- }
22
- }, [sourceFilterForExplicitNamingConversion, setValue]);
23
- const handleChange = (_event, value) => {
24
- setValue(FieldConstants.FILTER_TYPE, value);
25
- };
26
16
  return /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
27
17
  /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(
28
18
  UniqueNameInput,
@@ -42,7 +32,7 @@ function HeaderFilterForm({
42
32
  {
43
33
  name: FieldConstants.FILTER_TYPE,
44
34
  options: Object.values(FilterType),
45
- formProps: { onChange: handleChange }
35
+ formProps: { onChange: handleFilterTypeChange }
46
36
  }
47
37
  ) })
48
38
  ] })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridsuite/commons-ui",
3
- "version": "0.68.3",
3
+ "version": "0.68.5",
4
4
  "description": "common react components for gridsuite applications",
5
5
  "engines": {
6
6
  "npm": ">=9",