Skip to content

Commit 6eb8244

Browse files
Merge branch 'dev' into table-expand/collapse-flow-with-sorting
2 parents 838ce1f + 38c4253 commit 6eb8244

File tree

17 files changed

+62
-29
lines changed

17 files changed

+62
-29
lines changed

src/ui/components/Filters/index.tsx

Lines changed: 45 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,24 @@ const FilterComponent = ({
609609
// break;
610610
// }
611611
}
612+
const authorOptions = members.map((item: any) => {
613+
return {
614+
label: item.name as string,
615+
value: item.id as string,
616+
};
617+
}) as any;
618+
const pipelinesOptions = pipelines.map((item: any) => {
619+
return {
620+
label: item.name as string,
621+
value: item.id as string,
622+
};
623+
}) as any;
624+
const stacksOptions = stacks.map((item: any) => {
625+
return {
626+
label: item.name as string,
627+
value: item.id as string,
628+
};
629+
}) as any;
612630
const valueField = (filter: any) => {
613631
switch (filter?.contains.selectedValue.type) {
614632
case 'string':
@@ -958,14 +976,19 @@ const FilterComponent = ({
958976
) : // <></>
959977
filter?.column?.selectedValue?.value === 'pipeline_id' ? (
960978
<Select
961-
getOptionLabel={(option: any) => option.name}
962-
getOptionValue={(option: any) => option.id}
963-
options={pipelines as any}
979+
// getOptionLabel={(option: any) => option.name}
980+
// getOptionValue={(option: any) => option.id}
981+
options={pipelinesOptions}
982+
defaultValue={pipelinesOptions.filter((el: any) => {
983+
return filters.some((f: any) => {
984+
return f.filterValue === el.value;
985+
});
986+
})}
964987
styles={selectStyles}
965988
onInputChange={(e: any) => callActionForPipelines(e)}
966989
onChange={(value: any) => {
967990
if (value) {
968-
handleChangeForSearchable(filter, value.id);
991+
handleChangeForSearchable(filter, value.value);
969992
}
970993
}}
971994
isClearable={true}
@@ -976,14 +999,19 @@ const FilterComponent = ({
976999
) : filter?.column?.selectedValue?.value ===
9771000
'stack_id' ? (
9781001
<Select
979-
getOptionLabel={(option: any) => option.name}
980-
getOptionValue={(option: any) => option.id}
981-
options={stacks as any}
1002+
// getOptionLabel={(option: any) => option.name}
1003+
// getOptionValue={(option: any) => option.id}
1004+
options={stacksOptions}
1005+
defaultValue={stacksOptions.filter((el: any) => {
1006+
return filters.some((f: any) => {
1007+
return f.filterValue === el.value;
1008+
});
1009+
})}
9821010
styles={selectStyles}
9831011
onInputChange={(e: any) => callActionForStacks(e)}
9841012
onChange={(value: any) => {
9851013
if (value) {
986-
handleChangeForSearchable(filter, value.id);
1014+
handleChangeForSearchable(filter, value.value);
9871015
}
9881016
}}
9891017
isClearable={true}
@@ -993,14 +1021,19 @@ const FilterComponent = ({
9931021
/>
9941022
) : (
9951023
<Select
996-
getOptionLabel={(option: any) => option.name}
997-
getOptionValue={(option: any) => option.id}
998-
options={members as any}
1024+
// getOptionLabel={(option: any) => option.name}
1025+
// getOptionValue={(option: any) => option.id}
1026+
options={authorOptions}
1027+
defaultValue={authorOptions.filter((el: any) => {
1028+
return filters.some((f: any) => {
1029+
return f.filterValue === el.value;
1030+
});
1031+
})}
9991032
styles={selectStyles}
10001033
onInputChange={(e: any) => callActionForUsers(e)}
10011034
onChange={(value: any) => {
10021035
if (value) {
1003-
handleChangeForSearchable(filter, value.id);
1036+
handleChangeForSearchable(filter, value.value);
10041037
}
10051038
}}
10061039
isClearable={true}

src/ui/layouts/common/layouts/AuthenticatedLayout/AuthenticatedHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export const AuthenticatedHeader: React.FC<{
148148
);
149149
await dispatch(
150150
pipelinesActions.getMy({
151-
sort_by: 'created',
151+
sort_by: 'desc:created',
152152
logical_operator: 'and',
153153
page: 1,
154154
size: ITEMS_PER_PAGE ? ITEMS_PER_PAGE : DEFAULT_ITEMS_PER_PAGE,

src/ui/layouts/pipelines/PipelineDetail/useService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const useService = (): ServiceInterface => {
3838
);
3939
dispatch(
4040
pipelinesActions.allRunsByPipelineId({
41-
sort_by: 'created',
41+
sort_by: 'desc:created',
4242
logical_operator: 'and',
4343
pipelineId: id,
4444
page: 1,

src/ui/layouts/pipelines/Pipelines/List/useService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export const useService = (
4848
const [
4949
activeSortingDirection,
5050
setActiveSortingDirection,
51-
] = React.useState<SortingDirection | null>('ASC');
51+
] = React.useState<SortingDirection | null>('DESC');
5252

5353
const dispatch = useDispatch();
5454

src/ui/layouts/pipelines/Pipelines/useService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const useService = (): ServiceInterface => {
3030
setFetchingForAllRuns(true);
3131
dispatch(
3232
runsActions.allRuns({
33-
sort_by: 'created',
33+
sort_by: 'desc:created',
3434
logical_operator: 'and',
3535
project: selectedProject,
3636
page: 1,
@@ -41,7 +41,7 @@ export const useService = (): ServiceInterface => {
4141
);
4242
dispatch(
4343
pipelinesActions.getMy({
44-
sort_by: 'created',
44+
sort_by: 'desc:created',
4545
logical_operator: 'and',
4646
page: 1,
4747
size: ITEMS_PER_PAGE ? ITEMS_PER_PAGE : DEFAULT_ITEMS_PER_PAGE,

src/ui/layouts/pipelines/RunsTable/useService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const useService = ({
4646
const [
4747
activeSortingDirection,
4848
setActiveSortingDirection,
49-
] = React.useState<SortingDirection | null>('ASC');
49+
] = React.useState<SortingDirection | null>('DESC');
5050
const [sortedRuns, setSortedRuns] = React.useState<TRun[]>([]);
5151

5252
const runs = pipelineRuns

src/ui/layouts/runs/RunsTable/useService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const useService = ({ runIds }: { runIds: TId[] }): ServiceInterface => {
2727
const [
2828
activeSortingDirection,
2929
setActiveSortingDirection,
30-
] = React.useState<SortingDirection | null>('ASC');
30+
] = React.useState<SortingDirection | null>('DESC');
3131
const [sortedRuns, setSortedRuns] = React.useState<TRun[]>([]);
3232

3333
const runs = useSelector(runSelectors.forRunIds(runIds));

src/ui/layouts/runs/Stacks/useService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const useService = (): ServiceInterface => {
2222
setFetching(true);
2323
dispatch(
2424
stacksActions.getMy({
25-
sort_by: 'created',
25+
sort_by: 'desc:created',
2626
logical_operator: 'and',
2727
page: 1,
2828
size: ITEMS_PER_PAGE ? ITEMS_PER_PAGE : DEFAULT_ITEMS_PER_PAGE,

src/ui/layouts/settings/Organization/useService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const useService = (): ServiceInterface => {
3333
const [
3434
activeSortingDirection,
3535
setActiveSortingDirection,
36-
] = React.useState<SortingDirection | null>('ASC');
36+
] = React.useState<SortingDirection | null>('DESC');
3737
const dispatch = useDispatch();
3838

3939
const members = useSelector(organizationSelectors.myMembers);

src/ui/layouts/stackComponents/RunsTable/useService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const useService = ({
4343
const [
4444
activeSortingDirection,
4545
setActiveSortingDirection,
46-
] = React.useState<SortingDirection | null>('ASC');
46+
] = React.useState<SortingDirection | null>('DESC');
4747
const [sortedRuns, setSortedRuns] = React.useState<TRun[]>([]);
4848

4949
const runs = useSelector(runSelectors.forRunIds(runIds));

0 commit comments

Comments
 (0)