@kaspernj/api-maker 1.0.461 → 1.0.463
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/build/bootstrap/attribute-row.js +3 -2
- package/build/bootstrap/sort-link.js +5 -5
- package/build/cable-subscription-pool.js +3 -3
- package/build/channels-consumer.js +7 -2
- package/build/collection.js +2 -1
- package/build/config.js +8 -2
- package/build/devise.js +9 -6
- package/build/history-expo.js +24 -0
- package/build/history-react-native.js +20 -0
- package/build/inputs/checkbox.js +1 -8
- package/build/link.js +6 -2
- package/build/router.js +2 -2
- package/build/session-status-updater.js +11 -3
- package/build/super-admin/edit-page.js +2 -2
- package/build/super-admin/index.js +2 -2
- package/build/super-admin/layout/header/index.js +23 -14
- package/build/super-admin/layout/index.js +69 -14
- package/build/super-admin/layout/menu/index.js +131 -20
- package/build/super-admin/show-nav.js +2 -2
- package/build/super-admin/show-reflection-page.js +2 -2
- package/build/table/filters/filter.js +3 -3
- package/build/table/filters/index.js +2 -2
- package/build/table/header-column.js +3 -3
- package/build/table/model-row.js +5 -5
- package/build/table/settings/download-action.js +3 -3
- package/build/table/table.js +5 -5
- package/build/table/use-sorting.js +2 -2
- package/build/translated-collections.js +2 -2
- package/build/use-breakpoint.js +20 -2
- package/build/use-collection.js +2 -2
- package/build/use-current-user.js +6 -2
- package/build/use-model.js +2 -2
- package/build/utils/icon.js +23 -0
- package/build/utils/modal.js +3 -3
- package/build/with-api-maker.js +29 -0
- package/package.json +4 -2
- package/src/bootstrap/attribute-row.jsx +2 -1
- package/src/bootstrap/sort-link.jsx +4 -4
- package/src/cable-subscription-pool.js +2 -2
- package/src/channels-consumer.js +7 -1
- package/src/collection.js +1 -0
- package/src/config.js +3 -1
- package/src/devise.js +7 -7
- package/src/history-expo.js +25 -0
- package/src/history-react-native.js +25 -0
- package/src/inputs/checkbox.jsx +0 -4
- package/src/link.jsx +6 -1
- package/src/router.jsx +1 -1
- package/src/session-status-updater.js +12 -2
- package/src/super-admin/edit-page.jsx +1 -1
- package/src/super-admin/index.jsx +1 -1
- package/src/super-admin/layout/header/index.jsx +27 -16
- package/src/super-admin/layout/header/style.scss +0 -11
- package/src/super-admin/layout/index.jsx +61 -15
- package/src/super-admin/layout/menu/index.jsx +124 -40
- package/src/super-admin/layout/menu/style.scss +0 -94
- package/src/super-admin/show-nav.jsx +1 -1
- package/src/super-admin/show-reflection-page.jsx +1 -1
- package/src/table/filters/filter.jsx +2 -2
- package/src/table/filters/index.jsx +1 -1
- package/src/table/header-column.jsx +2 -2
- package/src/table/model-row.jsx +4 -4
- package/src/table/settings/download-action.jsx +2 -2
- package/src/table/table.jsx +4 -4
- package/src/table/use-sorting.js +1 -1
- package/src/translated-collections.js +1 -1
- package/src/use-breakpoint.js +25 -1
- package/src/use-collection.js +1 -1
- package/src/use-current-user.js +5 -2
- package/src/use-model.js +1 -1
- package/src/utils/icon.jsx +21 -0
- package/src/utils/modal.jsx +2 -2
- package/src/with-api-maker.jsx +31 -0
- package/build/history.native.js +0 -10
- package/src/history.native.js +0 -9
- package/src/super-admin/layout/style.scss +0 -25
package/src/link.jsx
CHANGED
|
@@ -5,12 +5,17 @@ import memo from "set-state-compare/src/memo"
|
|
|
5
5
|
import PropTypes from "prop-types"
|
|
6
6
|
import React from "react"
|
|
7
7
|
import {shapeComponent} from "set-state-compare/src/shape-component"
|
|
8
|
+
import {useApiMaker} from "@kaspernj/api-maker/build/with-api-maker"
|
|
8
9
|
|
|
9
10
|
export default memo(shapeComponent(class ApiMakerLink extends BaseComponent {
|
|
10
11
|
static propTypes = {
|
|
11
12
|
usePressable: PropTypes.bool
|
|
12
13
|
}
|
|
13
14
|
|
|
15
|
+
setup() {
|
|
16
|
+
this.apiMaker = useApiMaker()
|
|
17
|
+
}
|
|
18
|
+
|
|
14
19
|
render() {
|
|
15
20
|
const {dataSet, to, onClick, onPress, usePressable, ...restProps} = this.props
|
|
16
21
|
|
|
@@ -58,7 +63,7 @@ export default memo(shapeComponent(class ApiMakerLink extends BaseComponent {
|
|
|
58
63
|
}
|
|
59
64
|
|
|
60
65
|
redirect = () => {
|
|
61
|
-
const history =
|
|
66
|
+
const history = this.apiMaker.config.getHistory()
|
|
62
67
|
|
|
63
68
|
if (!history) throw new Error("History hasn't been set in the API maker configuration")
|
|
64
69
|
|
package/src/router.jsx
CHANGED
|
@@ -4,7 +4,7 @@ import propTypesExact from "prop-types-exact"
|
|
|
4
4
|
import React, {memo} from "react"
|
|
5
5
|
import {shapeComponent} from "set-state-compare/src/shape-component"
|
|
6
6
|
import {Suspense} from "react"
|
|
7
|
-
import usePath from "on-location-changed/
|
|
7
|
+
import usePath from "on-location-changed/build/use-path"
|
|
8
8
|
import useRouter from "./use-router"
|
|
9
9
|
|
|
10
10
|
export default memo(shapeComponent(class ApiMakerRouter extends BaseComponent {
|
|
@@ -21,9 +21,19 @@ export default class ApiMakerSessionStatusUpdater {
|
|
|
21
21
|
constructor(args = {}) {
|
|
22
22
|
this.events = {}
|
|
23
23
|
this.timeout = args.timeout || 600000
|
|
24
|
-
this.useMetaElement = ("useMetaElement" in args) ? args.useMetaElement : true
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
if ("useMetaElement" in args) {
|
|
26
|
+
this.useMetaElement = args.useMetaElement
|
|
27
|
+
} else if (typeof document != "undefined") {
|
|
28
|
+
this.useMetaElement = true
|
|
29
|
+
} else {
|
|
30
|
+
this.useMetaElement = false
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (typeof window != "undefined") {
|
|
34
|
+
this.connectOnlineEvent()
|
|
35
|
+
}
|
|
36
|
+
|
|
27
37
|
this.connectWakeEvent()
|
|
28
38
|
}
|
|
29
39
|
|
|
@@ -16,7 +16,7 @@ import {shapeComponent} from "set-state-compare/src/shape-component"
|
|
|
16
16
|
import Text from "../utils/text"
|
|
17
17
|
import useCurrentUser from "../use-current-user"
|
|
18
18
|
import useModel from "../use-model"
|
|
19
|
-
import useQueryParams from "on-location-changed/
|
|
19
|
+
import useQueryParams from "on-location-changed/build/use-query-params"
|
|
20
20
|
|
|
21
21
|
export default memo(shapeComponent(class ApiMakerSuperAdminEditPage extends BaseComponent {
|
|
22
22
|
static propTypes = propTypesExact({
|
|
@@ -17,7 +17,7 @@ import ShowReflectionPage from "./show-reflection-page"
|
|
|
17
17
|
import Text from "../utils/text"
|
|
18
18
|
import useCanCan from "../use-can-can"
|
|
19
19
|
import useCurrentUser from "../use-current-user"
|
|
20
|
-
import useQueryParams from "on-location-changed/
|
|
20
|
+
import useQueryParams from "on-location-changed/build/use-query-params"
|
|
21
21
|
|
|
22
22
|
export default memo(shapeComponent(class ApiMakerSuperAdmin extends BaseComponent {
|
|
23
23
|
setup() {
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
// import "../../../../src/super-admin/layout/header/style"
|
|
2
|
+
import React, {useRef} from "react"
|
|
2
3
|
import BaseComponent from "../../../base-component"
|
|
3
|
-
import
|
|
4
|
+
import Icon from "../../../utils/icon"
|
|
4
5
|
import memo from "set-state-compare/src/memo"
|
|
5
|
-
import {useRef} from "react"
|
|
6
6
|
import PropTypes from "prop-types"
|
|
7
7
|
import PropTypesExact from "prop-types-exact"
|
|
8
|
-
import React from "react"
|
|
9
8
|
import {shapeComponent} from "set-state-compare/src/shape-component"
|
|
10
9
|
import Text from "../../../utils/text"
|
|
11
10
|
import {Pressable, View} from "react-native"
|
|
@@ -20,10 +19,10 @@ export default memo(shapeComponent(class ApiMakerSuperAdminLayoutHeader extends
|
|
|
20
19
|
})
|
|
21
20
|
|
|
22
21
|
setup() {
|
|
23
|
-
const {name: breakpoint} = useBreakpoint()
|
|
22
|
+
const {name: breakpoint, mdUp} = useBreakpoint()
|
|
24
23
|
|
|
25
24
|
this.headerActionsRef = useRef()
|
|
26
|
-
this.setInstance({breakpoint})
|
|
25
|
+
this.setInstance({breakpoint, mdUp})
|
|
27
26
|
this.useStates({
|
|
28
27
|
headerActionsActive: false
|
|
29
28
|
})
|
|
@@ -32,7 +31,7 @@ export default memo(shapeComponent(class ApiMakerSuperAdminLayoutHeader extends
|
|
|
32
31
|
}
|
|
33
32
|
|
|
34
33
|
render() {
|
|
35
|
-
const {breakpoint} = this.tt
|
|
34
|
+
const {breakpoint, mdUp} = this.tt
|
|
36
35
|
const {actions, onTriggerMenu, title} = this.props
|
|
37
36
|
|
|
38
37
|
const headerStyle = {
|
|
@@ -108,21 +107,33 @@ export default memo(shapeComponent(class ApiMakerSuperAdminLayoutHeader extends
|
|
|
108
107
|
</View>
|
|
109
108
|
</View>
|
|
110
109
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
110
|
+
{!mdUp &&
|
|
111
|
+
<View
|
|
112
|
+
dataSet={{class: "burger-menu-container"}}
|
|
113
|
+
style={{
|
|
114
|
+
flexDirection: "row",
|
|
115
|
+
marginLeft: "auto"
|
|
116
|
+
}}
|
|
117
|
+
>
|
|
118
|
+
{actions &&
|
|
119
|
+
<Pressable dataSet={{class: "actions-link"}} onPress={this.tt.onGearsClicked} style={{marginRight: 8, fontSize: 22}}>
|
|
120
|
+
<Icon name="gear" size={20} />
|
|
121
|
+
</Pressable>
|
|
122
|
+
}
|
|
123
|
+
<Pressable dataSet={{class: "burger-menu-link"}} onPress={onTriggerMenu}>
|
|
124
|
+
<Icon name="bars" size={20} />
|
|
115
125
|
</Pressable>
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
<FontAwesomeIcon icon="bars" size={20} />
|
|
119
|
-
</Pressable>
|
|
120
|
-
</View>
|
|
126
|
+
</View>
|
|
127
|
+
}
|
|
121
128
|
</View>
|
|
122
129
|
)
|
|
123
130
|
}
|
|
124
131
|
|
|
125
|
-
onGearsClicked = () =>
|
|
132
|
+
onGearsClicked = () => {
|
|
133
|
+
console.log("onGearsClicked")
|
|
134
|
+
|
|
135
|
+
this.setState({headerActionsActive: !this.s.headerActionsActive})
|
|
136
|
+
}
|
|
126
137
|
|
|
127
138
|
onWindowMouseUp = (e) => {
|
|
128
139
|
// Close the header actions menu if clicked happened outside
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// import "../../../src/super-admin/layout/style"
|
|
2
1
|
import React, {useMemo} from "react"
|
|
2
|
+
import {StyleSheet, View} from "react-native"
|
|
3
3
|
import BaseComponent from "../../base-component"
|
|
4
4
|
import CommandsPool from "../../commands-pool"
|
|
5
5
|
import config from "super-admin/config"
|
|
@@ -9,12 +9,48 @@ import Menu from "./menu"
|
|
|
9
9
|
import PropTypes from "prop-types"
|
|
10
10
|
import PropTypesExact from "prop-types-exact"
|
|
11
11
|
import {shapeComponent} from "set-state-compare/src/shape-component"
|
|
12
|
+
import Text from "../../utils/text"
|
|
13
|
+
import useBreakpoint from "../../use-breakpoint"
|
|
12
14
|
import useCurrentUser from "../../use-current-user"
|
|
13
15
|
import useI18n from "i18n-on-steroids/src/use-i18n"
|
|
14
|
-
import {View} from "react-native"
|
|
15
16
|
|
|
16
17
|
const NoAccess = React.lazy(() => import("./no-access"))
|
|
17
18
|
|
|
19
|
+
const styles = StyleSheet.create({
|
|
20
|
+
appLayoutContentContainer: {
|
|
21
|
+
base: {
|
|
22
|
+
minHeight: "100vh",
|
|
23
|
+
backgroundColor: "#f7f7f7"
|
|
24
|
+
},
|
|
25
|
+
mdDown: {
|
|
26
|
+
paddingTop: 130,
|
|
27
|
+
paddingRight: 30,
|
|
28
|
+
paddingBottom: 30
|
|
29
|
+
},
|
|
30
|
+
mdUp: {
|
|
31
|
+
paddingTop: 130,
|
|
32
|
+
paddingRight: 30,
|
|
33
|
+
paddingBottom: 30,
|
|
34
|
+
paddingLeft: 280
|
|
35
|
+
},
|
|
36
|
+
lgUp: {
|
|
37
|
+
paddingTop: 130,
|
|
38
|
+
paddingRight: 30,
|
|
39
|
+
paddingBottom: 30,
|
|
40
|
+
paddingLeft: 320
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
mb15: {
|
|
44
|
+
marginBottom: 15
|
|
45
|
+
},
|
|
46
|
+
rootView: {
|
|
47
|
+
width: "100%",
|
|
48
|
+
minHeight: "100vh",
|
|
49
|
+
backgroundColor: "#fff",
|
|
50
|
+
color: "#000"
|
|
51
|
+
}
|
|
52
|
+
})
|
|
53
|
+
|
|
18
54
|
export default memo(shapeComponent(class ApiMakerSuperAdminLayout extends BaseComponent {
|
|
19
55
|
static propTypes = PropTypesExact({
|
|
20
56
|
actions: PropTypes.node,
|
|
@@ -31,9 +67,10 @@ export default memo(shapeComponent(class ApiMakerSuperAdminLayout extends BaseCo
|
|
|
31
67
|
setup() {
|
|
32
68
|
const currentUser = useCurrentUser()
|
|
33
69
|
const {locale, t} = useI18n({namespace: "js.api_maker.super_admin.layout"})
|
|
70
|
+
const {lgUp, mdUp, mdDown} = useBreakpoint()
|
|
34
71
|
|
|
35
72
|
this.useStates({menuTriggered: false})
|
|
36
|
-
this.setInstance({currentUser, t})
|
|
73
|
+
this.setInstance({currentUser, lgUp, mdUp, mdDown, t})
|
|
37
74
|
|
|
38
75
|
useMemo(() => {
|
|
39
76
|
CommandsPool.current().globalRequestData.layout = "admin"
|
|
@@ -42,7 +79,7 @@ export default memo(shapeComponent(class ApiMakerSuperAdminLayout extends BaseCo
|
|
|
42
79
|
}
|
|
43
80
|
|
|
44
81
|
render() {
|
|
45
|
-
const {currentUser, t} = this.tt
|
|
82
|
+
const {currentUser, lgUp, mdUp, mdDown, t} = this.tt
|
|
46
83
|
const {
|
|
47
84
|
actions,
|
|
48
85
|
active,
|
|
@@ -50,22 +87,31 @@ export default memo(shapeComponent(class ApiMakerSuperAdminLayout extends BaseCo
|
|
|
50
87
|
className,
|
|
51
88
|
currentCustomer,
|
|
52
89
|
currentCustomerId,
|
|
90
|
+
headTitle,
|
|
53
91
|
headerTitle,
|
|
54
92
|
menu,
|
|
55
93
|
...restProps
|
|
56
94
|
} = this.props
|
|
57
|
-
const
|
|
95
|
+
const actualHeadTitle = headTitle || headerTitle
|
|
58
96
|
|
|
59
|
-
if (
|
|
60
|
-
document.title =
|
|
97
|
+
if (actualHeadTitle) {
|
|
98
|
+
document.title = actualHeadTitle
|
|
61
99
|
} else {
|
|
62
|
-
document.title = "
|
|
100
|
+
document.title = "Super Admin"
|
|
63
101
|
}
|
|
64
102
|
|
|
65
103
|
const noAccess = !currentUser
|
|
104
|
+
const appLayoutContentContainerStyles = [styles.appLayoutContentContainer.base]
|
|
105
|
+
|
|
106
|
+
if (mdDown) appLayoutContentContainerStyles.push(styles.appLayoutContentContainer.mdDown)
|
|
107
|
+
if (mdUp) appLayoutContentContainerStyles.push(styles.appLayoutContentContainer.mdUp)
|
|
108
|
+
if (lgUp) appLayoutContentContainerStyles.push(styles.appLayoutContentContainer.lgUp)
|
|
66
109
|
|
|
67
110
|
return (
|
|
68
|
-
<View
|
|
111
|
+
<View
|
|
112
|
+
dataSet={{component: "super-admin--layout", class: className, menuTriggered: this.s.menuTriggered}}
|
|
113
|
+
style={styles.rootView}
|
|
114
|
+
{...restProps}>
|
|
69
115
|
<Menu
|
|
70
116
|
active={active}
|
|
71
117
|
noAccess={noAccess}
|
|
@@ -73,22 +119,22 @@ export default memo(shapeComponent(class ApiMakerSuperAdminLayout extends BaseCo
|
|
|
73
119
|
triggered={this.s.menuTriggered}
|
|
74
120
|
/>
|
|
75
121
|
<Header actions={actions} onTriggerMenu={this.tt.onTriggerMenu} title={headerTitle} />
|
|
76
|
-
<View dataSet={{class: "app-layout-content-container"}}>
|
|
122
|
+
<View dataSet={{class: "app-layout-content-container"}} style={appLayoutContentContainerStyles}>
|
|
77
123
|
{noAccess &&
|
|
78
124
|
<>
|
|
79
125
|
<NoAccess />
|
|
80
126
|
{currentUser &&
|
|
81
127
|
<>
|
|
82
|
-
<
|
|
128
|
+
<Text style={styles.mb15}>
|
|
83
129
|
{t(".try_signing_out_and_in_with_a_different_user", {defaultValue: "Try signing in with a different user."})}
|
|
84
|
-
</
|
|
130
|
+
</Text>
|
|
85
131
|
</>
|
|
86
132
|
}
|
|
87
133
|
{!currentUser &&
|
|
88
134
|
<>
|
|
89
|
-
<
|
|
135
|
+
<Text style={styles.mb15}>
|
|
90
136
|
{t(".try_signing_in", {defaultValue: "Try signing in."})}
|
|
91
|
-
</
|
|
137
|
+
</Text>
|
|
92
138
|
{config.signInContent()}
|
|
93
139
|
</>
|
|
94
140
|
}
|
|
@@ -103,6 +149,6 @@ export default memo(shapeComponent(class ApiMakerSuperAdminLayout extends BaseCo
|
|
|
103
149
|
onRequestMenuClose = () => this.setState({menuTriggered: false})
|
|
104
150
|
onTriggerMenu = (e) => {
|
|
105
151
|
e.preventDefault()
|
|
106
|
-
|
|
152
|
+
this.setState({menuTriggered: !this.s.menuTriggered})
|
|
107
153
|
}
|
|
108
154
|
}))
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import {StyleSheet, View} from "react-native"
|
|
2
2
|
import BaseComponent from "../../../base-component"
|
|
3
|
+
import Icon from "../../../utils/icon"
|
|
3
4
|
import memo from "set-state-compare/src/memo"
|
|
4
5
|
import Link from "../../../link"
|
|
5
6
|
import MenuContent from "./menu-content"
|
|
@@ -10,9 +11,46 @@ import PropTypesExact from "prop-types-exact"
|
|
|
10
11
|
import React from "react"
|
|
11
12
|
import {shapeComponent} from "set-state-compare/src/shape-component"
|
|
12
13
|
import Text from "../../../utils/text"
|
|
14
|
+
import useBreakpoint from "../../../use-breakpoint"
|
|
13
15
|
import useCurrentUser from "../../../use-current-user"
|
|
14
16
|
import useI18n from "i18n-on-steroids/src/use-i18n"
|
|
15
|
-
import {
|
|
17
|
+
import {WithDefaultStyle} from "../../../utils/default-style"
|
|
18
|
+
|
|
19
|
+
const styles = StyleSheet.create({
|
|
20
|
+
root: {
|
|
21
|
+
base: {
|
|
22
|
+
position: "fixed",
|
|
23
|
+
zIndex: 9,
|
|
24
|
+
overflowY: "auto",
|
|
25
|
+
overflowX: "hidden",
|
|
26
|
+
top: 0,
|
|
27
|
+
left: 0,
|
|
28
|
+
height: "100%",
|
|
29
|
+
flexDirection: "column",
|
|
30
|
+
backgroundColor: "#1b1c1e"
|
|
31
|
+
},
|
|
32
|
+
mdDown: {
|
|
33
|
+
width: "100%",
|
|
34
|
+
maxWidth: 250,
|
|
35
|
+
maxHeight: "100vh",
|
|
36
|
+
overflowY: "auto"
|
|
37
|
+
},
|
|
38
|
+
mdUp: {
|
|
39
|
+
width: 250
|
|
40
|
+
},
|
|
41
|
+
lgUp: {
|
|
42
|
+
width: 290
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
userName: {
|
|
46
|
+
flexShrink: 1,
|
|
47
|
+
marginLeft: 8
|
|
48
|
+
},
|
|
49
|
+
userNameContainer: {
|
|
50
|
+
overflow: "hidden",
|
|
51
|
+
maxWidth: 140
|
|
52
|
+
}
|
|
53
|
+
})
|
|
16
54
|
|
|
17
55
|
export default memo(shapeComponent(class ComponentsAdminLayoutMenu extends BaseComponent {
|
|
18
56
|
static propTypes = PropTypesExact({
|
|
@@ -23,53 +61,99 @@ export default memo(shapeComponent(class ComponentsAdminLayoutMenu extends BaseC
|
|
|
23
61
|
})
|
|
24
62
|
|
|
25
63
|
setup() {
|
|
64
|
+
const {lgUp, mdDown, mdUp} = useBreakpoint()
|
|
26
65
|
const {t} = useI18n({namespace: "js.api_maker.super_admin.layout.menu"})
|
|
27
66
|
const currentUser = useCurrentUser()
|
|
28
67
|
|
|
29
|
-
this.setInstance({currentUser, t})
|
|
68
|
+
this.setInstance({currentUser, lgUp, mdDown, mdUp, t})
|
|
30
69
|
}
|
|
31
70
|
|
|
32
71
|
render() {
|
|
33
|
-
const {currentUser, t} = this.tt
|
|
72
|
+
const {currentUser, lgUp, mdDown, mdUp, t} = this.tt
|
|
34
73
|
const {active, noAccess, triggered} = this.props
|
|
35
74
|
|
|
75
|
+
const style = [styles.root.base]
|
|
76
|
+
|
|
77
|
+
if (mdDown) style.push(styles.root.mdDown)
|
|
78
|
+
if (mdUp) style.push(styles.root.mdUp)
|
|
79
|
+
if (lgUp) style.push(styles.root.lgUp)
|
|
80
|
+
|
|
81
|
+
if (mdDown && !triggered) {
|
|
82
|
+
return null
|
|
83
|
+
}
|
|
84
|
+
|
|
36
85
|
return (
|
|
37
|
-
<View dataSet={{component: "super-admin--layout--menu", triggered}}>
|
|
38
|
-
<
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
86
|
+
<View dataSet={{component: "super-admin--layout--menu", triggered}} style={style}>
|
|
87
|
+
<WithDefaultStyle style={{Text: {color: "#fff"}}}>
|
|
88
|
+
<View
|
|
89
|
+
dataSet={{class: "menu-logo"}}
|
|
90
|
+
style={{
|
|
91
|
+
overflow: "hidden",
|
|
92
|
+
marginTop: 25,
|
|
93
|
+
marginRight: "auto",
|
|
94
|
+
marginLeft: "auto"
|
|
95
|
+
}}
|
|
96
|
+
>
|
|
97
|
+
<Link dataSet={{class: "menu-logo-link"}} to={Params.withParams({})}>
|
|
98
|
+
<Text
|
|
99
|
+
style={{
|
|
100
|
+
fontSize: 42,
|
|
101
|
+
textOverflow: "ellipsis",
|
|
102
|
+
whiteSpace: "nowrap"
|
|
103
|
+
}}
|
|
104
|
+
>
|
|
105
|
+
Admin
|
|
106
|
+
</Text>
|
|
107
|
+
</Link>
|
|
108
|
+
</View>
|
|
109
|
+
<View dataSet={{class: "menu-items-center"}} style={{marginTop: 25}}>
|
|
110
|
+
{!noAccess &&
|
|
111
|
+
<MenuContent active={active} />
|
|
112
|
+
}
|
|
113
|
+
</View>
|
|
114
|
+
<View dataSet={{class: "menu-items-bottom"}} style={{marginTop: "auto", marginBottom: 25}}>
|
|
115
|
+
{currentUser &&
|
|
116
|
+
<View
|
|
117
|
+
dataSet={{class: "menu-user-section"}}
|
|
118
|
+
style={{
|
|
119
|
+
flexDirection: "row",
|
|
120
|
+
alignItems: "center",
|
|
121
|
+
marginRight: 25,
|
|
122
|
+
marginBottom: 25,
|
|
123
|
+
marginLeft: 25
|
|
124
|
+
}}
|
|
125
|
+
>
|
|
126
|
+
<View
|
|
127
|
+
dataSet={{class: "menu-user-icon"}}
|
|
128
|
+
style={{
|
|
129
|
+
width: 44,
|
|
130
|
+
height: 44,
|
|
131
|
+
alignItems: "center",
|
|
132
|
+
justifyContent: "center",
|
|
133
|
+
backgroundColor: "#abbcd0",
|
|
134
|
+
borderRadius: "50%"
|
|
135
|
+
}}
|
|
136
|
+
>
|
|
137
|
+
<Icon name="user" size={12} />
|
|
138
|
+
</View>
|
|
139
|
+
<View className="menu-user-name" style={styles.userName}>
|
|
140
|
+
<Text dataSet={{class: "menu-user-name-container"}} style={styles.userNameContainer}>
|
|
141
|
+
{currentUser.name()}
|
|
142
|
+
</Text>
|
|
143
|
+
</View>
|
|
144
|
+
</View>
|
|
145
|
+
}
|
|
146
|
+
{currentUser &&
|
|
147
|
+
<MenuItem
|
|
148
|
+
active
|
|
149
|
+
className="sign-out-menu-item"
|
|
150
|
+
icon="sign-out-alt"
|
|
151
|
+
label={t(".sign_out", {defaultValue: "Sign out"})}
|
|
152
|
+
onClick={this.tt.onSignOutClicked}
|
|
153
|
+
/>
|
|
154
|
+
}
|
|
155
|
+
</View>
|
|
156
|
+
</WithDefaultStyle>
|
|
73
157
|
</View>
|
|
74
158
|
)
|
|
75
159
|
}
|
|
@@ -1,49 +1,6 @@
|
|
|
1
1
|
@use "@kaspernj/api-maker/src/super-admin/stylesheets/variables" as *;
|
|
2
2
|
|
|
3
3
|
[data-component="super-admin--layout--menu"] {
|
|
4
|
-
position: fixed;
|
|
5
|
-
z-index: 9;
|
|
6
|
-
overflow-y: auto;
|
|
7
|
-
overflow-x: hidden;
|
|
8
|
-
top: 0;
|
|
9
|
-
left: 0;
|
|
10
|
-
display: flex;
|
|
11
|
-
height: 100%;
|
|
12
|
-
flex-direction: column;
|
|
13
|
-
background: #1b1c1e;
|
|
14
|
-
color: #fff;
|
|
15
|
-
|
|
16
|
-
@media (max-width: $sm-to) {
|
|
17
|
-
width: 100%;
|
|
18
|
-
max-width: 250px;
|
|
19
|
-
max-height: 100vh;
|
|
20
|
-
overflow-y: auto;
|
|
21
|
-
|
|
22
|
-
&[data-triggered="false"] {
|
|
23
|
-
display: none;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
@media (min-width: $md-from) {
|
|
28
|
-
width: 250px;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
@media (min-width: $lg-from) {
|
|
32
|
-
width: 290px;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.menu-logo {
|
|
36
|
-
overflow: hidden;
|
|
37
|
-
width: 80%;
|
|
38
|
-
margin-top: 25px;
|
|
39
|
-
margin-right: auto;
|
|
40
|
-
margin-left: auto;
|
|
41
|
-
font-size: 42px;
|
|
42
|
-
text-align: center;
|
|
43
|
-
text-overflow: ellipsis;
|
|
44
|
-
white-space: nowrap;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
4
|
.menu-logo-link {
|
|
48
5
|
&:link,
|
|
49
6
|
&:visited {
|
|
@@ -51,55 +8,4 @@
|
|
|
51
8
|
text-decoration: none;
|
|
52
9
|
}
|
|
53
10
|
}
|
|
54
|
-
|
|
55
|
-
.menu-items-center {
|
|
56
|
-
margin-top: 25px;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.menu-items-bottom {
|
|
60
|
-
margin-top: auto;
|
|
61
|
-
margin-bottom: 25px;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.menu-user-section {
|
|
65
|
-
display: flex;
|
|
66
|
-
align-items: center;
|
|
67
|
-
margin-right: 25px;
|
|
68
|
-
margin-bottom: 25px;
|
|
69
|
-
margin-left: 25px;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.menu-user-icon {
|
|
73
|
-
display: flex;
|
|
74
|
-
width: 44px;
|
|
75
|
-
min-width: 44px;
|
|
76
|
-
max-width: 44px;
|
|
77
|
-
height: 44px;
|
|
78
|
-
align-items: center;
|
|
79
|
-
justify-content: center;
|
|
80
|
-
background: #abbcd0;
|
|
81
|
-
border-radius: 50%;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.menu-user-name {
|
|
85
|
-
flex-shrink: 1;
|
|
86
|
-
margin-left: 8px;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.menu-user-name-container {
|
|
90
|
-
overflow: hidden;
|
|
91
|
-
max-width: 140px;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.menu-user-items {
|
|
95
|
-
position: relative;
|
|
96
|
-
margin-left: auto;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.menu-user-items-link {
|
|
100
|
-
&:link,
|
|
101
|
-
&:visited {
|
|
102
|
-
color: #dededf;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
11
|
}
|
|
@@ -9,7 +9,7 @@ import {shapeComponent} from "set-state-compare/src/shape-component"
|
|
|
9
9
|
import ShowReflectionLink from "./show-reflection-link"
|
|
10
10
|
import Text from "../utils/text"
|
|
11
11
|
import useI18n from "i18n-on-steroids/src/use-i18n"
|
|
12
|
-
import useQueryParams from "on-location-changed/
|
|
12
|
+
import useQueryParams from "on-location-changed/build/use-query-params"
|
|
13
13
|
import {View} from "react-native"
|
|
14
14
|
|
|
15
15
|
export default memo(shapeComponent(class ApiMakerSuperAdminShowNav extends BaseComponent {
|
|
@@ -7,7 +7,7 @@ import ModelClassTable from "./model-class-table"
|
|
|
7
7
|
import React from "react"
|
|
8
8
|
import {shapeComponent} from "set-state-compare/src/shape-component"
|
|
9
9
|
import ShowNav from "./show-nav"
|
|
10
|
-
import useQueryParams from "on-location-changed/
|
|
10
|
+
import useQueryParams from "on-location-changed/build/use-query-params"
|
|
11
11
|
import {View} from "react-native"
|
|
12
12
|
|
|
13
13
|
export default memo(shapeComponent(class ApiMakerSuperAdminShowReflectionPage extends BaseComponent {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {Pressable, View} from "react-native"
|
|
2
2
|
import BaseComponent from "../../base-component"
|
|
3
|
-
import
|
|
3
|
+
import Icon from "../../utils/icon"
|
|
4
4
|
import PropTypes from "prop-types"
|
|
5
5
|
import PropTypesExact from "prop-types-exact"
|
|
6
6
|
import memo from "set-state-compare/src/memo"
|
|
@@ -47,7 +47,7 @@ export default memo(shapeComponent(class ApiMakerTableFilter extends BaseCompone
|
|
|
47
47
|
</Text>
|
|
48
48
|
</Pressable>
|
|
49
49
|
<Pressable dataSet={{class: "remove-filter-button"}} onPress={this.tt.onRemoveFilterPressed} style={{marginLeft: 6}}>
|
|
50
|
-
<
|
|
50
|
+
<Icon name="remove" />
|
|
51
51
|
</Pressable>
|
|
52
52
|
</View>
|
|
53
53
|
)
|
|
@@ -11,7 +11,7 @@ import memo from "set-state-compare/src/memo"
|
|
|
11
11
|
import {shapeComponent} from "set-state-compare/src/shape-component"
|
|
12
12
|
import React from "react"
|
|
13
13
|
import useI18n from "i18n-on-steroids/src/use-i18n"
|
|
14
|
-
import useQueryParams from "on-location-changed/
|
|
14
|
+
import useQueryParams from "on-location-changed/build/use-query-params"
|
|
15
15
|
import {View} from "react-native"
|
|
16
16
|
|
|
17
17
|
const {TableSearch} = models
|