@applica-software-guru/react-admin 1.5.325 → 1.5.326
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/components/Layout/Header/Notification/Notification.d.ts.map +1 -1
- package/dist/components/ra-lists/Empty.d.ts.map +1 -1
- package/dist/react-admin.cjs.js +42 -42
- package/dist/react-admin.cjs.js.gz +0 -0
- package/dist/react-admin.cjs.js.map +1 -1
- package/dist/react-admin.es.js +4700 -4688
- package/dist/react-admin.es.js.gz +0 -0
- package/dist/react-admin.es.js.map +1 -1
- package/dist/react-admin.umd.js +39 -39
- package/dist/react-admin.umd.js.gz +0 -0
- package/dist/react-admin.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Layout/Header/Notification/Notification.tsx +52 -38
- package/src/components/ra-lists/Empty.tsx +6 -4
package/package.json
CHANGED
|
@@ -3,6 +3,7 @@ import { IconButton, Transitions } from '@/components/@extended';
|
|
|
3
3
|
import { HeaderToggleButton } from '@/components/Layout/Header/Buttons';
|
|
4
4
|
import { useLayoutMediaState, useLayoutNotificationsState } from '@/components/Layout/Provider';
|
|
5
5
|
import { MainCard } from '@/components/MainCard';
|
|
6
|
+
import { Empty } from '@/components/ra-lists';
|
|
6
7
|
import { usePopoverState } from '@/hooks';
|
|
7
8
|
import { BellOutlined, CheckCircleOutlined } from '@ant-design/icons';
|
|
8
9
|
import {
|
|
@@ -140,45 +141,58 @@ function HeaderNotificationButton() {
|
|
|
140
141
|
</>
|
|
141
142
|
}
|
|
142
143
|
>
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
'
|
|
150
|
-
|
|
151
|
-
'& .MuiListItemSecondaryAction-root': { ...actionSx, position: 'relative' }
|
|
152
|
-
},
|
|
153
|
-
maxHeight: 'calc(100vh - 240px)',
|
|
154
|
-
overflow: 'auto'
|
|
155
|
-
}}
|
|
156
|
-
>
|
|
157
|
-
{notifications.map((item, index) => (
|
|
158
|
-
<HeaderNotificationItem
|
|
159
|
-
key={item.id}
|
|
160
|
-
selected={read > 0}
|
|
161
|
-
notification={item}
|
|
162
|
-
onClick={handleClose}
|
|
163
|
-
divider={index < notifications.length - 1}
|
|
164
|
-
/>
|
|
165
|
-
))}
|
|
166
|
-
</List>
|
|
167
|
-
{/*@ts-ignore*/}
|
|
168
|
-
<ListItemButton
|
|
169
|
-
sx={{ textAlign: 'center', py: `${12}px !important` }}
|
|
170
|
-
to={`/${resource}`}
|
|
171
|
-
LinkComponent={Link}
|
|
172
|
-
onClick={handleClose}
|
|
173
|
-
>
|
|
174
|
-
<ListItemText
|
|
175
|
-
primary={
|
|
176
|
-
<Typography variant="h6" color="primary">
|
|
177
|
-
{translate('ra.notification.view_all')}
|
|
178
|
-
</Typography>
|
|
179
|
-
}
|
|
144
|
+
{notifications.length === 0 ? (
|
|
145
|
+
<Empty
|
|
146
|
+
hasCreate={false}
|
|
147
|
+
title={<Typography variant="h5">{translate('ra.notification.empty')}</Typography>}
|
|
148
|
+
sx={{
|
|
149
|
+
'& .ApplicaEmpty-icon': { fontSize: '60px' },
|
|
150
|
+
'& .ApplicaEmpty-toolbar': { display: 'none' }
|
|
151
|
+
}}
|
|
180
152
|
/>
|
|
181
|
-
|
|
153
|
+
) : (
|
|
154
|
+
<>
|
|
155
|
+
<List
|
|
156
|
+
component="nav"
|
|
157
|
+
sx={{
|
|
158
|
+
p: 0,
|
|
159
|
+
'& .MuiListItemButton-root': {
|
|
160
|
+
py: 0.5,
|
|
161
|
+
'&.Mui-selected': { bgcolor: 'grey.50', color: 'text.primary' },
|
|
162
|
+
'& .MuiAvatar-root': avatarSx,
|
|
163
|
+
'& .MuiListItemSecondaryAction-root': { ...actionSx, position: 'relative' }
|
|
164
|
+
},
|
|
165
|
+
maxHeight: 'calc(100vh - 240px)',
|
|
166
|
+
overflow: 'auto'
|
|
167
|
+
}}
|
|
168
|
+
>
|
|
169
|
+
{notifications.map((item, index) => (
|
|
170
|
+
<HeaderNotificationItem
|
|
171
|
+
key={item.id}
|
|
172
|
+
selected={read > 0}
|
|
173
|
+
notification={item}
|
|
174
|
+
onClick={handleClose}
|
|
175
|
+
divider={index < notifications.length - 1}
|
|
176
|
+
/>
|
|
177
|
+
))}
|
|
178
|
+
</List>
|
|
179
|
+
{/*@ts-ignore*/}
|
|
180
|
+
<ListItemButton
|
|
181
|
+
sx={{ textAlign: 'center', py: `${12}px !important` }}
|
|
182
|
+
to={`/${resource}`}
|
|
183
|
+
LinkComponent={Link}
|
|
184
|
+
onClick={handleClose}
|
|
185
|
+
>
|
|
186
|
+
<ListItemText
|
|
187
|
+
primary={
|
|
188
|
+
<Typography variant="h6" color="primary">
|
|
189
|
+
{translate('ra.notification.view_all')}
|
|
190
|
+
</Typography>
|
|
191
|
+
}
|
|
192
|
+
/>
|
|
193
|
+
</ListItemButton>
|
|
194
|
+
</>
|
|
195
|
+
)}
|
|
182
196
|
<Divider />
|
|
183
197
|
</MainCard>
|
|
184
198
|
</ClickAwayListener>
|
|
@@ -112,10 +112,12 @@ function Empty({
|
|
|
112
112
|
const translate = useTranslate();
|
|
113
113
|
|
|
114
114
|
const getResourceLabel = useGetResourceLabel();
|
|
115
|
-
const resourceName =
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
115
|
+
const resourceName = resource
|
|
116
|
+
? translate(`resources.${resource}.forcedCaseName`, {
|
|
117
|
+
smart_count: 0,
|
|
118
|
+
_: getResourceLabel(resource, 0)
|
|
119
|
+
})
|
|
120
|
+
: translate('ra.empty.no_resource');
|
|
119
121
|
|
|
120
122
|
const emptyMessage = translate('ra.page.empty', { name: resourceName });
|
|
121
123
|
const inviteMessage = translate('ra.page.invite');
|