ywana-core8 0.0.745 → 0.0.747
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/dist/index.cjs +50 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +50 -29
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +50 -29
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/CollectionPage.js +11 -7
- package/src/widgets/login/ResetPasswordBox.js +20 -13
package/package.json
CHANGED
@@ -81,7 +81,7 @@ export const CollectionPage = (props) => {
|
|
81
81
|
</Header>
|
82
82
|
<menu className={`collection-page ${className} ${hiddenStyle}`}>
|
83
83
|
{canFilter ? <CollectionFilters schema={schema} initial={filters} /> : null}
|
84
|
-
{levels ? <CollectionTree schema={schema} icon={icon} levels={levels} onSelect={onSelect} sorter={sorter} searchBy={searchBy} namer={namer} /> : <CollectionList groupBy={groupBy} onSelect={onSelect} searchBy={searchBy} itemRenderer={listItemRenderer} />}
|
84
|
+
{levels ? <CollectionTree schema={schema} icon={icon} levels={levels} onSelect={onSelect} sorter={sorter} searchBy={searchBy} namer={namer} /> : <CollectionList groupBy={groupBy} onSelect={onSelect} searchBy={searchBy} itemRenderer={listItemRenderer} sorter={sorter} />}
|
85
85
|
</menu>
|
86
86
|
<main key={id} className={`collection-page ${className}`}>
|
87
87
|
<CollectionEditor icon={icon} schema={schema} layout={editor} autosave={autosave} delay={delay} canDelete={canDelete} onReload={reloadSelection} patch={patch} onChange={onChange} actions={editorActions} title={editorTitle} />
|
@@ -189,7 +189,7 @@ const FilterResume = (props) => {
|
|
189
189
|
*/
|
190
190
|
const CollectionList = (props) => {
|
191
191
|
|
192
|
-
const { groupBy, onSelect, searchBy = [], itemRenderer } = props
|
192
|
+
const { groupBy, onSelect, searchBy = [], itemRenderer, sorter } = props
|
193
193
|
const [pageContext, setPageContext] = useContext(PageContext)
|
194
194
|
const { all = [] } = pageContext
|
195
195
|
const [filter, setFilter] = useState()
|
@@ -221,8 +221,9 @@ const CollectionList = (props) => {
|
|
221
221
|
return items
|
222
222
|
}
|
223
223
|
|
224
|
-
const
|
225
|
-
const
|
224
|
+
const searched = search()
|
225
|
+
const sorted = sorter ? sorter(searched) : searched
|
226
|
+
const items2 = sorted.map(content => {
|
226
227
|
if (itemRenderer) return itemRenderer(content)
|
227
228
|
return {
|
228
229
|
id: content.id,
|
@@ -375,9 +376,12 @@ const CollectionEditor = (props) => {
|
|
375
376
|
}
|
376
377
|
|
377
378
|
async function remove() {
|
378
|
-
|
379
|
-
|
380
|
-
|
379
|
+
const accept = site.confirm("¿ Esta seguro ?")
|
380
|
+
if (accept === true) {
|
381
|
+
await pageContext.remove(selected.id)
|
382
|
+
pageContext.clear()
|
383
|
+
setPageContext(Object.assign({}, pageContext))
|
384
|
+
}
|
381
385
|
}
|
382
386
|
|
383
387
|
function change(next) {
|
@@ -1,13 +1,13 @@
|
|
1
|
-
import React, {
|
1
|
+
import React, { useState } from 'react'
|
2
2
|
import { TextField, Text, Button } from '../../html'
|
3
3
|
import './ResetPasswordBox.css'
|
4
4
|
|
5
5
|
/**
|
6
6
|
* Reset Password
|
7
7
|
*/
|
8
|
-
export const ResetPasswordBox = ({ logo, title, children, onOK, onClose }) => {
|
8
|
+
export const ResetPasswordBox = ({ logo, title, userRequired = true, lang = "EN", children, onOK, onClose }) => {
|
9
9
|
|
10
|
-
const [form, setForm
|
10
|
+
const [form, setForm] = useState({})
|
11
11
|
const [error, setError] = useState()
|
12
12
|
|
13
13
|
function canOK() {
|
@@ -15,13 +15,13 @@ export const ResetPasswordBox = ({ logo, title, children, onOK, onClose }) => {
|
|
15
15
|
}
|
16
16
|
|
17
17
|
function changeField(id, value) {
|
18
|
-
const next = Object.assign({}, form, {[id]: value})
|
18
|
+
const next = Object.assign({}, form, { [id]: value })
|
19
19
|
setForm(next)
|
20
20
|
}
|
21
21
|
|
22
22
|
function ok() {
|
23
23
|
if (onOK && canOK()) {
|
24
|
-
if (form.password1 === form.password2
|
24
|
+
if (form.password1 === form.password2) {
|
25
25
|
setError(null)
|
26
26
|
onOK(form)
|
27
27
|
} else {
|
@@ -34,23 +34,30 @@ export const ResetPasswordBox = ({ logo, title, children, onOK, onClose }) => {
|
|
34
34
|
if (onClose) onClose()
|
35
35
|
}
|
36
36
|
|
37
|
+
const text = lang === "EN" ? "CHANGE PASSWORD" : "CAMBIO DE CLAVE"
|
38
|
+
const userLabel = lang === "EN" ? "User" : "Usuario"
|
39
|
+
const passwordLabel = lang === "EN" ? "New Password" : "Nueva Clave"
|
40
|
+
const password2Label = lang === "EN" ? "Confirm New Password" : "Confirmar Nueva Clave"
|
41
|
+
const okLabel = lang === "EN" ? "OK" : "Aceptar"
|
42
|
+
const cancelLabel = lang === "EN" ? "Cancel" : "Cancelar"
|
43
|
+
|
37
44
|
return (
|
38
45
|
<div className="reset-password-box">
|
39
46
|
<header>
|
40
47
|
{logo ? <img src={logo} /> : null}
|
41
48
|
{title ? <div className="title"><Text>{title}</Text></div> : null}
|
42
|
-
{
|
49
|
+
{children}
|
43
50
|
</header>
|
44
51
|
<main>
|
45
|
-
<Text use="headline6">
|
46
|
-
<TextField id="user"
|
47
|
-
<TextField id="password1" outlined icon="lock" type="password" label=
|
48
|
-
<TextField id="password2" outlined icon="lock" type="password" label=
|
49
|
-
{
|
52
|
+
<Text use="headline6">{text}</Text>
|
53
|
+
{userRequired ? <TextField id="user" outlined icon="person" label={userLabel} lapse={100} onChange={changeField} onEnter={ok} /> : null}
|
54
|
+
<TextField id="password1" outlined icon="lock" type="password" label={passwordLabel} lapse={100} onChange={changeField} onEnter={ok} />
|
55
|
+
<TextField id="password2" outlined icon="lock" type="password" label={password2Label} lapse={100} onChange={changeField} onEnter={ok} />
|
56
|
+
{error ? <div className="error">{error}</div> : null}
|
50
57
|
</main>
|
51
58
|
<footer>
|
52
|
-
<Button label=
|
53
|
-
<Button label=
|
59
|
+
<Button label={cancelLabel} action={close} />
|
60
|
+
<Button label={okLabel} raised disabled={!canOK()} action={ok} />
|
54
61
|
</footer>
|
55
62
|
</div>
|
56
63
|
)
|