@applica-software-guru/react-admin 1.0.57 → 1.0.58
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/.eslintrc.json +3 -0
- package/README.md +14 -0
- package/dist/ApplicaAdmin.d.ts +1 -1
- package/index.html +13 -0
- package/package.json +1 -1
- package/src/main.tsx +10 -0
- package/{playground/src/App.js → src/playground/App.jsx} +2 -2
- package/{playground/src/components/index.js → src/playground/components/index.jsx} +1 -0
- package/{playground/src/components/ra-lists/DeviceList.js → src/playground/components/ra-lists/DeviceList.jsx} +1 -1
- package/{playground/src/config.js → src/playground/config.jsx} +1 -1
- package/{playground/src/entities/device.js → src/playground/entities/device.jsx} +1 -1
- package/{playground/src/entities/i18n-message.js → src/playground/entities/i18n-message.jsx} +1 -1
- package/{playground/src/entities/user.js → src/playground/entities/user.jsx} +2 -2
- package/src/playground/hooks/index.jsx +1 -0
- package/{playground/src/theme.js → src/playground/theme.jsx} +1 -1
- package/vite.config.js +5 -0
- package/playground/config-overrides.js +0 -31
- package/playground/jsconfig.json +0 -9
- package/playground/package-lock.json +0 -17777
- package/playground/package.json +0 -69
- package/playground/public/favicon-dark.png +0 -0
- package/playground/public/favicon-light.png +0 -0
- package/playground/public/index.html +0 -46
- package/playground/src/hooks/index.js +0 -1
- package/playground/src/react-app-env.d.js +0 -1
- /package/{playground/src → src/playground}/.prettierrc +0 -0
- /package/{playground/src → src/playground}/build.json +0 -0
- /package/{playground/src → src/playground}/components/pages/CustomPage.jsx +0 -0
- /package/{playground/src → src/playground}/components/pages/index.jsx +0 -0
- /package/{playground/src/components/ra-buttons/index.js → src/playground/components/ra-buttons/index.jsx} +0 -0
- /package/{playground/src/components/ra-fields/UserPictureField.js → src/playground/components/ra-fields/UserPictureField.jsx} +0 -0
- /package/{playground/src/components/ra-fields/index.js → src/playground/components/ra-fields/index.jsx} +0 -0
- /package/{playground/src/components/ra-forms/DeviceForm.js → src/playground/components/ra-forms/DeviceForm.jsx} +0 -0
- /package/{playground/src/components/ra-forms/I18nMessageForm.js → src/playground/components/ra-forms/I18nMessageForm.jsx} +0 -0
- /package/{playground/src/components/ra-forms/UserForm.js → src/playground/components/ra-forms/UserForm.jsx} +0 -0
- /package/{playground/src/components/ra-forms/index.js → src/playground/components/ra-forms/index.jsx} +0 -0
- /package/{playground/src/components/ra-inputs/LangSelectInput.js → src/playground/components/ra-inputs/LangSelectInput.jsx} +0 -0
- /package/{playground/src/components/ra-inputs/YesOrNoSelectInput.js → src/playground/components/ra-inputs/YesOrNoSelectInput.jsx} +0 -0
- /package/{playground/src/components/ra-inputs/index.js → src/playground/components/ra-inputs/index.jsx} +0 -0
- /package/{playground/src/components/ra-lists/I18nMessageList.js → src/playground/components/ra-lists/I18nMessageList.jsx} +0 -0
- /package/{playground/src/components/ra-lists/UserList.js → src/playground/components/ra-lists/UserList.jsx} +0 -0
- /package/{playground/src/components/ra-lists/index.js → src/playground/components/ra-lists/index.jsx} +0 -0
- /package/{playground/src/contexts/index.js → src/playground/contexts/index.jsx} +0 -0
- /package/{playground/src/entities/index.js → src/playground/entities/index.jsx} +0 -0
- /package/{playground/src/entities/notification.js → src/playground/entities/notification.jsx} +0 -0
- /package/{playground/src/index.js → src/playground/index.jsx} +0 -0
- /package/{playground/src/menu.js → src/playground/menu.jsx} +0 -0
- /package/{playground/src/reportWebVitals.js → src/playground/reportWebVitals.jsx} +0 -0
package/.eslintrc.json
CHANGED
package/README.md
CHANGED
|
@@ -13,8 +13,22 @@ Libreria di componenti React per la creazione di applicativi web basati su React
|
|
|
13
13
|
|
|
14
14
|
Lo scopo di questa libreria è fornire un set di strumenti per la prototipazione rapida di applicativi web (generalmente di tipo gestionale) basati su React-Admin, personalizzati con il tema Mantis e che seguono le direttive grafiche del Design System ideato da Applica.
|
|
15
15
|
|
|
16
|
+
## Avviare il progetto
|
|
17
|
+
|
|
18
|
+
Pur essendo una libreria, è possibile avviare questo progetto come applicazione e testare tutte le componenti della libreria stessa a proprio piacimento.
|
|
19
|
+
Il testing avviene avviando un'applicazione che esegue il codice realizzato e gestito all'interno della cartella **src/playground**.
|
|
20
|
+
|
|
21
|
+
Per avviare il progetto, segui questi passi:
|
|
22
|
+
|
|
23
|
+
- `nvm use` per impostare la versione di Node.js corretta;
|
|
24
|
+
- `npm install` per installare le dipendenze;
|
|
25
|
+
- `npm run develop` per avviare il playground in modalità sviluppo;
|
|
26
|
+
- divertiti a testare le componenti!
|
|
27
|
+
|
|
16
28
|
## Contribuire
|
|
17
29
|
|
|
30
|
+
> Questo paragrafo tratta una procedura che sarà dismessa in futuro, per maggiori informazioni consulta il paragrafo **Avviare il progetto**
|
|
31
|
+
|
|
18
32
|
Puoi avviare un ambiente locale di sviluppo ed utilizzarlo per testare le modifiche che apporti alla libreria.
|
|
19
33
|
Per farlo, segui questi passi:
|
|
20
34
|
|
package/dist/ApplicaAdmin.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export type ApplicaAdminProps = AdminProps & {
|
|
|
21
21
|
*
|
|
22
22
|
* @example
|
|
23
23
|
* // Esempio di utilizzo
|
|
24
|
-
* import { ApplicaAdmin } from '
|
|
24
|
+
* import { ApplicaAdmin } from '.';
|
|
25
25
|
* import { createAuthProvider } from '@applica-software-guru/iam-client';
|
|
26
26
|
* import { createDataProvider } from '@applica-software-guru/crud-client';
|
|
27
27
|
* import * as entities from './entities';
|
package/index.html
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>React-Admin Demo Application</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="root"></div>
|
|
11
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
package/package.json
CHANGED
package/src/main.tsx
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import App from './playground/App';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import ReactDOM from 'react-dom/client';
|
|
4
|
+
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
6
|
+
ReactDOM.createRoot(document.getElementById('root')!).render(
|
|
7
|
+
<React.StrictMode>
|
|
8
|
+
<App />
|
|
9
|
+
</React.StrictMode>
|
|
10
|
+
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '@applica-software-guru/react-admin/style.css';
|
|
1
|
+
// import '@applica-software-guru/react-admin/style.css';
|
|
2
2
|
|
|
3
3
|
import * as entities from './entities';
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@ import { API_URL, FILE_FIELDS } from './config';
|
|
|
6
6
|
import { ApplicaAdmin, HttpError, Resource } from '@applica-software-guru/react-admin';
|
|
7
7
|
import { createAttachmentsParser, createDataProvider } from '@applica-software-guru/crud-client';
|
|
8
8
|
|
|
9
|
-
import { CustomPage } from 'components/pages';
|
|
9
|
+
import { CustomPage } from './components/pages';
|
|
10
10
|
import { CustomRoutes } from 'ra-core';
|
|
11
11
|
import { Route } from 'react-router-dom';
|
|
12
12
|
import build from './build.json';
|
|
@@ -12,7 +12,7 @@ const AlertBox = () => {
|
|
|
12
12
|
);
|
|
13
13
|
};
|
|
14
14
|
const DeviceList = () => (
|
|
15
|
-
<List perPage={25} filters={[<SearchInput source="keyword" alwaysOn />]}>
|
|
15
|
+
<List perPage={25} filters={[<SearchInput key="keyword" source="keyword" alwaysOn />]}>
|
|
16
16
|
<AlertBox />
|
|
17
17
|
<Datagrid rowClick="edit">
|
|
18
18
|
<TextField source="id" />
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Create, Edit } from '@applica-software-guru/react-admin';
|
|
2
|
-
import { UserForm, UserList } from 'components';
|
|
2
|
+
import { UserForm, UserList } from '../components';
|
|
3
3
|
|
|
4
|
-
import { CONFIGURED_ROLES } from 'config';
|
|
4
|
+
import { CONFIGURED_ROLES } from '../config';
|
|
5
5
|
import { UserOutlined } from '@ant-design/icons';
|
|
6
6
|
|
|
7
7
|
const UserCreate = () => (
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/vite.config.js
CHANGED
|
@@ -8,6 +8,11 @@ import { resolve } from 'node:path';
|
|
|
8
8
|
|
|
9
9
|
const { EsLinter, linterPlugin } = EsLint;
|
|
10
10
|
export default defineConfig((configEnv) => ({
|
|
11
|
+
resolve: {
|
|
12
|
+
alias: {
|
|
13
|
+
'@applica-software-guru/react-admin': resolve(__dirname, 'src')
|
|
14
|
+
}
|
|
15
|
+
},
|
|
11
16
|
plugins: [
|
|
12
17
|
dts({
|
|
13
18
|
include: ['./src/**/*.{js,jsx,ts,tsx}']
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
const webpack = require('webpack');
|
|
2
|
-
const WorkBoxPlugin = require('workbox-webpack-plugin');
|
|
3
|
-
|
|
4
|
-
module.exports = function override(config) {
|
|
5
|
-
config.resolve.fallback = {
|
|
6
|
-
process: require.resolve('process/browser'),
|
|
7
|
-
// zlib: require.resolve('browserify-zlib'),
|
|
8
|
-
stream: require.resolve('stream-browserify'),
|
|
9
|
-
crypto: require.resolve('crypto-browserify'),
|
|
10
|
-
util: require.resolve('util'),
|
|
11
|
-
buffer: require.resolve('buffer')
|
|
12
|
-
// asset: require.resolve('assert')
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
// https://stackoverflow.com/questions/69135310/workaround-for-cache-size-limit-in-create-react-app-pwa-service-worker
|
|
16
|
-
config.plugins.forEach((plugin) => {
|
|
17
|
-
if (plugin instanceof WorkBoxPlugin.InjectManifest) {
|
|
18
|
-
plugin.config.maximumFileSizeToCacheInBytes = 50 * 1024 * 1024;
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
config.plugins = [
|
|
23
|
-
...config.plugins,
|
|
24
|
-
new webpack.ProvidePlugin({
|
|
25
|
-
process: 'process/browser.js',
|
|
26
|
-
Buffer: ['buffer', 'Buffer']
|
|
27
|
-
})
|
|
28
|
-
];
|
|
29
|
-
|
|
30
|
-
return config;
|
|
31
|
-
};
|