Skip to content

Commit

Permalink
Update macaw to 0.3.0 (#1623)
Browse files Browse the repository at this point in the history
* Update macaw to 0.3

* Use proper pagination component

* Fix type errors

* Remove leftover import

* Remove variant and color from confirm button

* Remove alias

* Update macaw

* Fix button type
  • Loading branch information
dominik-zeglen committed Dec 20, 2021
1 parent 2de639b commit c17daa3
Show file tree
Hide file tree
Showing 178 changed files with 1,004 additions and 869 deletions.
7 changes: 6 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ module.exports = api => {
const ignore =
isTest || isStorybook
? []
: ["**/*.test.ts", "**/*.test.tsx", "src/storybook"];
: [
"**/*.test.ts",
"**/*.test.tsx",
"src/storybook",
"node_modules/core-js"
];

const presets = [
[
Expand Down
506 changes: 502 additions & 4 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@material-ui/icons": "^4.11.2",
"@material-ui/lab": "^4.0.0-alpha.58",
"@material-ui/styles": "^4.11.4",
"@saleor/macaw-ui": "^0.2.7",
"@saleor/macaw-ui": "^0.3.0-a.4",
"@saleor/sdk": "^0.4.0",
"@sentry/react": "^6.0.0",
"@types/faker": "^5.1.6",
Expand Down Expand Up @@ -108,6 +108,7 @@
"@types/enzyme": "^3.10.8",
"@types/fuzzaldrin": "^2.1.2",
"@types/jest": "^24.0.24",
"@types/jscodeshift": "^0.11.3",
"@types/lodash-es": "^4.17.3",
"@types/pollyjs__adapter-node-http": "^2.0.1",
"@types/pollyjs__persister-fs": "^2.0.1",
Expand Down Expand Up @@ -157,6 +158,7 @@
"jest": "^24.8.0",
"jest-file": "^1.0.0",
"jest-localstorage-mock": "^2.4.3",
"jscodeshift": "^0.13.0",
"lint-staged": "^10.5.1",
"mock-apollo-client": "^0.4.0",
"prettier": "^1.19.1",
Expand Down
12 changes: 5 additions & 7 deletions src/apps/components/AppDetailsPage/AppDetailsPage.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Button, Card, CardContent, Typography } from "@material-ui/core";
import { Card, CardContent, Typography } from "@material-ui/core";
import CardSpacer from "@saleor/components/CardSpacer";
import CardTitle from "@saleor/components/CardTitle";
import Container from "@saleor/components/Container";
import ExternalLink from "@saleor/components/ExternalLink";
import PageHeader from "@saleor/components/PageHeader";
import Skeleton from "@saleor/components/Skeleton";
import { sectionNames } from "@saleor/intl";
import { Backlink } from "@saleor/macaw-ui";
import { Backlink, Button } from "@saleor/macaw-ui";
import React from "react";
import { FormattedMessage, useIntl } from "react-intl";
import ReactMarkdown from "react-markdown";
Expand Down Expand Up @@ -51,9 +51,9 @@ export const AppDetailsPage: React.FC<AppDetailsPageProps> = ({
}
>
<Button
component="a"
href={data?.homepageUrl}
color="primary"
variant="contained"
variant="primary"
data-tc="open-app"
target="_blank"
>
Expand All @@ -75,7 +75,6 @@ export const AppDetailsPage: React.FC<AppDetailsPageProps> = ({
/>
</ExternalLink>
<Button
color="primary"
className={classes.headerLinkContainer}
onClick={navigateToAppSettings}
>
Expand All @@ -87,8 +86,7 @@ export const AppDetailsPage: React.FC<AppDetailsPageProps> = ({
/>
</Button>
<Button
variant="text"
color="primary"
variant="tertiary"
className={classes.headerLinkContainer}
disableFocusRipple
onClick={data.isActive ? onAppDeactivateOpen : onAppActivateOpen}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Button, Typography } from "@material-ui/core";
import { Typography } from "@material-ui/core";
import CardSpacer from "@saleor/components/CardSpacer";
import Container from "@saleor/components/Container";
import Grid from "@saleor/components/Grid";
import Hr from "@saleor/components/Hr";
import { sectionNames } from "@saleor/intl";
import { Backlink } from "@saleor/macaw-ui";
import { Backlink, Button } from "@saleor/macaw-ui";
import { useTheme } from "@saleor/macaw-ui";
import classNames from "classnames";
import React from "react";
Expand Down Expand Up @@ -69,26 +69,22 @@ export const AppDetailsSettingsPage: React.FC<AppDetailsSettingsPageProps> = ({
</div>
</div>
<div className={classes.appSettingsHeader}>
<Button
onClick={navigateToDashboard}
variant="contained"
color="primary"
>
<Button onClick={navigateToDashboard} variant="primary">
<FormattedMessage defaultMessage="Dashboard" description="button" />
</Button>
<Button
component="a"
href={data?.homepageUrl}
variant="contained"
color="primary"
variant="primary"
data-tc="open-app"
target="_blank"
>
<FormattedMessage defaultMessage="My App" description="button" />
</Button>
<Button
component="a"
href={data?.supportUrl}
variant="contained"
color="primary"
variant="primary"
data-tc="open-support"
target="_blank"
>
Expand Down
10 changes: 3 additions & 7 deletions src/apps/components/AppInstallErrorPage/AppInstallErrorPage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import errorImg from "@assets/images/app-install-error.svg";
import { Button, Grid, Typography } from "@material-ui/core";
import { Grid, Typography } from "@material-ui/core";
import Container from "@saleor/components/Container";
import { Button } from "@saleor/macaw-ui";
import React from "react";
import { FormattedMessage } from "react-intl";

Expand Down Expand Up @@ -34,12 +35,7 @@ export const AppInstallErrorPage: React.FC<AppInstallErrorPageProps> = ({
description="content"
/>
</Typography>
<Button
className={classes.button}
color="primary"
variant="contained"
onClick={onBack}
>
<Button className={classes.button} variant="primary" onClick={onBack}>
<FormattedMessage
defaultMessage="Back to homepage"
description="button"
Expand Down
13 changes: 5 additions & 8 deletions src/apps/components/AppInstallPage/AppInstallPage.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import saleorDarkLogoSmall from "@assets/images/logo-dark-small.svg";
import plusIcon from "@assets/images/plus-icon.svg";
import { Button, Card, CardContent, Grid, Typography } from "@material-ui/core";
import { Card, CardContent, Grid, Typography } from "@material-ui/core";
import CardSpacer from "@saleor/components/CardSpacer";
import CardTitle from "@saleor/components/CardTitle";
import Container from "@saleor/components/Container";
import Hr from "@saleor/components/Hr";
import Skeleton from "@saleor/components/Skeleton";
import { buttonMessages } from "@saleor/intl";
import { Button } from "@saleor/macaw-ui";
import classNames from "classnames";
import React from "react";
import { FormattedMessage, useIntl } from "react-intl";
Expand Down Expand Up @@ -127,18 +128,14 @@ export const AppInstallPage: React.FC<AppInstallPageProps> = ({
<CardSpacer />
<Grid container justify="space-between">
<Grid xs={6} item>
<Button
variant="outlined"
color="primary"
onClick={navigateToAppsList}
>
<Typography color="primary">
<Button variant="secondary" onClick={navigateToAppsList}>
<Typography>
<FormattedMessage {...buttonMessages.cancel} />
</Typography>
</Button>
</Grid>
<Grid xs={6} item className={classes.alignRight}>
<Button variant="contained" color="primary" onClick={onSubmit}>
<Button variant="primary" onClick={onSubmit}>
<Typography className={classes.installText}>
<FormattedMessage
defaultMessage="Install App"
Expand Down
6 changes: 3 additions & 3 deletions src/apps/components/AppsInProgress/AppsInProgress.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import {
Button,
CircularProgress as Progress,
IconButton,
TableBody,
TableCell,
TableRow,
Expand All @@ -11,6 +9,7 @@ import {
import DeleteIcon from "@material-ui/icons/Delete";
import ErrorIcon from "@material-ui/icons/Error";
import CardTitle from "@saleor/components/CardTitle";
import { Button, IconButton } from "@saleor/macaw-ui";
import { renderCollection, stopPropagation } from "@saleor/misc";
import classNames from "classnames";
import React from "react";
Expand Down Expand Up @@ -94,13 +93,14 @@ const AppsInProgress: React.FC<AppsInProgressProps> = ({
<ErrorIcon />
</Tooltip>
</Typography>
<Button color="primary" onClick={() => onAppInstallRetry(id)}>
<Button onClick={() => onAppInstallRetry(id)}>
<FormattedMessage
defaultMessage="Retry"
description="retry installation"
/>
</Button>
<IconButton
variant="secondary"
color="primary"
onClick={stopPropagation(() => onRemove(id))}
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
import {
Button,
Card,
CardContent,
IconButton,
Paper,
Typography
} from "@material-ui/core";
import { Card, CardContent, Paper, Typography } from "@material-ui/core";
import CloseIcon from "@material-ui/icons/Close";
import Link from "@saleor/components/Link";
import useClipboard from "@saleor/hooks/useClipboard";
import { Button, IconButton } from "@saleor/macaw-ui";
import React from "react";
import { FormattedMessage } from "react-intl";

Expand Down Expand Up @@ -48,7 +42,7 @@ const CustomAppDefaultToken: React.FC<CustomAppDefaultTokenProps> = props => {
</Typography>
</div>
<div className={classes.closeContainer}>
<IconButton onClick={onTokenClose}>
<IconButton variant="secondary" onClick={onTokenClose}>
<CloseIcon />
</IconButton>
</div>
Expand All @@ -58,11 +52,7 @@ const CustomAppDefaultToken: React.FC<CustomAppDefaultTokenProps> = props => {
<FormattedMessage defaultMessage="Generated Token" />
</Typography>
<Typography>{token}</Typography>
<Button
className={classes.copy}
color="primary"
onClick={() => copy(token)}
>
<Button className={classes.copy} onClick={() => copy(token)}>
{copied ? (
<FormattedMessage defaultMessage="Copied" description="button" />
) : (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Button } from "@material-ui/core";
import AccountPermissions from "@saleor/components/AccountPermissions";
import CardSpacer from "@saleor/components/CardSpacer";
import { ConfirmButtonTransitionState } from "@saleor/components/ConfirmButton";
Expand All @@ -11,7 +10,7 @@ import { ShopInfo_shop_permissions } from "@saleor/components/Shop/types/ShopInf
import { AppErrorFragment } from "@saleor/fragments/types/AppErrorFragment";
import { SubmitPromise } from "@saleor/hooks/useForm";
import { sectionNames } from "@saleor/intl";
import { Backlink } from "@saleor/macaw-ui";
import { Backlink, Button } from "@saleor/macaw-ui";
import { PermissionEnum } from "@saleor/types/globalTypes";
import { getFormErrors } from "@saleor/utils/errors";
import getAppErrorMessage from "@saleor/utils/errors/app";
Expand Down Expand Up @@ -103,8 +102,7 @@ const CustomAppDetailsPage: React.FC<CustomAppDetailsPageProps> = props => {
</Backlink>
<PageHeader title={app?.name}>
<Button
variant="text"
color="primary"
variant="tertiary"
className={classes.activateButton}
disableFocusRipple
onClick={data.isActive ? onAppDeactivateOpen : onAppActivateOpen}
Expand Down
6 changes: 3 additions & 3 deletions src/apps/components/CustomAppTokens/CustomAppTokens.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import {
Button,
Card,
IconButton,
TableBody,
TableCell,
TableHead,
Expand All @@ -11,6 +9,7 @@ import DeleteIcon from "@material-ui/icons/Delete";
import CardTitle from "@saleor/components/CardTitle";
import ResponsiveTable from "@saleor/components/ResponsiveTable";
import Skeleton from "@saleor/components/Skeleton";
import { Button, IconButton } from "@saleor/macaw-ui";
import { renderCollection } from "@saleor/misc";
import React from "react";
import { FormattedMessage, useIntl } from "react-intl";
Expand Down Expand Up @@ -39,7 +38,7 @@ const CustomAppTokens: React.FC<CustomAppTokensProps> = props => {
description: "header"
})}
toolbar={
<Button color="primary" onClick={onCreate} data-test-id="createToken">
<Button onClick={onCreate} data-test-id="createToken">
<FormattedMessage
defaultMessage="Create Token"
description="button"
Expand Down Expand Up @@ -80,6 +79,7 @@ const CustomAppTokens: React.FC<CustomAppTokensProps> = props => {
</TableCell>
<TableCell className={classes.colActions}>
<IconButton
variant="secondary"
color="primary"
onClick={() => onDelete(token.id)}
>
Expand Down
5 changes: 2 additions & 3 deletions src/apps/components/CustomApps/CustomApps.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import {
Button,
CardHeader,
IconButton,
TableBody,
TableCell,
TableRow,
Typography
} from "@material-ui/core";
import DeleteIcon from "@material-ui/icons/Delete";
import { commonMessages } from "@saleor/intl";
import { Button, IconButton } from "@saleor/macaw-ui";
import { renderCollection, stopPropagation } from "@saleor/misc";
import React from "react";
import { FormattedMessage } from "react-intl";
Expand Down Expand Up @@ -43,7 +42,6 @@ const CustomApps: React.FC<CustomAppsProps> = ({
action={
!!navigateToCustomAppCreate && (
<Button
color="primary"
onClick={navigateToCustomAppCreate}
data-test-id="createApp"
>
Expand Down Expand Up @@ -90,6 +88,7 @@ const CustomApps: React.FC<CustomAppsProps> = ({
</TableCell>
<TableCell className={classes.colAction}>
<IconButton
variant="secondary"
color="primary"
onClick={stopPropagation(() => onRemove(app.node.id))}
>
Expand Down
9 changes: 3 additions & 6 deletions src/apps/components/InstalledApps/InstalledApps.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import {
Button,
IconButton,
TableBody,
TableCell,
TableFooter,
Expand All @@ -10,6 +8,7 @@ import {
import DeleteIcon from "@material-ui/icons/Delete";
import CardTitle from "@saleor/components/CardTitle";
import TablePagination from "@saleor/components/TablePagination";
import { Button, IconButton } from "@saleor/macaw-ui";
import { renderCollection, stopPropagation } from "@saleor/misc";
import { ListProps } from "@saleor/types";
import React from "react";
Expand Down Expand Up @@ -92,16 +91,14 @@ const InstalledApps: React.FC<InstalledAppsProps> = ({
)}
</TableCell>
<TableCell className={classes.colAction}>
<Button
color="primary"
onClick={stopPropagation(onRowClick(app.node.id))}
>
<Button onClick={stopPropagation(onRowClick(app.node.id))}>
<FormattedMessage
defaultMessage="About"
description="about app"
/>
</Button>
<IconButton
variant="secondary"
color="primary"
onClick={stopPropagation(() => onRemove(app.node.id))}
>
Expand Down
5 changes: 3 additions & 2 deletions src/apps/components/Marketplace/Marketplace.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Button, Card, CardContent, Typography } from "@material-ui/core";
import { Card, CardContent, Typography } from "@material-ui/core";
import CardTitle from "@saleor/components/CardTitle";
import { Button } from "@saleor/macaw-ui";
import React from "react";
import { FormattedMessage, useIntl } from "react-intl";

Expand Down Expand Up @@ -31,7 +32,7 @@ const Marketplace: React.FC<MarketplaceProps> = ({ link }) => {
description="marketplace content"
/>
</Typography>
<Button color="primary" onClick={link}>
<Button onClick={link}>
<FormattedMessage
defaultMessage="Visit Marketplace"
description="marketplace button"
Expand Down
Loading

0 comments on commit c17daa3

Please sign in to comment.