@griddo/ax 11.10.8-rc.0 → 11.10.9-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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@griddo/ax",
3
3
  "description": "Griddo Author Experience",
4
- "version": "11.10.8-rc.0",
4
+ "version": "11.10.9-rc.0",
5
5
  "authors": [
6
6
  "Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
7
7
  "Diego M. Béjar <diego.bejar@secuoyas.com>",
@@ -225,5 +225,5 @@
225
225
  "publishConfig": {
226
226
  "access": "public"
227
227
  },
228
- "gitHead": "f07d368d778629b3b52e4eeac70c0c45dae7ea16"
228
+ "gitHead": "fde83bb0512c954096f538205bfbfa479239711b"
229
229
  }
@@ -104,6 +104,7 @@ export const StyledSelect = styled(AsyncSelect)<{
104
104
  border: none;
105
105
  height: auto;
106
106
  min-width: auto;
107
+ justify-content: flex-start;
107
108
 
108
109
  .react-select__value-container {
109
110
  flex: 0 1 auto;
@@ -51,6 +51,7 @@ const TagsField = (props: IProps): JSX.Element => {
51
51
  placeholder={placeholder}
52
52
  onKeyDown={_handleKeyDown}
53
53
  disabled={disabled}
54
+ spellCheck={true}
54
55
  />
55
56
  </S.Wrapper>
56
57
  );
@@ -45,6 +45,7 @@ const TextArea = (props: ITextAreaProps): JSX.Element => {
45
45
  placeholder={placeholder}
46
46
  $error={error}
47
47
  disabled={disabled}
48
+ spellCheck={true}
48
49
  />
49
50
  );
50
51
  };
@@ -101,7 +101,9 @@ const TextField = (props: ITextFieldProps): JSX.Element => {
101
101
  hasPrefix={!!prefix}
102
102
  prefixWidth={width}
103
103
  aria-label={name}
104
+ // eslint-disable-next-line jsx-a11y/no-autofocus
104
105
  autoFocus={focus}
106
+ spellCheck={true}
105
107
  />
106
108
  {hasBackgroundIcon && (
107
109
  <S.BackgroundIcon data-testid="background-icon-component" onClick={onClickIcon} inversed={inversed}>
@@ -211,6 +211,11 @@ const Gallery = (props: IProps): JSX.Element => {
211
211
  const filterItems = async (filterPointer: string, filtersSelected: IQueryValue[]) =>
212
212
  setFiltersSelection(filterPointer, filtersSelected);
213
213
 
214
+ const handleSearch = (query: string) => {
215
+ setSearchQuery(query);
216
+ setPage(firstPage);
217
+ };
218
+
214
219
  const foldersIcon = isPanelOpen ? <Icon name="closePanel" size="24" /> : <Icon name="openPanel" size="24" />;
215
220
 
216
221
  const emptySearchStateProps = {
@@ -254,7 +259,7 @@ const Gallery = (props: IProps): JSX.Element => {
254
259
  <S.Search>
255
260
  {!isSiteView && <S.FiltersGlobal>{filters}</S.FiltersGlobal>}
256
261
  <SearchField
257
- onChange={setSearchQuery}
262
+ onChange={handleSearch}
258
263
  value={searchQuery}
259
264
  placeholder="Type an image’s name, title, or #tag"
260
265
  focus={false}
@@ -269,7 +274,7 @@ const Gallery = (props: IProps): JSX.Element => {
269
274
  ) : (
270
275
  <>
271
276
  <S.SearchTags>
272
- <SearchTagsBar query={searchQuery} setQuery={setSearchQuery} />
277
+ <SearchTagsBar query={searchQuery} setQuery={handleSearch} />
273
278
  <FilterTagsBar
274
279
  filters={filterValues}
275
280
  setFilters={setFiltersSelection}
@@ -1,11 +1,10 @@
1
1
  import React, { useState, useEffect } from "react";
2
2
  import { connect } from "react-redux";
3
3
 
4
- import { IContentType, IGlobalLanguage, IPage, IRootState, ISite } from "@ax/types";
5
- import { useDebounce } from "@ax/hooks";
4
+ import { IContentType, IGetSitePagesParams, IGlobalLanguage, IPage, IRootState, ISite } from "@ax/types";
6
5
  import { getStructuredDataTitle, isReqOk } from "@ax/helpers";
7
6
  import { sites, structuredData } from "@ax/api";
8
- import { Loader, Pagination, TextField, Select, Button, AsyncSelect } from "@ax/components";
7
+ import { Loader, Pagination, Select, Button, AsyncSelect, SearchField } from "@ax/components";
9
8
  import SelectionListItem from "./SelectionListItem";
10
9
 
11
10
  import * as S from "./style";
@@ -15,33 +14,40 @@ const PageFinder = (props: IPageFinderProps): JSX.Element => {
15
14
 
16
15
  const langOptions = globalLangs.map((lang) => ({ label: lang.label, value: lang.id.toString() }));
17
16
 
18
- const initialState = {
17
+ const initialState: IState = {
19
18
  site: currentSiteID || allSites[0].id,
20
19
  lang: lang.id,
21
20
  type: "all",
22
- query: "",
23
21
  items: [],
24
22
  page: 1,
25
23
  totalItems: 0,
26
24
  };
27
- const [state, setState] = useState(initialState);
25
+
26
+ const [state, setState] = useState<IState>(initialState);
28
27
  const [isLoading, setIsLoading] = useState(false);
29
28
  const [selectedPages, setSelectedPages] = useState<IPage[]>([]);
30
29
  const [selectedPagesIds, setSelectedPagesIds] = useState<number[]>(pages ? pages : []);
31
30
  const [showSelected, setShowSelected] = useState(false);
32
- const debouncedSearch = useDebounce(state.query);
31
+ const [searchQuery, setSearchQuery] = useState<string>("");
32
+
33
+ const defultTypeOptions = [
34
+ { label: "All content", value: "all" },
35
+ { label: "Base templates", value: "basic" },
36
+ { label: "List pages", value: "list" },
37
+ { label: "Static pages", value: "static" },
38
+ ];
33
39
 
34
- const allTypesOption = { label: "All content", value: "all" };
35
- const [contentTypeOptions, setContentTypeOptions] = useState<{ label: string; value: string }[]>([
36
- { ...allTypesOption },
37
- ]);
40
+ const [contentTypeOptions, setContentTypeOptions] = useState<{ label: string; value: string }[]>(defultTypeOptions);
38
41
 
39
42
  const changeContentTypeOptions = (types: { label: string; value: string }[]) =>
40
- setContentTypeOptions([allTypesOption, ...types]);
43
+ setContentTypeOptions([...defultTypeOptions, ...types]);
41
44
 
42
45
  const itemsPerPage = 50;
43
46
 
44
- const resetQuery = () => setState((state) => ({ ...state, query: "" }));
47
+ const resetQuery = () => {
48
+ setSearchQuery("");
49
+ setPage(1);
50
+ };
45
51
 
46
52
  const changeState = (key: string, value: string | number | null) => setState((state) => ({ ...state, [key]: value }));
47
53
 
@@ -52,16 +58,19 @@ const PageFinder = (props: IPageFinderProps): JSX.Element => {
52
58
 
53
59
  useEffect(() => {
54
60
  let isMounted = true;
55
- const params = {
61
+ const params: IGetSitePagesParams = {
56
62
  deleted: false,
57
63
  filterPages: selectedPagesIds,
58
- siteID: state.site,
64
+ siteID: state.site || "global",
59
65
  ignoreLang: true,
60
66
  };
61
67
 
62
68
  const getSelectedItems = async () => {
63
69
  if (!isMounted) return;
64
- const response: { status: number; data: { totalItems: number; items: any } } = await sites.getSitePages(params);
70
+
71
+ const response: { status: number; data: { totalItems: number; items: IPage[] } } =
72
+ await sites.getSitePages(params);
73
+
65
74
  if (isReqOk(response.status)) {
66
75
  setSelectedPages(response.data.items);
67
76
  } else {
@@ -81,22 +90,30 @@ const PageFinder = (props: IPageFinderProps): JSX.Element => {
81
90
 
82
91
  useEffect(() => {
83
92
  let isMounted = true;
84
- const params = {
85
- siteID: state.site,
93
+
94
+ const isTypeFilter = (value: string) => ["basic", "list", "static"].includes(value);
95
+
96
+ const params: IGetSitePagesParams = {
97
+ siteID: state.site || "global",
86
98
  deleted: false,
87
99
  page: state.page,
88
100
  itemsPerPage,
89
- query: debouncedSearch,
101
+ query: searchQuery,
90
102
  lang: state.lang,
91
- filterStructuredData: state.type,
103
+ filterStructuredData: isTypeFilter(state.type) ? "all" : state.type,
92
104
  format: "list",
93
105
  };
94
106
 
107
+ const filterQuery = isTypeFilter(state.type) ? `&type=${state.type}` : "";
108
+
95
109
  const getAndSetItems = async () => {
96
110
  if (!isMounted) return;
97
111
 
98
112
  setIsLoading(true);
99
- const response: { status: number; data: { totalItems: number; items: any } } = await sites.getSitePages(params);
113
+ const response: { status: number; data: { totalItems: number; items: IPage[] } } = await sites.getSitePages(
114
+ params,
115
+ filterQuery
116
+ );
100
117
  if (isReqOk(response.status)) {
101
118
  setState((state) => ({ ...state, items: response.data.items, totalItems: response.data.totalItems }));
102
119
  } else {
@@ -110,12 +127,14 @@ const PageFinder = (props: IPageFinderProps): JSX.Element => {
110
127
  isMounted = false;
111
128
  };
112
129
  // eslint-disable-next-line react-hooks/exhaustive-deps
113
- }, [currentSiteID, debouncedSearch, state.page, state.lang, state.site, state.type]);
130
+ }, [currentSiteID, searchQuery, state.page, state.lang, state.site, state.type]);
114
131
 
115
132
  const getAndSetContentTypes = async () => {
116
133
  const { site, lang } = state;
117
134
  const { data } = await structuredData.getContentTypes(site, lang);
118
- const contentTypes = data.items ? data.items.map((type: IContentType) => ({ label: type.title, value: type.id })) : [];
135
+ const contentTypes = data.items
136
+ ? data.items.map((type: IContentType) => ({ label: type.title, value: type.id }))
137
+ : [];
119
138
  changeContentTypeOptions(contentTypes);
120
139
  changeState("type", "all");
121
140
  };
@@ -125,14 +144,6 @@ const PageFinder = (props: IPageFinderProps): JSX.Element => {
125
144
  // eslint-disable-next-line react-hooks/exhaustive-deps
126
145
  }, [state.site]);
127
146
 
128
- const textFieldProps = {
129
- value: state.query,
130
- onChange: (search: string) => changeState("query", search),
131
- placeholder: "Search",
132
- icon: "search",
133
- iconPosition: "in",
134
- };
135
-
136
147
  const setPage = (newPage: number) => changeState("page", newPage);
137
148
 
138
149
  const handleChange = (item: { value: IPage; isChecked: boolean }) => {
@@ -154,6 +165,11 @@ const PageFinder = (props: IPageFinderProps): JSX.Element => {
154
165
 
155
166
  const handleButtonClick = () => onClick(selectedPages);
156
167
 
168
+ const handleSearch = (query: string) => {
169
+ setSearchQuery(query);
170
+ setPage(1);
171
+ };
172
+
157
173
  const getPageList = (items: IPage[]) =>
158
174
  items &&
159
175
  items.map((page: IPage) => (
@@ -173,8 +189,6 @@ const PageFinder = (props: IPageFinderProps): JSX.Element => {
173
189
 
174
190
  const showPagination = state.totalItems > itemsPerPage;
175
191
 
176
- const hasQuery = state.query.length > 0;
177
-
178
192
  const buttonText = !showSelected ? `view selected (${selectedPages.length})` : "hide selected";
179
193
 
180
194
  return (
@@ -217,11 +231,13 @@ const PageFinder = (props: IPageFinderProps): JSX.Element => {
217
231
  />
218
232
  </S.ContentTypeFilter>
219
233
  <S.SearchWrapper>
220
- {hasQuery ? (
221
- <TextField {...textFieldProps} onClickIcon={resetQuery} icon="close" />
222
- ) : (
223
- <TextField {...textFieldProps} />
224
- )}
234
+ <SearchField
235
+ onChange={handleSearch}
236
+ placeholder="Search"
237
+ value={searchQuery}
238
+ searchOnEnter={false}
239
+ focus={false}
240
+ />
225
241
  </S.SearchWrapper>
226
242
  <S.LowText>Most recent content</S.LowText>
227
243
  {isLoading ? (
@@ -255,6 +271,15 @@ const PageFinder = (props: IPageFinderProps): JSX.Element => {
255
271
  );
256
272
  };
257
273
 
274
+ interface IState {
275
+ site: number | null;
276
+ lang: number;
277
+ type: string;
278
+ items: IPage[];
279
+ page: number;
280
+ totalItems: number;
281
+ }
282
+
258
283
  interface IPageFinderProps {
259
284
  onClick: (value: IPage | IPage[]) => void;
260
285
  currentSiteID: number | null;
@@ -7,6 +7,10 @@ const Wrapper = styled.div`
7
7
  height: 100%;
8
8
  padding-bottom: ${(p) => p.theme.spacing.xl};
9
9
  flex-direction: column;
10
+
11
+ #react-select-7-option-3 {
12
+ border-bottom: 1px solid ${(p) => p.theme.color.uiLine};
13
+ }
10
14
  `;
11
15
 
12
16
  const ListWrapper = styled.div`
@@ -112,14 +112,14 @@ const EventItem = (props: IEventItemProps) => {
112
112
  </S.ContentType>
113
113
  <S.Event>
114
114
  {eventType?.name || ""}{" "}
115
- <div
115
+ <span
116
116
  onClick={!isDeleteEvent ? handleClick : undefined}
117
117
  role="button"
118
118
  tabIndex={0}
119
119
  onKeyDown={!isDeleteEvent ? handleKeyDown : undefined}
120
120
  >
121
121
  {content?.title || contentType?.title || ""}
122
- </div>
122
+ </span>
123
123
  </S.Event>
124
124
  </S.Item>
125
125
  <DetailModal
@@ -65,12 +65,14 @@ const ContentType = styled.div`
65
65
 
66
66
  const Event = styled.div`
67
67
  ${(p) => p.theme.textStyle.uiS};
68
- display: flex;
69
- align-items: center;
70
68
  color: ${(p) => p.theme.colors.textMediumEmphasis};
71
69
  width: 38%;
72
70
  padding-right: ${(p) => p.theme.spacing.s};
73
- div {
71
+ align-content: center;
72
+ text-overflow: ellipsis;
73
+ white-space: nowrap;
74
+ overflow: hidden;
75
+ span {
74
76
  margin-left: ${(p) => p.theme.spacing.xxs};
75
77
  color: ${(p) => p.theme.colors.interactive01};
76
78
  }
@@ -97,14 +97,14 @@ const EventItem = (props: IEventItemProps) => {
97
97
  <S.Time>{created.hour}</S.Time>
98
98
  <S.Event>
99
99
  {eventType?.name || ""}{" "}
100
- <div
100
+ <span
101
101
  onClick={!isDeleteEvent ? handleClick : undefined}
102
102
  role="button"
103
103
  tabIndex={0}
104
104
  onKeyDown={!isDeleteEvent ? handleKeyDown : undefined}
105
105
  >
106
106
  {content?.title || contentType?.title || ""}
107
- </div>
107
+ </span>
108
108
  </S.Event>
109
109
  </S.EventWrapper>
110
110
  <S.Site>
@@ -56,11 +56,13 @@ const ContentType = styled.div`
56
56
 
57
57
  const Event = styled.div`
58
58
  ${(p) => p.theme.textStyle.uiS};
59
- display: flex;
60
- align-items: center;
59
+ align-content: center;
60
+ text-overflow: ellipsis;
61
+ white-space: nowrap;
62
+ overflow: hidden;
61
63
  color: ${(p) => p.theme.colors.textMediumEmphasis};
62
- flex-grow: 1;
63
- div {
64
+ width: 100%;
65
+ span {
64
66
  margin-left: ${(p) => p.theme.spacing.xxs};
65
67
  color: ${(p) => p.theme.colors.interactive01};
66
68
  }
@@ -109,6 +109,11 @@ const ActivityLog = (props: IActivityLogProps) => {
109
109
  setFiltersSelection(filterPointer, filtersSelected);
110
110
  };
111
111
 
112
+ const handleSearch = (query: string) => {
113
+ setSearchQuery(query);
114
+ setPage(firstPage);
115
+ };
116
+
112
117
  const handleDownloadLog = async () => {
113
118
  const nowString = format(new Date(), "yyyy/MM/dd");
114
119
  let startDate = nowString;
@@ -208,7 +213,7 @@ const ActivityLog = (props: IActivityLogProps) => {
208
213
  title="Logs"
209
214
  rightButton={rightButtonProps}
210
215
  rightLineButton={rightLineButtonProps}
211
- searchAction={setSearchQuery}
216
+ searchAction={handleSearch}
212
217
  searchValue={searchQuery}
213
218
  >
214
219
  <S.TableWrapper>
@@ -243,7 +248,7 @@ const ActivityLog = (props: IActivityLogProps) => {
243
248
  tableRef={tableRef}
244
249
  >
245
250
  <S.SearchTags>
246
- <SearchTagsBar query={searchQuery} setQuery={setSearchQuery} />
251
+ <SearchTagsBar query={searchQuery} setQuery={handleSearch} />
247
252
  <FilterTagsBar
248
253
  filters={filterValues}
249
254
  setFilters={setFiltersSelection}
@@ -827,6 +827,11 @@ const Content = (props: IProps): JSX.Element => {
827
827
 
828
828
  const addNewAction = baseFilters.includes(filter) || isGlobalPages ? toggleNewModal : addNewData;
829
829
 
830
+ const handleSearch = (query: string) => {
831
+ updateCurrentSearch(query);
832
+ setPage(1);
833
+ };
834
+
830
835
  const rightButtonProps = isAllowedToCreatePages
831
836
  ? {
832
837
  label: "New",
@@ -858,7 +863,7 @@ const Content = (props: IProps): JSX.Element => {
858
863
  languageAction={handleLanguage}
859
864
  availableLanguages={siteLanguages}
860
865
  rightButton={rightButtonProps}
861
- searchAction={updateCurrentSearch}
866
+ searchAction={handleSearch}
862
867
  errors={errors}
863
868
  searchValue={currentSearch}
864
869
  exportAction={exportContent}
@@ -908,7 +913,7 @@ const Content = (props: IProps): JSX.Element => {
908
913
  tableRef={tableRef}
909
914
  >
910
915
  <S.SearchTags>
911
- <SearchTagsBar query={currentSearch} setQuery={updateCurrentSearch} />
916
+ <SearchTagsBar query={currentSearch} setQuery={handleSearch} />
912
917
  <FilterTagsBar
913
918
  filters={filterValues}
914
919
  setFilters={setFiltersSelection}
@@ -224,6 +224,11 @@ const FormList = (props: IUserListProps): JSX.Element => {
224
224
  toggleDeleteModal();
225
225
  };
226
226
 
227
+ const handleSearch = (query: string) => {
228
+ setSearchQuery(query);
229
+ setPage(1);
230
+ };
231
+
227
232
  const bulkActions = isAllowedToPublishForm
228
233
  ? [
229
234
  {
@@ -326,7 +331,7 @@ const FormList = (props: IUserListProps): JSX.Element => {
326
331
  language={lang}
327
332
  availableLanguages={availableLanguages}
328
333
  languageAction={handleLanguage}
329
- searchAction={setSearchQuery}
334
+ searchAction={handleSearch}
330
335
  searchValue={searchQuery}
331
336
  >
332
337
  <S.FormListWrapper ref={wrapperRef} data-testid="forms-wrapper">
@@ -355,7 +360,7 @@ const FormList = (props: IUserListProps): JSX.Element => {
355
360
  >
356
361
  <>
357
362
  <S.SearchTags>
358
- <SearchTagsBar query={searchQuery} setQuery={setSearchQuery} />
363
+ <SearchTagsBar query={searchQuery} setQuery={handleSearch} />
359
364
  <FilterTagsBar
360
365
  filters={filterValues}
361
366
  setFilters={setFiltersSelection}
@@ -461,6 +461,11 @@ const MediaGallery = (props: IProps) => {
461
461
  setFiltersSelection(filterPointer, filtersSelected);
462
462
  };
463
463
 
464
+ const handleSearch = (query: string) => {
465
+ setSearchQuery(query);
466
+ setPage(firstPage);
467
+ };
468
+
464
469
  let bulkActions: IBulkAction[] = [];
465
470
 
466
471
  if (allowedToEditFile) {
@@ -706,7 +711,7 @@ const MediaGallery = (props: IProps) => {
706
711
  <S.FiltersBar isSite={false}>
707
712
  {isSiteView && filters}
708
713
  <S.SearchWrapper>
709
- <SearchField onChange={setSearchQuery} placeholder="Search" value={searchQuery} focus={false} />
714
+ <SearchField onChange={handleSearch} placeholder="Search" value={searchQuery} focus={false} />
710
715
  </S.SearchWrapper>
711
716
  </S.FiltersBar>
712
717
  {isLoading ? (
@@ -714,7 +719,7 @@ const MediaGallery = (props: IProps) => {
714
719
  ) : (
715
720
  <S.FolderContent>
716
721
  <S.SearchTags>
717
- <SearchTagsBar query={searchQuery} setQuery={setSearchQuery} />
722
+ <SearchTagsBar query={searchQuery} setQuery={handleSearch} />
718
723
  <FilterTagsBar
719
724
  filters={filterValues}
720
725
  setFilters={setFiltersSelection}
@@ -154,6 +154,11 @@ const Redirects = (props: IProps): JSX.Element => {
154
154
  setFiltersSelection(filterPointer, filtersSelected);
155
155
  };
156
156
 
157
+ const handleSearch = (query: string) => {
158
+ setSearchQuery(query);
159
+ setPage(firstPage);
160
+ };
161
+
157
162
  const TableHeader = (
158
163
  <BulkHeader
159
164
  showBulk={areItemsSelected(redIds)}
@@ -272,7 +277,7 @@ const Redirects = (props: IProps): JSX.Element => {
272
277
  title="SEO Settings"
273
278
  rightButton={rightButtonProps}
274
279
  rightLineButton={rightLineButtonProps}
275
- searchAction={setSearchQuery}
280
+ searchAction={handleSearch}
276
281
  filterSearchAction={setSearchFilter}
277
282
  searchFilters={searchFilters}
278
283
  searchValue={searchQuery}
@@ -297,7 +302,7 @@ const Redirects = (props: IProps): JSX.Element => {
297
302
  >
298
303
  <>
299
304
  <S.SearchTags>
300
- <SearchTagsBar query={searchQuery} setQuery={setSearchQuery} />
305
+ <SearchTagsBar query={searchQuery} setQuery={handleSearch} />
301
306
  {!currentSite && (
302
307
  <FilterTagsBar
303
308
  filters={filterValues}
@@ -342,11 +342,16 @@ const SitesList = (props: ISitesListProps): JSX.Element => {
342
342
  liveStatus: "Live",
343
343
  };
344
344
 
345
+ const handleSearch = (query: string) => {
346
+ setSearchQuery(query);
347
+ setPage(1);
348
+ };
349
+
345
350
  const listTable = (
346
351
  <TableList tableHeader={Header} pagination={pagination} hasFixedHeader={true} tableRef={tableRef}>
347
352
  <>
348
353
  <S.SearchTags>
349
- <SearchTagsBar query={searchQuery} setQuery={setSearchQuery} />
354
+ <SearchTagsBar query={searchQuery} setQuery={handleSearch} />
350
355
  <FilterTagsBar
351
356
  filters={filterValues}
352
357
  setFilters={setFiltersSelection}
@@ -369,7 +374,7 @@ const SitesList = (props: ISitesListProps): JSX.Element => {
369
374
  <MainWrapper
370
375
  title="Sites"
371
376
  rightButton={rightButtonProps}
372
- searchAction={setSearchQuery}
377
+ searchAction={handleSearch}
373
378
  hasAnimation={hasAnimation}
374
379
  searchValue={searchQuery}
375
380
  >
@@ -548,6 +548,11 @@ const StructuredDataList = (props: IProps): JSX.Element => {
548
548
  languageAction: isAllPages || isDataTranslatable ? handleLanguage : undefined,
549
549
  };
550
550
 
551
+ const handleSearch = (query: string) => {
552
+ updateCurrentSearch(query);
553
+ setPage(1);
554
+ };
555
+
551
556
  const selectedValue = getSelectedValue(options, filter);
552
557
 
553
558
  const mapCurrentDataContent = () =>
@@ -634,7 +639,7 @@ const StructuredDataList = (props: IProps): JSX.Element => {
634
639
  availableLanguages={languageProps.globalLangs}
635
640
  language={languageProps.lang}
636
641
  languageAction={languageProps.languageAction}
637
- searchAction={updateCurrentSearch}
642
+ searchAction={handleSearch}
638
643
  searchValue={currentSearch}
639
644
  exportAction={exportContent}
640
645
  >
@@ -676,7 +681,7 @@ const StructuredDataList = (props: IProps): JSX.Element => {
676
681
  >
677
682
  <>
678
683
  <S.SearchTags>
679
- <SearchTagsBar query={currentSearch} setQuery={updateCurrentSearch} />
684
+ <SearchTagsBar query={currentSearch} setQuery={handleSearch} />
680
685
  <FilterTagsBar
681
686
  filters={filterValues[currentStructuredData?.id || "all"]}
682
687
  setFilters={setFiltersSelection}
@@ -173,6 +173,11 @@ const UserList = (props: IUserListProps): JSX.Element => {
173
173
  setFiltersSelection(filterPointer, filtersSelected);
174
174
  };
175
175
 
176
+ const handleSearch = (query: string) => {
177
+ setSearchQuery(query);
178
+ setPage(firstPage);
179
+ };
180
+
176
181
  const handleClick = (id: number | null) => async () => {
177
182
  if (id) {
178
183
  await getUser(id);
@@ -223,7 +228,7 @@ const UserList = (props: IUserListProps): JSX.Element => {
223
228
  <MainWrapper
224
229
  title="Users & Roles"
225
230
  rightButton={rightButtonProps}
226
- searchAction={setSearchQuery}
231
+ searchAction={handleSearch}
227
232
  searchValue={searchQuery}
228
233
  >
229
234
  <S.UsersWrapper ref={wrapperRef} data-testid="users-wrapper">
@@ -239,7 +244,7 @@ const UserList = (props: IUserListProps): JSX.Element => {
239
244
  >
240
245
  <>
241
246
  <S.SearchTags>
242
- <SearchTagsBar query={searchQuery} setQuery={setSearchQuery} />
247
+ <SearchTagsBar query={searchQuery} setQuery={handleSearch} />
243
248
  <FilterTagsBar
244
249
  filters={filterValues}
245
250
  setFilters={setFiltersSelection}