@guillotinaweb/react-gmi 0.20.1 → 0.22.2
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/CHANGELOG.md +17 -0
- package/README.md +18 -10
- package/dist/components/fields/editableField.d.ts +0 -2
- package/dist/components/fields/renderField.d.ts +8 -0
- package/dist/components/login.d.ts +7 -14
- package/dist/components/selected_items_actions.d.ts +5 -2
- package/dist/hooks/useConfig.d.ts +2 -0
- package/dist/hooks/useRegistry.d.ts +2 -0
- package/dist/lib/client.d.ts +5 -4
- package/dist/lib/rest.d.ts +2 -1
- package/dist/react-gmi.esm.js +2179 -2142
- package/dist/react-gmi.esm.js.map +1 -1
- package/dist/react-gmi.js +2178 -2141
- package/dist/react-gmi.js.map +1 -1
- package/dist/react-gmi.modern.js +1721 -1680
- package/dist/react-gmi.modern.js.map +1 -1
- package/dist/react-gmi.umd.js +2178 -2141
- package/dist/react-gmi.umd.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
0.22.2
|
|
2
|
+
------
|
|
3
|
+
- chore: update dependences
|
|
4
|
+
|
|
5
|
+
0.22.1
|
|
6
|
+
------
|
|
7
|
+
- Fix export
|
|
8
|
+
|
|
9
|
+
0.22.0
|
|
10
|
+
------
|
|
11
|
+
- Refactor get current context in client and rest utilities. #118
|
|
12
|
+
- Fixed default values in copy action
|
|
13
|
+
- Added some tests of copy and move elements in panel of items.
|
|
14
|
+
|
|
15
|
+
0.21.0
|
|
16
|
+
------
|
|
17
|
+
- Allow override RenderFieldComponent. #146
|
|
1
18
|
|
|
2
19
|
0.20.1
|
|
3
20
|
------
|
package/README.md
CHANGED
|
@@ -42,32 +42,36 @@ import { useState } from 'react'
|
|
|
42
42
|
import '@guillotinaweb/react-gmi/dist/css/style.css'
|
|
43
43
|
|
|
44
44
|
// guillotina url
|
|
45
|
-
let url = 'http://localhost:8080
|
|
46
|
-
|
|
45
|
+
let url = 'http://localhost:8080'
|
|
46
|
+
const schema = '/'
|
|
47
47
|
const auth = new Auth(url)
|
|
48
|
-
const client = getClient(url, auth)
|
|
48
|
+
const client = getClient(url, schema, auth)
|
|
49
49
|
|
|
50
50
|
function App() {
|
|
51
51
|
const [isLogged, setLogged] = useState(auth.isLogged)
|
|
52
52
|
|
|
53
|
-
// You can do whatever you want on login, this includes,
|
|
54
|
-
// if you have a router, move it to it's user home folder,
|
|
55
|
-
// or the root...
|
|
56
53
|
const onLogin = () => {
|
|
57
54
|
setLogged(true)
|
|
58
55
|
}
|
|
59
|
-
|
|
56
|
+
|
|
57
|
+
const onLogout = () => {
|
|
58
|
+
setLogged(false);
|
|
59
|
+
};
|
|
60
60
|
|
|
61
61
|
auth.onLogout = onLogout
|
|
62
62
|
|
|
63
63
|
return (
|
|
64
64
|
<ClientProvider client={client}>
|
|
65
65
|
<Layout auth={auth} onLogout={onLogout}>
|
|
66
|
-
{isLogged && <Guillotina auth={auth} url={
|
|
66
|
+
{isLogged && <Guillotina auth={auth} url={schema} />}
|
|
67
67
|
{!isLogged && (
|
|
68
68
|
<div className="columns is-centered">
|
|
69
69
|
<div className="columns is-half">
|
|
70
|
-
|
|
70
|
+
<Login
|
|
71
|
+
onLogin={onLogin}
|
|
72
|
+
auth={auth}
|
|
73
|
+
currentSchema={schema}
|
|
74
|
+
/>
|
|
71
75
|
</div>
|
|
72
76
|
</div>
|
|
73
77
|
)}
|
|
@@ -76,6 +80,7 @@ function App() {
|
|
|
76
80
|
)
|
|
77
81
|
}
|
|
78
82
|
|
|
83
|
+
|
|
79
84
|
export default App
|
|
80
85
|
```
|
|
81
86
|
|
|
@@ -103,6 +108,7 @@ curl https://raw.githubusercontent.com/guillotinaweb/guillotina_react/master/pub
|
|
|
103
108
|
|
|
104
109
|
- [Howto Extend Guillotina React form outside?](docs/extend.md)
|
|
105
110
|
- [Narrative Docs](docs/api.md)
|
|
111
|
+
- [Getting Started - Step by Step](docs/tutorial/tutorial.md)
|
|
106
112
|
|
|
107
113
|
## Develop
|
|
108
114
|
|
|
@@ -121,6 +127,8 @@ yarn start
|
|
|
121
127
|
|
|
122
128
|
## Sponsors
|
|
123
129
|
|
|
124
|
-
This project is sponsored by <a href="https://www.vinissimus.com">Vinissimus Wine Shop</a>
|
|
130
|
+
This project is sponsored by <a href="https://www.vinissimus.com">Vinissimus Wine Shop</a> and <a href="https://iskra.cat">Iskra</a>
|
|
125
131
|
|
|
126
132
|
<a href="https://www.vinissimus.com"><img src="https://cdn.vinissimus.com/front/static/images/vinissimus-logo.svg" /></a>
|
|
133
|
+
<br/>
|
|
134
|
+
<a href="https://iskra.cat"><img src="https://storage.googleapis.com/iskra/iskra-logo.png" /></a>
|
|
@@ -2,3 +2,11 @@ export function RenderField({ value, Widget }: {
|
|
|
2
2
|
value: any;
|
|
3
3
|
Widget: any;
|
|
4
4
|
}): any;
|
|
5
|
+
export function RenderFieldComponent({ schema, field, val, modifyContent }: {
|
|
6
|
+
schema: any;
|
|
7
|
+
field: any;
|
|
8
|
+
val: any;
|
|
9
|
+
modifyContent: any;
|
|
10
|
+
}): any;
|
|
11
|
+
export const DEFAULT_VALUE_EDITABLE_FIELD: "Click to edit";
|
|
12
|
+
export const DEFAULT_VALUE_NO_EDITABLE_FIELD: " -- ";
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
errors: any;
|
|
9
|
-
};
|
|
10
|
-
ref: any;
|
|
11
|
-
doLogin: (ev: any) => Promise<void>;
|
|
12
|
-
componentDidMount(): void;
|
|
13
|
-
render(): any;
|
|
14
|
-
}
|
|
1
|
+
export function Login({ currentSchema, setCurrentSchema, schemas, auth, onLogin, }: {
|
|
2
|
+
currentSchema: any;
|
|
3
|
+
setCurrentSchema: any;
|
|
4
|
+
schemas: any;
|
|
5
|
+
auth: any;
|
|
6
|
+
onLogin: any;
|
|
7
|
+
}): any;
|
|
@@ -2,9 +2,12 @@ export function ItemsActionsProvider({ items, children }: {
|
|
|
2
2
|
items: any;
|
|
3
3
|
children: any;
|
|
4
4
|
}): any;
|
|
5
|
-
export function AllItemsCheckbox(
|
|
6
|
-
|
|
5
|
+
export function AllItemsCheckbox({ dataTest }: {
|
|
6
|
+
dataTest: any;
|
|
7
|
+
}): any;
|
|
8
|
+
export function ItemCheckbox({ item, dataTest }: {
|
|
7
9
|
item: any;
|
|
10
|
+
dataTest: any;
|
|
8
11
|
}): any;
|
|
9
12
|
export function ItemsActionsDropdown(): any;
|
|
10
13
|
export namespace actions {
|
|
@@ -4,6 +4,7 @@ export function useConfig(cfg: any): {
|
|
|
4
4
|
DelayActions: number;
|
|
5
5
|
Permissions: string[];
|
|
6
6
|
SearchEngine: string;
|
|
7
|
+
fieldHaveDeleteButton: (schema: any) => boolean;
|
|
7
8
|
};
|
|
8
9
|
export const Permissions: string[];
|
|
9
10
|
export namespace Config {
|
|
@@ -12,4 +13,5 @@ export namespace Config {
|
|
|
12
13
|
export const DelayActions: number;
|
|
13
14
|
export { Permissions };
|
|
14
15
|
export const SearchEngine: string;
|
|
16
|
+
export function fieldHaveDeleteButton(schema: any): boolean;
|
|
15
17
|
}
|
|
@@ -48,6 +48,7 @@ export function useRegistry(data: any): {
|
|
|
48
48
|
components: {
|
|
49
49
|
Path: typeof Path;
|
|
50
50
|
EditComponent: any;
|
|
51
|
+
RenderFieldComponent: typeof RenderFieldComponent;
|
|
51
52
|
};
|
|
52
53
|
searchEngineQueryParamsFunction: {
|
|
53
54
|
PostreSQL: string;
|
|
@@ -88,3 +89,4 @@ import { IDublinCore } from "../components/behaviors/idublincore";
|
|
|
88
89
|
import { IAttachment } from "../components/behaviors/iattachment";
|
|
89
90
|
import { IMultiAttachment } from "../components/behaviors/imultiattachment";
|
|
90
91
|
import { Path } from "../components/path";
|
|
92
|
+
import { RenderFieldComponent } from "../components/fields/renderField";
|
package/dist/lib/client.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
export function getClient(url: any,
|
|
1
|
+
export function getClient(url: any, container: any, auth: any): GuillotinaClient;
|
|
2
2
|
export class GuillotinaClient {
|
|
3
|
-
constructor(rest: any,
|
|
3
|
+
constructor(rest: any, pathContainsContainer: any);
|
|
4
4
|
rest: any;
|
|
5
|
-
|
|
5
|
+
pathContainsContainer: any;
|
|
6
|
+
getContainerFromPath: (path: any) => string;
|
|
7
|
+
clearContainerFromPath: (path: any) => any;
|
|
6
8
|
getContext(path: any): Promise<any>;
|
|
7
9
|
get(path: any): Promise<any>;
|
|
8
10
|
getQueryParamsPostresql({ start, pageSize, withDepth }: {
|
|
@@ -45,5 +47,4 @@ export class GuillotinaClient {
|
|
|
45
47
|
getAllPermissions(path: any): Promise<any[]>;
|
|
46
48
|
getTypes(path: any): Promise<any>;
|
|
47
49
|
}
|
|
48
|
-
export function getContainerFromPath(path: any): string;
|
|
49
50
|
export function lightFileReader(file: any): Promise<any>;
|
package/dist/lib/rest.d.ts
CHANGED