Closes https://github.com/twentyhq/core-team-issues/issues/1628 From a technical perspective, we can add more ordering options, such as the ability to combine two sorts on the X axis, e.g. sort by Close date ASC and then by Sum ASC, which will sort groups that have the same close date between themselves depending on their sum ASC. @Bonapara could you provide design if you want this to be implemented (quite short on our hand i think - maybe in V2 though)? https://github.com/user-attachments/assets/6ef21fe1-9d8f-43c0-bfa2-f6fc6341cacf --------- Co-authored-by: ehconitin <nitinkoche03@gmail.com>
40 lines
1.3 KiB
TypeScript
40 lines
1.3 KiB
TypeScript
import { findOneOperationFactory } from 'test/integration/graphql/utils/find-one-operation-factory.util';
|
|
import { makeGraphqlAPIRequest } from 'test/integration/graphql/utils/make-graphql-api-request.util';
|
|
import { type CommonResponseBody } from 'test/integration/metadata/types/common-response-body.type';
|
|
import { warnIfNoErrorButExpectedToFail } from 'test/integration/metadata/utils/warn-if-no-error-but-expected-to-fail.util';
|
|
import { type ObjectRecord } from 'twenty-shared/types';
|
|
|
|
type FindOneOperationArgs = Parameters<typeof findOneOperationFactory>[0] & {
|
|
expectToFail?: boolean;
|
|
};
|
|
export const findOneOperation = async ({
|
|
gqlFields = 'id',
|
|
objectMetadataSingularName,
|
|
expectToFail = false,
|
|
filter,
|
|
}: FindOneOperationArgs): CommonResponseBody<{
|
|
findResponse: ObjectRecord;
|
|
}> => {
|
|
const graphqlOperation = findOneOperationFactory({
|
|
objectMetadataSingularName,
|
|
gqlFields,
|
|
filter,
|
|
});
|
|
|
|
const response = await makeGraphqlAPIRequest(graphqlOperation);
|
|
|
|
if (expectToFail) {
|
|
warnIfNoErrorButExpectedToFail({
|
|
response,
|
|
errorMessage: 'Find one operation should have failed but did not',
|
|
});
|
|
}
|
|
|
|
return {
|
|
data: {
|
|
findResponse: response.body.data[objectMetadataSingularName],
|
|
},
|
|
errors: response.body.errors,
|
|
};
|
|
};
|