-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Platform]: Moving aotf playground to another component (#363)
- Loading branch information
Showing
5 changed files
with
44 additions
and
63 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
apps/platform/src/components/AssociationsToolkit/AotfApiPlayground.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { ApiPlaygroundDrawer } from "ui"; | ||
import useAotfContext from "./hooks/useAotfContext"; | ||
|
||
function AotfApiPlayground() { | ||
const { | ||
id, | ||
pagination, | ||
searhFilter, | ||
sorting, | ||
enableIndirect, | ||
dataSourcesWeights, | ||
entity, | ||
dataSourcesRequired, | ||
query, | ||
} = useAotfContext(); | ||
|
||
const aggregationFilters = dataSourcesRequired.map(({ id, ...obj }) => ({ ...obj })); | ||
|
||
const variables = { | ||
id, | ||
index: pagination.pageIndex, | ||
size: pagination.pageSize, | ||
filter: searhFilter, | ||
sortBy: sorting[0].id, | ||
enableIndirect, | ||
datasources: dataSourcesWeights, | ||
entity, | ||
aggregationFilters, | ||
}; | ||
|
||
return <ApiPlaygroundDrawer query={query.loc.source.body} variables={variables} />; | ||
} | ||
export default AotfApiPlayground; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters