@griddo/ax 1.74.3 → 1.74.5
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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@griddo/ax",
|
|
3
3
|
"description": "Griddo Author Experience",
|
|
4
|
-
"version": "1.74.
|
|
4
|
+
"version": "1.74.5",
|
|
5
5
|
"authors": [
|
|
6
6
|
"Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
|
|
7
7
|
"Carlos Torres <carlos.torres@secuoyas.com>",
|
|
@@ -229,5 +229,5 @@
|
|
|
229
229
|
"publishConfig": {
|
|
230
230
|
"access": "public"
|
|
231
231
|
},
|
|
232
|
-
"gitHead": "
|
|
232
|
+
"gitHead": "363edaabec5d675e95c131bd11478c8b065e540a"
|
|
233
233
|
}
|
|
@@ -166,18 +166,19 @@ const SitesList = (props: ISitesListProps): JSX.Element => {
|
|
|
166
166
|
</S.SectionHeader>
|
|
167
167
|
);
|
|
168
168
|
|
|
169
|
-
const
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
<S.
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
.map((site: ISite, i: number) => (
|
|
169
|
+
const currentRecentSites = recentSites.filter((site: ISite) => userHasSite(site.id));
|
|
170
|
+
const RecentSitesList = () => {
|
|
171
|
+
return (
|
|
172
|
+
<S.RecentSites data-testid="recent-sites-list" fullWidth={currentRecentSites.length >= 5}>
|
|
173
|
+
<RecentSitesHeader />
|
|
174
|
+
<S.RecentSitesItemsWrapper data-testid="recent-sites-items-wrapper" isHidden={!isRecentSitesListDisplayed}>
|
|
175
|
+
{currentRecentSites.map((site: ISite, i: number) => (
|
|
176
176
|
<RecentSiteItem key={i} site={site} />
|
|
177
177
|
))}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
178
|
+
</S.RecentSitesItemsWrapper>
|
|
179
|
+
</S.RecentSites>
|
|
180
|
+
);
|
|
181
|
+
};
|
|
181
182
|
|
|
182
183
|
const AllSitesHeader = () => (
|
|
183
184
|
<S.SectionHeader data-testid="all-sites-header">
|
|
@@ -259,18 +260,18 @@ const SitesList = (props: ISitesListProps): JSX.Element => {
|
|
|
259
260
|
/>
|
|
260
261
|
);
|
|
261
262
|
|
|
263
|
+
const currentSites = sites.filter((site: ISite) => userHasSite(site.id));
|
|
264
|
+
|
|
262
265
|
const mappedSites =
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
);
|
|
273
|
-
})
|
|
266
|
+
currentSites.length > 0 ? (
|
|
267
|
+
currentSites.map((site: ISite) => {
|
|
268
|
+
const isItemSelected = isSelected(site.id);
|
|
269
|
+
return displayMode === "grid" ? (
|
|
270
|
+
<GridSiteItem key={site.id} site={site} />
|
|
271
|
+
) : (
|
|
272
|
+
<ListSiteItem key={site.id} site={site} isSelected={isItemSelected} onCheck={handleAddToBulk} />
|
|
273
|
+
);
|
|
274
|
+
})
|
|
274
275
|
) : (
|
|
275
276
|
<S.EmptyStateWrapper data-testid="empty-state">
|
|
276
277
|
<EmptyState icon="search" message="We couldn't find what you are looking for. Please, try another search." />
|
|
@@ -278,7 +279,7 @@ const SitesList = (props: ISitesListProps): JSX.Element => {
|
|
|
278
279
|
);
|
|
279
280
|
|
|
280
281
|
const GridList = () => (
|
|
281
|
-
<S.GridList data-testid="sites-grid-list" isEmpty={
|
|
282
|
+
<S.GridList data-testid="sites-grid-list" isEmpty={currentSites.length === 0} fullWidth={currentSites.length >= 5}>
|
|
282
283
|
{mappedSites}
|
|
283
284
|
</S.GridList>
|
|
284
285
|
);
|
|
@@ -299,7 +300,7 @@ const SitesList = (props: ISitesListProps): JSX.Element => {
|
|
|
299
300
|
return (
|
|
300
301
|
<MainWrapper title="Sites" rightButton={rightButtonProps} searchAction={setSearchQuery}>
|
|
301
302
|
<ErrorToast />
|
|
302
|
-
{
|
|
303
|
+
{currentRecentSites?.length > 0 ? <RecentSitesList /> : null}
|
|
303
304
|
<AllSitesHeader />
|
|
304
305
|
<AllSitesList />
|
|
305
306
|
<Modal
|
|
@@ -46,7 +46,8 @@ const CollapseButton = styled.div`
|
|
|
46
46
|
cursor: pointer;
|
|
47
47
|
`;
|
|
48
48
|
|
|
49
|
-
const RecentSites = styled.div
|
|
49
|
+
const RecentSites = styled.div<{ fullWidth: boolean }>`
|
|
50
|
+
display: ${(p) => (p.fullWidth ? "block" : "inline-block")};
|
|
50
51
|
padding-bottom: ${(p) => p.theme.spacing.s};
|
|
51
52
|
border-radius: ${(p) => p.theme.radii.s};
|
|
52
53
|
background: ${(p) => p.theme.color.uiBackground02};
|
|
@@ -105,19 +106,21 @@ const RecentSitesItemsWrapper = styled.div<{ isHidden: boolean }>`
|
|
|
105
106
|
}
|
|
106
107
|
`;
|
|
107
108
|
|
|
108
|
-
const GridList = styled.div<{ isEmpty: boolean }>`
|
|
109
|
+
const GridList = styled.div<{ isEmpty: boolean; fullWidth: boolean }>`
|
|
109
110
|
padding-top: ${(p) => p.theme.spacing.s};
|
|
110
111
|
padding-bottom: ${(p) => p.theme.spacing.m};
|
|
111
112
|
margin: 0 ${(p) => p.theme.spacing.m};
|
|
112
113
|
|
|
113
|
-
${({ isEmpty, theme }) =>
|
|
114
|
+
${({ isEmpty, theme, fullWidth }) =>
|
|
114
115
|
isEmpty
|
|
115
116
|
? `
|
|
116
117
|
display: flex;
|
|
117
118
|
justify-content: center;
|
|
118
119
|
`
|
|
119
120
|
: `display: grid;
|
|
120
|
-
grid-template-columns:
|
|
121
|
+
grid-template-columns: ${
|
|
122
|
+
fullWidth ? "repeat(auto-fit, minmax(270px, 1fr))" : "repeat(auto-fit, minmax(270px, 270px))"
|
|
123
|
+
};
|
|
121
124
|
grid-gap: ${theme.spacing.m};
|
|
122
125
|
`}
|
|
123
126
|
`;
|