Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feat/add_directory_api
Browse files Browse the repository at this point in the history
  • Loading branch information
Tristan-WorkGH committed Aug 6, 2024
2 parents 6e3ab89 + 97ad525 commit 3d0d71f
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 18 deletions.
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,19 @@ The commons-ui library have a demo app in which you can call your components to
The `npm start` command install the library's dependencies then launches the demo app.

If you want to test your library integration with a consumer application my-app you have first
to build commons-ui via
to build commons-ui via
- `npm install` (if not already done to get `tsc`)
- `npm run build:pack`

Then in the my-app project :
- Change the commons-ui dependency in my-app's package.json from
`@gridsuite/commons-ui:"^x.x.x"`
to
`@gridsuite/commons-ui:"file:{PATH_TO_LIBRARY}/gridsuite-commons-ui-{LIBRARY_VERSION}.tgz"`
- Change the commons-ui dependency in my-app's package.json from `@gridsuite/commons-ui:"^x.x.x"`
to `@gridsuite/commons-ui:"file:{PATH_TO_LIBRARY}/gridsuite-commons-ui-{LIBRARY_VERSION}.tgz"`
- `npm install`
- `npm start`

*Warning* : with Create React App, we realised the library was not updating correctly if you try to install the library multiple times.
To fix this, run this command from the app **after** running "npm install"
- rm -Rf node_modules/.cache


#### For integrators

Expand All @@ -48,6 +45,7 @@ To check dependencies license compatibility with this project one locally, pleas
npm run licenses-check
```

Notes :
Notes :
* Check [license-checker-config.json](license-checker-config.json) for license white list and exclusion.

If you need to update this list, please inform organization's owners.
5 changes: 4 additions & 1 deletion demo/src/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ import {
equipmentStyles,
getFileIcon,
initializeAuthenticationDev,
LANG_ENGLISH,
LANG_FRENCH,
LANG_SYSTEM,
LIGHT_THEME,
logout,
card_error_boundary_en,
card_error_boundary_fr,
Expand Down Expand Up @@ -98,7 +102,6 @@ import inputs_en from '../../src/components/translations/inputs-en';
import inputs_fr from '../../src/components/translations/inputs-fr';
import { EquipmentSearchDialog } from './equipment-search';
import { InlineSearch } from './inline-search';
import { LIGHT_THEME } from '../../src/utils/theme';

const messages = {
en: {
Expand Down
6 changes: 2 additions & 4 deletions src/components/TopBar/TopBar.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@

import { render } from '@testing-library/react';
import { IntlProvider } from 'react-intl';

import { red } from '@mui/material/colors';
import { createTheme, ThemeProvider } from '@mui/material';
import { expect, it } from '@jest/globals';
import TopBar, { LANG_ENGLISH } from './TopBar';
import TopBar from './TopBar';
import { LANG_ENGLISH } from '../../utils/language';
import top_bar_en from '../translations/top-bar-en';
import { AppMetadataCommon } from '../../services';

import PowsyblLogo from '../images/powsybl_logo.svg?react';
import { LANG_ENGLISH } from '../../utils/language';

const apps: AppMetadataCommon[] = [
{
Expand Down
1 change: 0 additions & 1 deletion src/components/dialogs/custom-mui-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import * as yup from 'yup';
import SubmitButton from '../inputs/react-hook-form/utils/submit-button';
import CancelButton from '../inputs/react-hook-form/utils/cancel-button';
import CustomFormProvider, { MergedFormContextProps } from '../inputs/react-hook-form/provider/custom-form-provider';

import { GsLangUser } from '../../utils/language';

interface ICustomMuiDialog {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import { FilterType } from '../constants/filter-constants';
import FetchStatus from '../../../utils/FetchStatus';
import { exploreSvc } from '../../../services/instances';
import FilterForm from '../filter-form';

import { GsLangUser } from '../../../utils/language';

export type SelectionCopy = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { saveExpertFilter } from '../utils/filter-api';
import { importExpertRules } from './expert-filter-utils';
import { FilterType } from '../constants/filter-constants';
import FetchStatus from '../../../utils/FetchStatus';

import { GsLangUser } from '../../../utils/language';

const formSchema = yup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import FilterForm from '../filter-form';
import { noSelectionForCopy } from '../../../utils/equipment-types';
import { FilterType } from '../constants/filter-constants';
import FetchStatus from '../../../utils/FetchStatus';

import { GsLangUser } from '../../../utils/language';

const formSchema = yup
Expand Down
1 change: 0 additions & 1 deletion src/components/filter/filter-creation-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import yup from '../../utils/yup-config';
import FilterForm from './filter-form';
import { EXPERT_FILTER_QUERY, expertFilterSchema, getExpertFilterEmptyFormData } from './expert/expert-filter-form';
import { FilterType } from './constants/filter-constants';

import { GsLangUser } from '../../utils/language';

const emptyFormData = {
Expand Down
1 change: 0 additions & 1 deletion src/utils/EquipmentType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/

import { Theme } from '@mui/material';

import { LIGHT_THEME } from './theme';

export const TYPE_TAG_MAX_SIZE = '90px';
Expand Down
1 change: 1 addition & 0 deletions src/utils/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

export { HttpContentType, setRequestHeader, downloadFile } from './api-rest';
export type { UrlString, Url, HttpMethod, HttpHeaderName, InitRequest, Token, ErrorWithStatus } from './api-rest';
export * from './utils';
1 change: 1 addition & 0 deletions src/utils/api/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

import { User } from 'oidc-client';

export enum FileType {
Expand Down

0 comments on commit 3d0d71f

Please sign in to comment.