Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 45 additions & 12 deletions src/ui/components/Filters/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,24 @@ const FilterComponent = ({
// break;
// }
}
const authorOptions = members.map((item: any) => {
return {
label: item.name as string,
value: item.id as string,
};
}) as any;
const pipelinesOptions = pipelines.map((item: any) => {
return {
label: item.name as string,
value: item.id as string,
};
}) as any;
const stacksOptions = stacks.map((item: any) => {
return {
label: item.name as string,
value: item.id as string,
};
}) as any;
const valueField = (filter: any) => {
switch (filter?.contains.selectedValue.type) {
case 'string':
Expand Down Expand Up @@ -958,14 +976,19 @@ const FilterComponent = ({
) : // <></>
filter?.column?.selectedValue?.value === 'pipeline_id' ? (
<Select
getOptionLabel={(option: any) => option.name}
getOptionValue={(option: any) => option.id}
options={pipelines as any}
// getOptionLabel={(option: any) => option.name}
// getOptionValue={(option: any) => option.id}
options={pipelinesOptions}
defaultValue={pipelinesOptions.filter((el: any) => {
return filters.some((f: any) => {
return f.filterValue === el.value;
});
})}
styles={selectStyles}
onInputChange={(e: any) => callActionForPipelines(e)}
onChange={(value: any) => {
if (value) {
handleChangeForSearchable(filter, value.id);
handleChangeForSearchable(filter, value.value);
}
}}
isClearable={true}
Expand All @@ -976,14 +999,19 @@ const FilterComponent = ({
) : filter?.column?.selectedValue?.value ===
'stack_id' ? (
<Select
getOptionLabel={(option: any) => option.name}
getOptionValue={(option: any) => option.id}
options={stacks as any}
// getOptionLabel={(option: any) => option.name}
// getOptionValue={(option: any) => option.id}
options={stacksOptions}
defaultValue={stacksOptions.filter((el: any) => {
return filters.some((f: any) => {
return f.filterValue === el.value;
});
})}
styles={selectStyles}
onInputChange={(e: any) => callActionForStacks(e)}
onChange={(value: any) => {
if (value) {
handleChangeForSearchable(filter, value.id);
handleChangeForSearchable(filter, value.value);
}
}}
isClearable={true}
Expand All @@ -993,14 +1021,19 @@ const FilterComponent = ({
/>
) : (
<Select
getOptionLabel={(option: any) => option.name}
getOptionValue={(option: any) => option.id}
options={members as any}
// getOptionLabel={(option: any) => option.name}
// getOptionValue={(option: any) => option.id}
options={authorOptions}
defaultValue={authorOptions.filter((el: any) => {
return filters.some((f: any) => {
return f.filterValue === el.value;
});
})}
styles={selectStyles}
onInputChange={(e: any) => callActionForUsers(e)}
onChange={(value: any) => {
if (value) {
handleChangeForSearchable(filter, value.id);
handleChangeForSearchable(filter, value.value);
}
}}
isClearable={true}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export const AuthenticatedHeader: React.FC<{
);
await dispatch(
pipelinesActions.getMy({
sort_by: 'created',
sort_by: 'desc:created',
logical_operator: 'and',
page: 1,
size: ITEMS_PER_PAGE ? ITEMS_PER_PAGE : DEFAULT_ITEMS_PER_PAGE,
Expand Down
2 changes: 1 addition & 1 deletion src/ui/layouts/pipelines/PipelineDetail/useService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const useService = (): ServiceInterface => {
);
dispatch(
pipelinesActions.allRunsByPipelineId({
sort_by: 'created',
sort_by: 'desc:created',
logical_operator: 'and',
pipelineId: id,
page: 1,
Expand Down
2 changes: 1 addition & 1 deletion src/ui/layouts/pipelines/Pipelines/List/useService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const useService = (
const [
activeSortingDirection,
setActiveSortingDirection,
] = React.useState<SortingDirection | null>('ASC');
] = React.useState<SortingDirection | null>('DESC');

const dispatch = useDispatch();

Expand Down
4 changes: 2 additions & 2 deletions src/ui/layouts/pipelines/Pipelines/useService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const useService = (): ServiceInterface => {
setFetchingForAllRuns(true);
dispatch(
runsActions.allRuns({
sort_by: 'created',
sort_by: 'desc:created',
logical_operator: 'and',
project: selectedProject,
page: 1,
Expand All @@ -41,7 +41,7 @@ export const useService = (): ServiceInterface => {
);
dispatch(
pipelinesActions.getMy({
sort_by: 'created',
sort_by: 'desc:created',
logical_operator: 'and',
page: 1,
size: ITEMS_PER_PAGE ? ITEMS_PER_PAGE : DEFAULT_ITEMS_PER_PAGE,
Expand Down
2 changes: 1 addition & 1 deletion src/ui/layouts/pipelines/RunsTable/useService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const useService = ({
const [
activeSortingDirection,
setActiveSortingDirection,
] = React.useState<SortingDirection | null>('ASC');
] = React.useState<SortingDirection | null>('DESC');
const [sortedRuns, setSortedRuns] = React.useState<TRun[]>([]);

const runs = pipelineRuns
Expand Down
2 changes: 1 addition & 1 deletion src/ui/layouts/runs/RunsTable/useService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const useService = ({ runIds }: { runIds: TId[] }): ServiceInterface => {
const [
activeSortingDirection,
setActiveSortingDirection,
] = React.useState<SortingDirection | null>('ASC');
] = React.useState<SortingDirection | null>('DESC');
const [sortedRuns, setSortedRuns] = React.useState<TRun[]>([]);

const runs = useSelector(runSelectors.forRunIds(runIds));
Expand Down
2 changes: 1 addition & 1 deletion src/ui/layouts/runs/Stacks/useService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const useService = (): ServiceInterface => {
setFetching(true);
dispatch(
stacksActions.getMy({
sort_by: 'created',
sort_by: 'desc:created',
logical_operator: 'and',
page: 1,
size: ITEMS_PER_PAGE ? ITEMS_PER_PAGE : DEFAULT_ITEMS_PER_PAGE,
Expand Down
2 changes: 1 addition & 1 deletion src/ui/layouts/settings/Organization/useService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const useService = (): ServiceInterface => {
const [
activeSortingDirection,
setActiveSortingDirection,
] = React.useState<SortingDirection | null>('ASC');
] = React.useState<SortingDirection | null>('DESC');
const dispatch = useDispatch();

const members = useSelector(organizationSelectors.myMembers);
Expand Down
2 changes: 1 addition & 1 deletion src/ui/layouts/stackComponents/RunsTable/useService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const useService = ({
const [
activeSortingDirection,
setActiveSortingDirection,
] = React.useState<SortingDirection | null>('ASC');
] = React.useState<SortingDirection | null>('DESC');
const [sortedRuns, setSortedRuns] = React.useState<TRun[]>([]);

const runs = useSelector(runSelectors.forRunIds(runIds));
Expand Down
2 changes: 1 addition & 1 deletion src/ui/layouts/stackComponents/StackDetail/useService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const useService = (): ServiceInterface => {
);
dispatch(
stackComponentsActions.allRunsByStackComponentId({
sort_by: 'created',
sort_by: 'desc:created',
logical_operator: 'and',
stackComponentId: id,
page: 1,
Expand Down
2 changes: 1 addition & 1 deletion src/ui/layouts/stackComponents/Stacks/List/useService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const useService = (
const [
activeSortingDirection,
setActiveSortingDirection,
] = React.useState<SortingDirection | null>('ASC');
] = React.useState<SortingDirection | null>('DESC');
const dispatch = useDispatch();
const locationPath = useLocationPath();
const [openStackIds, setOpenStackIds] = useState<TId[]>([]);
Expand Down
2 changes: 1 addition & 1 deletion src/ui/layouts/stackComponents/Stacks/useService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const useService = (): ServiceInterface => {
stackComponentsActions.getMy({
project: selectedProject ? selectedProject : locationPath.split('/')[2],
type: locationPath.split('/')[4],
sort_by: 'created',
sort_by: 'desc:created',
logical_operator: 'and',
page: 1,
size: ITEMS_PER_PAGE ? ITEMS_PER_PAGE : DEFAULT_ITEMS_PER_PAGE,
Expand Down
2 changes: 1 addition & 1 deletion src/ui/layouts/stacks/RunsTable/useService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const useService = ({
const [
activeSortingDirection,
setActiveSortingDirection,
] = React.useState<SortingDirection | null>('ASC');
] = React.useState<SortingDirection | null>('DESC');
const [sortedRuns, setSortedRuns] = React.useState<TRun[]>([]);

const runs = useSelector(runSelectors.forRunIds(runIds));
Expand Down
2 changes: 1 addition & 1 deletion src/ui/layouts/stacks/StackDetail/useService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const useService = (): ServiceInterface => {
// Legacy: previously runs was in pipeline
dispatch(
stacksActions.allRunsByStackId({
sort_by: 'created',
sort_by: 'desc:created',
logical_operator: 'and',
page: 1,
size: ITEMS_PER_PAGE ? ITEMS_PER_PAGE : DEFAULT_ITEMS_PER_PAGE,
Expand Down
2 changes: 1 addition & 1 deletion src/ui/layouts/stacks/Stacks/List/useService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const useService = (
const [
activeSortingDirection,
setActiveSortingDirection,
] = React.useState<SortingDirection | null>('ASC');
] = React.useState<SortingDirection | null>('DESC');
const dispatch = useDispatch();

const [openStackIds, setOpenStackIds] = useState<TId[]>([]);
Expand Down
2 changes: 1 addition & 1 deletion src/ui/layouts/stacks/Stacks/useService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const useService = (): ServiceInterface => {
console.log('locationPath111', locationPath);
dispatch(
stacksActions.getMy({
sort_by: 'created',
sort_by: 'desc:created',
logical_operator: 'and',
page: 1,
size: ITEMS_PER_PAGE ? ITEMS_PER_PAGE : DEFAULT_ITEMS_PER_PAGE,
Expand Down