@griddo/ax 11.14.2 → 11.14.3-rc.0
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/config/jest/setup.js +13 -7
- package/package.json +2 -2
- package/src/__tests__/components/KeywordsPreviewModal/KeywordsPreviewModal.test.tsx +4 -3
- package/src/components/CategoryCell/index.tsx +3 -1
- package/src/components/ElementsTooltip/index.tsx +8 -4
- package/src/components/ErrorPage/index.tsx +3 -1
- package/src/components/FilterTagsBar/index.tsx +3 -3
- package/src/components/HeadingsPreviewModal/utils.tsx +2 -1
- package/src/components/KeywordsPreviewModal/atoms.tsx +2 -2
- package/src/components/KeywordsPreviewModal/index.tsx +6 -6
- package/src/components/KeywordsPreviewModal/utils.tsx +5 -3
- package/src/components/Modal/style.tsx +5 -5
- package/src/components/TableFilters/CheckGroupFilter/index.tsx +3 -2
- package/src/components/TableFilters/LiveFilter/index.tsx +4 -4
- package/src/components/TableFilters/SiteFilter/index.tsx +11 -12
- package/src/components/TableFilters/TranslationsFilter/index.tsx +2 -2
- package/src/components/TableFilters/TranslationsFilter/style.tsx +2 -2
- package/src/components/Tag/index.tsx +15 -7
- package/src/components/TruncatedTooltip/index.tsx +48 -0
- package/src/components/index.tsx +2 -0
- package/src/constants/index.ts +3 -0
- package/src/helpers/categoryColumns.tsx +55 -0
- package/src/helpers/images.tsx +3 -1
- package/src/helpers/index.tsx +2 -0
- package/src/modules/ActivityLog/ItemLog/EventItem/index.tsx +17 -10
- package/src/modules/ActivityLog/ItemLog/EventItem/style.tsx +18 -1
- package/src/modules/ActivityLog/ItemLogUser/UserItem/EventItem/index.tsx +10 -7
- package/src/modules/ActivityLog/ItemLogUser/UserItem/index.tsx +9 -3
- package/src/modules/ActivityLog/ItemLogUser/UserItem/style.tsx +17 -1
- package/src/modules/App/Routing/NavMenu/NavItem/style.tsx +1 -0
- package/src/modules/App/Routing/index.tsx +2 -2
- package/src/modules/App/Routing/style.tsx +8 -1
- package/src/modules/Categories/CategoriesList/BulkHeader/TableHeader/style.tsx +1 -0
- package/src/modules/Categories/CategoriesList/CategoryItem/index.tsx +7 -3
- package/src/modules/Categories/CategoriesList/CategoryItem/style.tsx +38 -5
- package/src/modules/Content/BulkHeader/TableHeader/style.tsx +1 -1
- package/src/modules/Content/PageItem/index.tsx +80 -204
- package/src/modules/Content/PageItem/style.tsx +18 -10
- package/src/modules/Content/atoms.tsx +147 -18
- package/src/modules/Content/index.tsx +2 -9
- package/src/modules/Forms/FormCategoriesList/CategoryItem/index.tsx +7 -3
- package/src/modules/Forms/FormCategoriesList/CategoryItem/style.tsx +34 -0
- package/src/modules/Forms/FormEditor/index.tsx +28 -50
- package/src/modules/Forms/FormList/FormItem/index.tsx +91 -120
- package/src/modules/Forms/FormList/FormItem/style.tsx +19 -0
- package/src/modules/Forms/FormList/index.tsx +27 -48
- package/src/modules/Forms/atoms.tsx +44 -32
- package/src/modules/StructuredData/StructuredDataList/BulkHeader/TableHeader/index.tsx +8 -8
- package/src/modules/StructuredData/StructuredDataList/BulkHeader/TableHeader/style.tsx +2 -2
- package/src/modules/StructuredData/StructuredDataList/GlobalPageItem/index.tsx +83 -101
- package/src/modules/StructuredData/StructuredDataList/GlobalPageItem/style.tsx +11 -5
- package/src/modules/StructuredData/StructuredDataList/StructuredDataItem/index.tsx +31 -54
- package/src/modules/StructuredData/StructuredDataList/StructuredDataItem/style.tsx +13 -7
- package/src/modules/Users/Roles/BulkHeader/TableHeader/style.tsx +6 -6
- package/src/modules/Users/Roles/RoleItem/index.tsx +3 -4
- package/src/modules/Users/Roles/RoleItem/style.tsx +12 -15
- package/src/modules/Users/Roles/index.tsx +1 -2
- package/src/modules/Users/UserCreate/SiteItem/index.tsx +10 -4
- package/src/modules/Users/UserCreate/SiteItem/style.tsx +33 -1
- package/src/modules/Users/UserForm/index.tsx +6 -4
- package/src/modules/Users/UserList/BulkHeader/TableHeader/index.tsx +2 -4
- package/src/modules/Users/UserList/BulkHeader/TableHeader/style.tsx +1 -1
- package/src/modules/Users/UserList/UserItem/index.tsx +18 -10
- package/src/modules/Users/UserList/UserItem/style.tsx +60 -4
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import React, { useRef } from "react";
|
|
2
1
|
import { connect } from "react-redux";
|
|
3
2
|
|
|
4
|
-
import {
|
|
3
|
+
import { CheckField, Flag, FloatingMenu, Icon, LanguageMenu, Tooltip, TruncatedTooltip } from "@ax/components";
|
|
5
4
|
import { appActions } from "@ax/containers/App";
|
|
6
5
|
import { structuredDataActions } from "@ax/containers/StructuredData";
|
|
7
|
-
import {
|
|
8
|
-
|
|
6
|
+
import {
|
|
7
|
+
buildCategoryColumns,
|
|
8
|
+
getActivatedDataPacksIds,
|
|
9
|
+
getHumanLastModifiedDate,
|
|
10
|
+
getScheduleFormatDate,
|
|
11
|
+
} from "@ax/helpers";
|
|
12
|
+
import { usePermissions } from "@ax/hooks";
|
|
9
13
|
import type {
|
|
10
14
|
ICheck,
|
|
11
15
|
IColumn,
|
|
@@ -19,8 +23,6 @@ import type {
|
|
|
19
23
|
IStructuredDataContent,
|
|
20
24
|
} from "@ax/types";
|
|
21
25
|
|
|
22
|
-
import { useTheme } from "styled-components";
|
|
23
|
-
|
|
24
26
|
import { getPermission } from "./utils";
|
|
25
27
|
|
|
26
28
|
import * as S from "./style";
|
|
@@ -57,15 +59,12 @@ const StructuredDataItem = (props: IStructuredDataItemProps): JSX.Element => {
|
|
|
57
59
|
const isPrivateData = currentStructuredData?.private || false;
|
|
58
60
|
const isGlobal = !currentSiteInfo;
|
|
59
61
|
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const theme: any = useTheme();
|
|
67
|
-
const nameCellPadding = Number(theme.spacing.s.slice(0, -2));
|
|
68
|
-
const title = useAdaptiveText(nameCellRef, structuredData.content.title, nameCellPadding);
|
|
62
|
+
const isAllowedTo = usePermissions({
|
|
63
|
+
duplicatePages: getPermission("duplicate", isGlobal, isPrivateData),
|
|
64
|
+
publishPages: getPermission("publish", isGlobal, isPrivateData),
|
|
65
|
+
createPages: getPermission("create", isGlobal, isPrivateData),
|
|
66
|
+
deletePages: getPermission("delete", isGlobal, isPrivateData),
|
|
67
|
+
});
|
|
69
68
|
|
|
70
69
|
const { locale } = lang;
|
|
71
70
|
const { dataLanguages, publicationScheduled } = structuredData;
|
|
@@ -130,7 +129,7 @@ const StructuredDataItem = (props: IStructuredDataItemProps): JSX.Element => {
|
|
|
130
129
|
const isDisabled =
|
|
131
130
|
currentStructuredData?.dataPacks[0] && !activatedDataPacksIds.includes(currentStructuredData.dataPacks[0]);
|
|
132
131
|
|
|
133
|
-
const availableLanguages = isDisabled || !
|
|
132
|
+
const availableLanguages = isDisabled || !isAllowedTo.createPages ? currentLanguages : languages;
|
|
134
133
|
|
|
135
134
|
const handleLanguage = (language: ILanguage) => {
|
|
136
135
|
const {
|
|
@@ -145,7 +144,7 @@ const StructuredDataItem = (props: IStructuredDataItemProps): JSX.Element => {
|
|
|
145
144
|
id,
|
|
146
145
|
};
|
|
147
146
|
|
|
148
|
-
const isNew = currentLanguages.find((l) => l.id === language.id)
|
|
147
|
+
const isNew = !currentLanguages.find((l) => l.id === language.id);
|
|
149
148
|
|
|
150
149
|
if (isNew) {
|
|
151
150
|
updateForm({
|
|
@@ -189,7 +188,7 @@ const StructuredDataItem = (props: IStructuredDataItemProps): JSX.Element => {
|
|
|
189
188
|
|
|
190
189
|
const menuOptions = [];
|
|
191
190
|
|
|
192
|
-
if (!isDisabled && isEditable &&
|
|
191
|
+
if (!isDisabled && isEditable && isAllowedTo.duplicatePages) {
|
|
193
192
|
menuOptions.push({
|
|
194
193
|
label: "duplicate",
|
|
195
194
|
icon: "duplicate",
|
|
@@ -197,7 +196,7 @@ const StructuredDataItem = (props: IStructuredDataItemProps): JSX.Element => {
|
|
|
197
196
|
});
|
|
198
197
|
}
|
|
199
198
|
|
|
200
|
-
if (isEditable &&
|
|
199
|
+
if (isEditable && isAllowedTo.deletePages) {
|
|
201
200
|
menuOptions.push({
|
|
202
201
|
label: "delete",
|
|
203
202
|
icon: "delete",
|
|
@@ -205,7 +204,7 @@ const StructuredDataItem = (props: IStructuredDataItemProps): JSX.Element => {
|
|
|
205
204
|
});
|
|
206
205
|
}
|
|
207
206
|
|
|
208
|
-
if (
|
|
207
|
+
if (isAllowedTo.publishPages) {
|
|
209
208
|
menuOptions.push({
|
|
210
209
|
label: structuredData.draft ? "Publish" : "Unpublish",
|
|
211
210
|
icon: structuredData.draft ? "upload-pending" : "offline",
|
|
@@ -213,36 +212,14 @@ const StructuredDataItem = (props: IStructuredDataItemProps): JSX.Element => {
|
|
|
213
212
|
});
|
|
214
213
|
}
|
|
215
214
|
|
|
216
|
-
const CategoryColumns =
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
return (
|
|
225
|
-
<S.ColumnCell key={col.key} onClick={_handleClick}>
|
|
226
|
-
{type}
|
|
227
|
-
</S.ColumnCell>
|
|
228
|
-
);
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
const categories: string[] = !type
|
|
232
|
-
? []
|
|
233
|
-
: Array.isArray(type)
|
|
234
|
-
? type.map((cat: any) => cat.label || cat.title)
|
|
235
|
-
: [type.label || type.title];
|
|
236
|
-
|
|
237
|
-
return (
|
|
238
|
-
<CategoryCell
|
|
239
|
-
key={col.key}
|
|
240
|
-
categories={categories}
|
|
241
|
-
categoryColors={categoryColors}
|
|
242
|
-
addCategoryColors={addCategoryColors}
|
|
243
|
-
/>
|
|
244
|
-
);
|
|
245
|
-
});
|
|
215
|
+
const CategoryColumns = buildCategoryColumns(
|
|
216
|
+
categoryColumns,
|
|
217
|
+
activeColumns,
|
|
218
|
+
structuredData?.content,
|
|
219
|
+
categoryColors,
|
|
220
|
+
addCategoryColors,
|
|
221
|
+
_handleClick,
|
|
222
|
+
);
|
|
246
223
|
|
|
247
224
|
return (
|
|
248
225
|
<S.StructuredDataRow role="rowgroup" selected={isSelected} disabled={!isEditable}>
|
|
@@ -254,10 +231,10 @@ const StructuredDataItem = (props: IStructuredDataItemProps): JSX.Element => {
|
|
|
254
231
|
onChange={handleOnChange}
|
|
255
232
|
/>
|
|
256
233
|
</S.CheckCell>
|
|
257
|
-
<S.NameCell role="cell" onClick={_handleClick}
|
|
258
|
-
<
|
|
259
|
-
<S.Title
|
|
260
|
-
</
|
|
234
|
+
<S.NameCell role="cell" onClick={_handleClick}>
|
|
235
|
+
<TruncatedTooltip content={structuredData.content.title} expanded top={1}>
|
|
236
|
+
<S.Title>{structuredData.content.title}</S.Title>
|
|
237
|
+
</TruncatedTooltip>
|
|
261
238
|
</S.NameCell>
|
|
262
239
|
{activeColumns.includes("live") && (
|
|
263
240
|
<S.LiveCell role="cell" onClick={_handleClick}>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import styled from "styled-components";
|
|
2
|
-
|
|
3
|
-
import { Cell, Row } from "@ax/components/TableList/TableItem/style";
|
|
4
1
|
import { ActionMenu } from "@ax/components";
|
|
2
|
+
import { Cell, Row } from "@ax/components/TableList/TableItem/style";
|
|
3
|
+
|
|
4
|
+
import styled from "styled-components";
|
|
5
5
|
|
|
6
6
|
const CheckCell = styled(Cell)`
|
|
7
7
|
padding-right: 0;
|
|
@@ -14,15 +14,20 @@ const CheckCell = styled(Cell)`
|
|
|
14
14
|
|
|
15
15
|
const NameCell = styled(Cell)`
|
|
16
16
|
flex-grow: 1;
|
|
17
|
+
min-width: 0;
|
|
18
|
+
position: relative;
|
|
19
|
+
> * {
|
|
20
|
+
min-width: 0;
|
|
21
|
+
}
|
|
17
22
|
`;
|
|
18
23
|
|
|
19
|
-
const Title = styled.div
|
|
24
|
+
const Title = styled.div`
|
|
20
25
|
${(p) => p.theme.textStyle.uiL};
|
|
21
26
|
color: ${(p) => p.theme.color.textHighEmphasis};
|
|
22
27
|
overflow: hidden;
|
|
23
28
|
white-space: nowrap;
|
|
24
29
|
text-overflow: ellipsis;
|
|
25
|
-
width:
|
|
30
|
+
width: 100%;
|
|
26
31
|
`;
|
|
27
32
|
|
|
28
33
|
const ActionsCell = styled(Cell)`
|
|
@@ -30,7 +35,7 @@ const ActionsCell = styled(Cell)`
|
|
|
30
35
|
padding-left: 0;
|
|
31
36
|
`;
|
|
32
37
|
|
|
33
|
-
|
|
38
|
+
const ActionsWrapper = styled.div`
|
|
34
39
|
opacity: 0;
|
|
35
40
|
transition: opacity 0.1s;
|
|
36
41
|
text-align: right;
|
|
@@ -93,7 +98,7 @@ const FlagsWrapper = styled.div`
|
|
|
93
98
|
`;
|
|
94
99
|
|
|
95
100
|
const ColumnCell = styled(Cell)`
|
|
96
|
-
flex: 0 0
|
|
101
|
+
flex: 0 0 215px;
|
|
97
102
|
position: relative;
|
|
98
103
|
align-items: center;
|
|
99
104
|
`;
|
|
@@ -102,6 +107,7 @@ export {
|
|
|
102
107
|
CheckCell,
|
|
103
108
|
NameCell,
|
|
104
109
|
ActionsCell,
|
|
110
|
+
ActionsWrapper,
|
|
105
111
|
StyledActionMenu,
|
|
106
112
|
TransCell,
|
|
107
113
|
LiveCell,
|
|
@@ -16,27 +16,27 @@ const CheckHeader = styled(Header)`
|
|
|
16
16
|
width: 32px;
|
|
17
17
|
`;
|
|
18
18
|
|
|
19
|
-
const NameWrapper = styled
|
|
19
|
+
const NameWrapper = styled(Header)`
|
|
20
20
|
width: 400px;
|
|
21
21
|
position: relative;
|
|
22
22
|
`;
|
|
23
23
|
|
|
24
|
-
const PermissionsWrapper = styled
|
|
24
|
+
const PermissionsWrapper = styled(Header)`
|
|
25
25
|
flex-grow: 1;
|
|
26
26
|
display: flex;
|
|
27
27
|
justify-content: center;
|
|
28
28
|
position: relative;
|
|
29
29
|
`;
|
|
30
30
|
|
|
31
|
-
const ActionsHeader = styled(Header
|
|
31
|
+
const ActionsHeader = styled(Header)<{ isSiteView: boolean }>`
|
|
32
32
|
display: flex;
|
|
33
|
-
width:
|
|
33
|
+
width: 104px;
|
|
34
34
|
justify-content: end;
|
|
35
35
|
padding-right: 0;
|
|
36
36
|
`;
|
|
37
37
|
|
|
38
|
-
const UsersWrapper = styled
|
|
39
|
-
width:
|
|
38
|
+
const UsersWrapper = styled(Header)`
|
|
39
|
+
width: 300px;
|
|
40
40
|
display: flex;
|
|
41
41
|
justify-content: center;
|
|
42
42
|
position: relative;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { useState } from "react";
|
|
3
2
|
import { connect } from "react-redux";
|
|
4
3
|
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { Avatar, CheckField, Tag, ToggleField, Tooltip } from "@ax/components";
|
|
5
|
+
import type { ICheck, IRole, IRootState, IUser } from "@ax/types";
|
|
7
6
|
|
|
8
7
|
import * as S from "./style";
|
|
9
8
|
|
|
@@ -35,47 +35,44 @@ const Description = styled.div`
|
|
|
35
35
|
|
|
36
36
|
const AvatarCell = styled(Cell)`
|
|
37
37
|
position: relative;
|
|
38
|
-
align-items: center;
|
|
39
38
|
justify-content: center;
|
|
40
|
-
width:
|
|
39
|
+
width: 300px;
|
|
40
|
+
flex-flow: row wrap;
|
|
41
41
|
`;
|
|
42
42
|
|
|
43
43
|
const UsersLength = styled.span`
|
|
44
44
|
${(p) => p.theme.textStyle.uiS};
|
|
45
|
-
|
|
46
|
-
left: 110px;
|
|
45
|
+
margin-left: ${(p) => p.theme.spacing.xxs};
|
|
47
46
|
`;
|
|
48
47
|
|
|
49
48
|
const AvatarsWrapper = styled.div`
|
|
50
49
|
display: flex;
|
|
51
50
|
align-items: center;
|
|
52
|
-
position: relative;
|
|
53
51
|
|
|
54
52
|
div {
|
|
55
|
-
position:
|
|
53
|
+
position: relative;
|
|
56
54
|
&:nth-child(1) {
|
|
57
|
-
position: absolute;
|
|
58
55
|
z-index: 5;
|
|
59
56
|
}
|
|
60
57
|
&:nth-child(2) {
|
|
61
|
-
position: absolute;
|
|
62
58
|
z-index: 4;
|
|
63
|
-
left:
|
|
59
|
+
margin-left: -5px;
|
|
60
|
+
flex-shrink: 0;
|
|
64
61
|
}
|
|
65
62
|
&:nth-child(3) {
|
|
66
|
-
position: absolute;
|
|
67
63
|
z-index: 3;
|
|
68
|
-
left:
|
|
64
|
+
margin-left: -5px;
|
|
65
|
+
flex-shrink: 0;
|
|
69
66
|
}
|
|
70
67
|
&:nth-child(4) {
|
|
71
|
-
position: absolute;
|
|
72
68
|
z-index: 2;
|
|
73
|
-
left:
|
|
69
|
+
margin-left: -5px;
|
|
70
|
+
flex-shrink: 0;
|
|
74
71
|
}
|
|
75
72
|
&:nth-child(5) {
|
|
76
|
-
position: absolute;
|
|
77
73
|
z-index: 1;
|
|
78
|
-
left:
|
|
74
|
+
margin-left: -5px;
|
|
75
|
+
flex-shrink: 0;
|
|
79
76
|
}
|
|
80
77
|
}
|
|
81
78
|
`;
|
|
@@ -192,8 +192,7 @@ const Roles = (props: IRolesProps): JSX.Element => {
|
|
|
192
192
|
<EmptyState message="No roles found" />
|
|
193
193
|
</S.EmptyWrapper>
|
|
194
194
|
) : (
|
|
195
|
-
pageRoles
|
|
196
|
-
pageRoles.map((role: IRole) => {
|
|
195
|
+
pageRoles?.map((role: IRole) => {
|
|
197
196
|
const isItemSelected = isSelected(role.id);
|
|
198
197
|
const handleActivateRole = async (value: boolean) => handleActivateRoles([role.id], value);
|
|
199
198
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Button, CheckField, ElementsTooltip, TruncatedTooltip } from "@ax/components";
|
|
2
2
|
import { useModal } from "@ax/hooks";
|
|
3
|
-
|
|
4
3
|
import type { IRole } from "@ax/types";
|
|
4
|
+
|
|
5
5
|
import RolesModal from "./RolesModal";
|
|
6
6
|
|
|
7
7
|
import * as S from "./style";
|
|
@@ -52,7 +52,11 @@ const SiteItem = (props: ISiteItemProps): JSX.Element => {
|
|
|
52
52
|
) : null}
|
|
53
53
|
{featured ? (
|
|
54
54
|
<S.WrapperCell role="cell" data-testid="wrapper-cell-featured">
|
|
55
|
-
<S.Name onClick={handleClick}>
|
|
55
|
+
<S.Name onClick={handleClick}>
|
|
56
|
+
<TruncatedTooltip content={name} expanded top={-5}>
|
|
57
|
+
<S.Title>{name}</S.Title>
|
|
58
|
+
</TruncatedTooltip>
|
|
59
|
+
</S.Name>
|
|
56
60
|
<S.Description onClick={handleClick}>{description}</S.Description>
|
|
57
61
|
<S.Actions hasTags={rolesString ? rolesString.length > 0 : false}>
|
|
58
62
|
<ElementsTooltip
|
|
@@ -73,7 +77,9 @@ const SiteItem = (props: ISiteItemProps): JSX.Element => {
|
|
|
73
77
|
) : (
|
|
74
78
|
<>
|
|
75
79
|
<S.NameCell role="cell" disabled={disabled} onClick={handleClick} data-testid="name-cell">
|
|
76
|
-
{name}
|
|
80
|
+
<TruncatedTooltip content={name} expanded top={-5}>
|
|
81
|
+
<S.NameTitle disabled={disabled}>{name}</S.NameTitle>
|
|
82
|
+
</TruncatedTooltip>
|
|
77
83
|
</S.NameCell>
|
|
78
84
|
<S.RolesCell role="cell" onClick={handleClick}>
|
|
79
85
|
<ElementsTooltip
|
|
@@ -15,6 +15,22 @@ const NameCell = styled(Cell)<{ disabled?: boolean }>`
|
|
|
15
15
|
color: ${(p) => (p.disabled ? p.theme.color.interactiveDisabled : p.theme.color.textHighEmphasis)};
|
|
16
16
|
flex-grow: 1;
|
|
17
17
|
padding: ${(p) => `12px ${p.theme.spacing.s}`};
|
|
18
|
+
min-width: 0;
|
|
19
|
+
> * {
|
|
20
|
+
min-width: 0;
|
|
21
|
+
max-width: 100%;
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
const NameTitle = styled.div<{ disabled?: boolean }>`
|
|
26
|
+
width: 100%;
|
|
27
|
+
${(p) => p.theme.textStyle.uiL};
|
|
28
|
+
color: ${(p) => (p.disabled ? p.theme.color.interactiveDisabled : p.theme.color.textHighEmphasis)};
|
|
29
|
+
overflow: hidden;
|
|
30
|
+
text-overflow: ellipsis;
|
|
31
|
+
white-space: nowrap;
|
|
32
|
+
display: block;
|
|
33
|
+
min-width: 0;
|
|
18
34
|
`;
|
|
19
35
|
|
|
20
36
|
const RolesCell = styled(Cell)`
|
|
@@ -54,6 +70,22 @@ const Name = styled.div`
|
|
|
54
70
|
${(p) => p.theme.textStyle.uiL};
|
|
55
71
|
color: ${(p) => p.theme.color.textHighEmphasis};
|
|
56
72
|
margin-bottom: ${(p) => p.theme.spacing.xxs};
|
|
73
|
+
min-width: 0;
|
|
74
|
+
> * {
|
|
75
|
+
min-width: 0;
|
|
76
|
+
max-width: 100%;
|
|
77
|
+
}
|
|
78
|
+
`;
|
|
79
|
+
|
|
80
|
+
const Title = styled.div`
|
|
81
|
+
width: 100%;
|
|
82
|
+
${(p) => p.theme.textStyle.uiL};
|
|
83
|
+
color: ${(p) => p.theme.color.textHighEmphasis};
|
|
84
|
+
overflow: hidden;
|
|
85
|
+
text-overflow: ellipsis;
|
|
86
|
+
white-space: nowrap;
|
|
87
|
+
display: block;
|
|
88
|
+
min-width: 0;
|
|
57
89
|
`;
|
|
58
90
|
|
|
59
91
|
const Description = styled.div`
|
|
@@ -70,4 +102,4 @@ const Actions = styled.div<{ hasTags: boolean }>`
|
|
|
70
102
|
}
|
|
71
103
|
`;
|
|
72
104
|
|
|
73
|
-
export { CheckCell, NameCell, RolesCell, ActionCell, SiteItem, WrapperCell, Name, Description, Actions };
|
|
105
|
+
export { CheckCell, NameCell, NameTitle, RolesCell, ActionCell, SiteItem, WrapperCell, Name, Title, Description, Actions };
|
|
@@ -166,8 +166,8 @@ const UserForm = (props: IProps) => {
|
|
|
166
166
|
);
|
|
167
167
|
|
|
168
168
|
const getSiteName = (id: number | string) => {
|
|
169
|
-
const currentSite = sites.find((site) => site.id === id)
|
|
170
|
-
return currentSite
|
|
169
|
+
const currentSite = sites.find((site) => site.id === id);
|
|
170
|
+
return currentSite?.name;
|
|
171
171
|
};
|
|
172
172
|
|
|
173
173
|
const sitesID = form.roles.map((roleSite: ISiteRoles) => roleSite.siteId);
|
|
@@ -400,13 +400,15 @@ const UserForm = (props: IProps) => {
|
|
|
400
400
|
{!rolesAll &&
|
|
401
401
|
form.roles.map((siteRole: ISiteRoles, index: number) => {
|
|
402
402
|
if (siteRole.siteId !== "all" && siteRole.siteId !== "global") {
|
|
403
|
+
const siteName = getSiteName(siteRole.siteId);
|
|
404
|
+
if (!siteName) return <></>;
|
|
403
405
|
return (
|
|
404
406
|
<SiteItem
|
|
405
407
|
readOnly={readOnlySites}
|
|
406
408
|
disabled={!!rolesAll}
|
|
407
409
|
sites={sitesID}
|
|
408
|
-
key={`${index}${
|
|
409
|
-
item={{ name:
|
|
410
|
+
key={`${index}${siteName}`}
|
|
411
|
+
item={{ name: siteName, id: siteRole.siteId, onChange: selectSite }}
|
|
410
412
|
selected={siteRole.roles}
|
|
411
413
|
roles={roles}
|
|
412
414
|
addRoles={handleAddRoles}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import { CheckField, TableCounter, SiteFilter, NameFilter, RoleFilter, Tooltip } from "@ax/components";
|
|
4
|
-
import { IQueryValue, IRole } from "@ax/types";
|
|
1
|
+
import { CheckField, NameFilter, RoleFilter, SiteFilter, TableCounter, Tooltip } from "@ax/components";
|
|
2
|
+
import type { IQueryValue, IRole } from "@ax/types";
|
|
5
3
|
|
|
6
4
|
import * as S from "./style";
|
|
7
5
|
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { useRef } from "react";
|
|
2
1
|
import { connect } from "react-redux";
|
|
3
2
|
|
|
4
|
-
import { Avatar, CheckField, ElementsTooltip, Modal, Tag, Toast, Tooltip } from "@ax/components";
|
|
3
|
+
import { Avatar, CheckField, ElementsTooltip, Modal, Tag, Toast, Tooltip, TruncatedTooltip } from "@ax/components";
|
|
5
4
|
import { usersActions } from "@ax/containers/Users";
|
|
6
5
|
import { getDaysAgo } from "@ax/helpers";
|
|
7
|
-
import {
|
|
6
|
+
import { useModal, usePermission, useToast } from "@ax/hooks";
|
|
8
7
|
import type { ICheck, IRole, ISite, ISiteRoles, IUser } from "@ax/types";
|
|
9
8
|
|
|
10
9
|
import * as S from "./style";
|
|
@@ -30,9 +29,6 @@ const UserItem = (props: IUserItemProps): JSX.Element => {
|
|
|
30
29
|
const { isOpen, toggleModal } = useModal();
|
|
31
30
|
const { isVisible, toggleToast, setIsVisible } = useToast();
|
|
32
31
|
|
|
33
|
-
const userCellRef = useRef<HTMLDivElement>(null);
|
|
34
|
-
const email = useAdaptiveText(userCellRef, user.email);
|
|
35
|
-
|
|
36
32
|
const isAllowedToRemoveUsers = usePermission("usersRoles.removeUsers");
|
|
37
33
|
|
|
38
34
|
const handleOnChange = (value: ICheck) => onChange(value);
|
|
@@ -163,10 +159,22 @@ const UserItem = (props: IUserItemProps): JSX.Element => {
|
|
|
163
159
|
<S.AvatarWrapper>
|
|
164
160
|
<Avatar image={user.image?.thumb} name={user.name} />
|
|
165
161
|
</S.AvatarWrapper>
|
|
166
|
-
<S.UserInfo
|
|
167
|
-
<S.UserName>
|
|
168
|
-
|
|
169
|
-
|
|
162
|
+
<S.UserInfo>
|
|
163
|
+
<S.UserName>
|
|
164
|
+
<TruncatedTooltip content={user.name} expanded top={-5}>
|
|
165
|
+
<S.Name>{user.name}</S.Name>
|
|
166
|
+
</TruncatedTooltip>
|
|
167
|
+
</S.UserName>
|
|
168
|
+
<S.UserEmail>
|
|
169
|
+
<TruncatedTooltip content={user.email} expanded top={-5}>
|
|
170
|
+
<S.Email>{user.email}</S.Email>
|
|
171
|
+
</TruncatedTooltip>
|
|
172
|
+
</S.UserEmail>
|
|
173
|
+
<S.UserUsername>
|
|
174
|
+
<TruncatedTooltip content={`@${user.username}`} expanded top={-5}>
|
|
175
|
+
<S.Username>@{user.username}</S.Username>
|
|
176
|
+
</TruncatedTooltip>
|
|
177
|
+
</S.UserUsername>
|
|
170
178
|
</S.UserInfo>
|
|
171
179
|
</S.UserCell>
|
|
172
180
|
<S.RolesCell role="cell" onClick={handleClick} isSite={isSiteView} clickable={!actionIsDisabled}>
|
|
@@ -19,35 +19,88 @@ const UserCell = styled(Cell)<{ clickable: boolean }>`
|
|
|
19
19
|
justify-content: flex-start;
|
|
20
20
|
pointer-events: ${(p) => (p.clickable ? "auto" : "none")};
|
|
21
21
|
flex-wrap: nowrap;
|
|
22
|
+
min-width: 0;
|
|
23
|
+
> * {
|
|
24
|
+
min-width: 0;
|
|
25
|
+
}
|
|
22
26
|
`;
|
|
23
27
|
|
|
24
28
|
const AvatarWrapper = styled.div`
|
|
25
29
|
margin-right: ${(p) => p.theme.spacing.s};
|
|
30
|
+
flex-shrink: 0;
|
|
26
31
|
`;
|
|
27
32
|
|
|
28
33
|
const UserInfo = styled.div`
|
|
29
34
|
display: flex;
|
|
30
35
|
flex-flow: column nowrap;
|
|
31
|
-
|
|
36
|
+
flex-grow: 1;
|
|
37
|
+
min-width: 0;
|
|
32
38
|
`;
|
|
33
39
|
|
|
34
40
|
const UserName = styled.div`
|
|
35
41
|
${(p) => p.theme.textStyle.uiL};
|
|
36
42
|
color: ${(p) => p.theme.colors.textHighEmphasis};
|
|
43
|
+
width: 100%;
|
|
44
|
+
min-width: 0;
|
|
45
|
+
> * {
|
|
46
|
+
min-width: 0;
|
|
47
|
+
max-width: 100%;
|
|
48
|
+
}
|
|
49
|
+
`;
|
|
50
|
+
|
|
51
|
+
const Name = styled.div`
|
|
52
|
+
width: 100%;
|
|
53
|
+
${(p) => p.theme.textStyle.uiL};
|
|
54
|
+
color: ${(p) => p.theme.colors.textHighEmphasis};
|
|
55
|
+
overflow: hidden;
|
|
56
|
+
text-overflow: ellipsis;
|
|
57
|
+
white-space: nowrap;
|
|
58
|
+
display: block;
|
|
59
|
+
min-width: 0;
|
|
60
|
+
`;
|
|
61
|
+
|
|
62
|
+
const UserEmail = styled.div`
|
|
63
|
+
${(p) => p.theme.textStyle.uiXS};
|
|
64
|
+
color: ${(p) => p.theme.colors.textMediumEmphasis};
|
|
65
|
+
width: 100%;
|
|
66
|
+
min-width: 0;
|
|
67
|
+
> * {
|
|
68
|
+
min-width: 0;
|
|
69
|
+
max-width: 100%;
|
|
70
|
+
}
|
|
37
71
|
`;
|
|
38
72
|
|
|
39
|
-
const
|
|
73
|
+
const Email = styled.div`
|
|
74
|
+
width: 100%;
|
|
40
75
|
${(p) => p.theme.textStyle.uiXS};
|
|
41
76
|
color: ${(p) => p.theme.colors.textMediumEmphasis};
|
|
42
77
|
overflow: hidden;
|
|
43
|
-
white-space: nowrap;
|
|
44
78
|
text-overflow: ellipsis;
|
|
45
|
-
|
|
79
|
+
white-space: nowrap;
|
|
80
|
+
display: block;
|
|
81
|
+
min-width: 0;
|
|
46
82
|
`;
|
|
47
83
|
|
|
48
84
|
const UserUsername = styled.div`
|
|
49
85
|
${(p) => p.theme.textStyle.uiXS};
|
|
50
86
|
color: ${(p) => p.theme.colors.textMediumEmphasis};
|
|
87
|
+
width: 100%;
|
|
88
|
+
min-width: 0;
|
|
89
|
+
> * {
|
|
90
|
+
min-width: 0;
|
|
91
|
+
max-width: 100%;
|
|
92
|
+
}
|
|
93
|
+
`;
|
|
94
|
+
|
|
95
|
+
const Username = styled.div`
|
|
96
|
+
width: 100%;
|
|
97
|
+
${(p) => p.theme.textStyle.uiXS};
|
|
98
|
+
color: ${(p) => p.theme.colors.textMediumEmphasis};
|
|
99
|
+
overflow: hidden;
|
|
100
|
+
text-overflow: ellipsis;
|
|
101
|
+
white-space: nowrap;
|
|
102
|
+
display: block;
|
|
103
|
+
min-width: 0;
|
|
51
104
|
`;
|
|
52
105
|
|
|
53
106
|
const StatusCell = styled(Cell)`
|
|
@@ -103,8 +156,11 @@ export {
|
|
|
103
156
|
AvatarWrapper,
|
|
104
157
|
UserInfo,
|
|
105
158
|
UserName,
|
|
159
|
+
Name,
|
|
106
160
|
UserEmail,
|
|
161
|
+
Email,
|
|
107
162
|
UserUsername,
|
|
163
|
+
Username,
|
|
108
164
|
ActionsCell,
|
|
109
165
|
ActionsWrapper,
|
|
110
166
|
StyledActionMenu,
|