forked from adrien2p/medusa-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Few fixes on sentry table management and data display (adrien2p#15)
* fix: Few fixes on sentry table management and data display * chore: remove format script since it is now applied by eslint * fix: sentry plugin on fetch stats should not pass an empty transaction duration * docs: Add gif demo to readme * docs: Add gif demo to readme
- Loading branch information
Showing
38 changed files
with
1,693 additions
and
1,898 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,31 @@ | ||
import resolve from "@rollup/plugin-node-resolve"; | ||
import commonjs from "@rollup/plugin-commonjs"; | ||
import typescript from "@rollup/plugin-typescript"; | ||
import dts from "rollup-plugin-dts"; | ||
import { terser } from "rollup-plugin-terser"; | ||
import peerDepsExternal from "rollup-plugin-peer-deps-external"; | ||
import resolve from '@rollup/plugin-node-resolve'; | ||
import commonjs from '@rollup/plugin-commonjs'; | ||
import typescript from '@rollup/plugin-typescript'; | ||
import dts from 'rollup-plugin-dts'; | ||
import { terser } from 'rollup-plugin-terser'; | ||
import peerDepsExternal from 'rollup-plugin-peer-deps-external'; | ||
|
||
export default [ | ||
{ | ||
input: "src/index.ts", | ||
output: [ | ||
{ | ||
file: "dist/cjs/index.js", | ||
format: "cjs", | ||
sourcemap: true | ||
}, | ||
{ | ||
file: "dist/esm/index.js", | ||
format: "esm", | ||
sourcemap: true | ||
} | ||
], | ||
plugins: [ | ||
peerDepsExternal(), | ||
resolve(), | ||
commonjs(), | ||
typescript({ tsconfig: "./tsconfig.json" }), | ||
terser() | ||
], | ||
external: ["react", "react-dom", "styled-components", "lodash"] | ||
}, | ||
{ | ||
input: "./dist/esm/index.d.ts", | ||
output: [{ file: "dist/types/types.d.ts", format: "es" }], | ||
plugins: [dts()], | ||
}, | ||
]; | ||
{ | ||
input: 'src/index.ts', | ||
output: [ | ||
{ | ||
file: 'dist/cjs/index.js', | ||
format: 'cjs', | ||
sourcemap: true, | ||
}, | ||
{ | ||
file: 'dist/esm/index.js', | ||
format: 'esm', | ||
sourcemap: true, | ||
}, | ||
], | ||
plugins: [peerDepsExternal(), resolve(), commonjs(), typescript({ tsconfig: './tsconfig.json' }), terser()], | ||
external: ['react', 'react-dom', 'styled-components', 'lodash'], | ||
}, | ||
{ | ||
input: './dist/esm/index.d.ts', | ||
output: [{ file: 'dist/types/types.d.ts', format: 'es' }], | ||
plugins: [dts()], | ||
}, | ||
]; |
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
68 changes: 26 additions & 42 deletions
68
packages/medusa-plugin-sentry-ui/src/components/table-pagination.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 |
---|---|---|
@@ -1,43 +1,27 @@ | ||
import clsx from "clsx" | ||
import ArrowLeftIcon from "./temp/fundamentals/icons/arrow-left-icon" | ||
import ArrowRightIcon from "./temp/fundamentals/icons/arrow-right-icon" | ||
import React from "react" | ||
import clsx from 'clsx'; | ||
import ArrowLeftIcon from './temp/fundamentals/icons/arrow-left-icon'; | ||
import ArrowRightIcon from './temp/fundamentals/icons/arrow-right-icon'; | ||
import React from 'react'; | ||
|
||
export const TablePagination = ({ | ||
nextPage, | ||
prevPage, | ||
hasNext, | ||
hasPrev, | ||
}) => { | ||
|
||
return ( | ||
<div | ||
className={clsx( | ||
"flex w-full justify-between inter-small-regular text-grey-50 mt-14", | ||
)} | ||
> | ||
<div className="w-full flex space-x-4"> | ||
<div className="w-full flex space-x-4 items-center justify-end"> | ||
<div | ||
className={clsx( | ||
{ ["text-grey-30"]: !hasPrev }, | ||
{ ["cursor-pointer"]: hasPrev } | ||
)} | ||
onClick={() => prevPage()} | ||
> | ||
<ArrowLeftIcon /> | ||
</div> | ||
<div | ||
className={clsx( | ||
{ ["text-grey-30"]: !hasNext }, | ||
{ ["cursor-pointer"]: hasNext } | ||
)} | ||
onClick={() => nextPage()} | ||
> | ||
<ArrowRightIcon /> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} | ||
export const TablePagination = ({ nextPage, prevPage, hasNext, hasPrev }) => { | ||
return ( | ||
<div className={clsx('flex w-full justify-between inter-small-regular text-grey-50 mt-14')}> | ||
<div className="w-full flex space-x-4"> | ||
<div className="w-full flex space-x-4 items-center justify-end"> | ||
<div | ||
className={clsx({ ['text-grey-30']: !hasPrev }, { ['cursor-pointer']: hasPrev })} | ||
onClick={() => prevPage()} | ||
> | ||
<ArrowLeftIcon /> | ||
</div> | ||
<div | ||
className={clsx({ ['text-grey-30']: !hasNext }, { ['cursor-pointer']: hasNext })} | ||
onClick={() => nextPage()} | ||
> | ||
<ArrowRightIcon /> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; |
34 changes: 15 additions & 19 deletions
34
packages/medusa-plugin-sentry-ui/src/components/table-row.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 |
---|---|---|
@@ -1,21 +1,17 @@ | ||
import Table from "./temp/molecules/table" | ||
import React from "react" | ||
import Table from './temp/molecules/table'; | ||
import React from 'react'; | ||
|
||
export const SentryTableRow = ({ row, ...rest }) => { | ||
return ( | ||
<Table.Row | ||
color={"inherit"} | ||
linkTo={rest.linkTo ?? undefined} | ||
actions={rest?.getActions ? rest.getActions() : []} | ||
{...rest} | ||
> | ||
{row.cells.map((cell, index) => { | ||
return ( | ||
<Table.Cell {...cell.getCellProps({ width: 500 })}> | ||
{cell.render("Cell", { index })} | ||
</Table.Cell> | ||
) | ||
})} | ||
</Table.Row> | ||
) | ||
} | ||
return ( | ||
<Table.Row | ||
color={'inherit'} | ||
linkTo={rest.linkTo ?? undefined} | ||
actions={rest?.getActions ? rest.getActions() : []} | ||
{...rest} | ||
> | ||
{row.cells.map((cell, index) => { | ||
return <Table.Cell {...cell.getCellProps({ width: 500 })}>{cell.render('Cell', { index })}</Table.Cell>; | ||
})} | ||
</Table.Row> | ||
); | ||
}; |
Oops, something went wrong.