Reformat all project files to use the prettier config file.
This commit is contained in:
@@ -1,78 +1,74 @@
|
||||
import {useQuery} from "@apollo/client";
|
||||
import {Button, Table} from "antd";
|
||||
import { useQuery } from "@apollo/client";
|
||||
import { Button, Table } from "antd";
|
||||
import React from "react";
|
||||
import {useTranslation} from "react-i18next";
|
||||
import {connect} from "react-redux";
|
||||
import {createStructuredSelector} from "reselect";
|
||||
import {QUERY_SHOP_ASSOCIATIONS} from "../../graphql/user.queries";
|
||||
import {selectBodyshop} from "../../redux/user/user.selectors";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { QUERY_SHOP_ASSOCIATIONS } from "../../graphql/user.queries";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import AlertComponent from "../alert/alert.component";
|
||||
import RbacWrapper from "../rbac-wrapper/rbac-wrapper.component";
|
||||
import ShopUsersAuthEdit from "../shop-users-auth-edit/shop-users-auth-edit.component";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
//currentUser: selectCurrentUser
|
||||
bodyshop: selectBodyshop,
|
||||
//currentUser: selectCurrentUser
|
||||
bodyshop: selectBodyshop
|
||||
});
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||
});
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(ShopInfoUsersComponent);
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(ShopInfoUsersComponent);
|
||||
|
||||
export function ShopInfoUsersComponent({bodyshop}) {
|
||||
const {t} = useTranslation();
|
||||
const {loading, error, data} = useQuery(QUERY_SHOP_ASSOCIATIONS, {
|
||||
variables: {shopid: bodyshop.id},
|
||||
fetchPolicy: "network-only",
|
||||
nextFetchPolicy: "network-only",
|
||||
});
|
||||
const columns = [
|
||||
{
|
||||
title: t("user.fields.email"),
|
||||
dataIndex: "email",
|
||||
key: "email",
|
||||
render: (text, record) => record.user.email,
|
||||
},
|
||||
{
|
||||
title: t("user.fields.authlevel"),
|
||||
dataIndex: "authlevel",
|
||||
key: "authlevel",
|
||||
render: (text, record) => (
|
||||
<RbacWrapper action="users:editaccess">
|
||||
<ShopUsersAuthEdit association={record}/>
|
||||
</RbacWrapper>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: t("user.labels.actions"),
|
||||
dataIndex: "actions",
|
||||
key: "actions",
|
||||
render: (text, record) => (
|
||||
<div>
|
||||
<Button disabled onClick={() => {
|
||||
}}>
|
||||
{t("general.actions.delete")}
|
||||
</Button>
|
||||
</div>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
if (error) {
|
||||
return <AlertComponent type="error" message={JSON.stringify(error)}/>;
|
||||
}
|
||||
return (
|
||||
export function ShopInfoUsersComponent({ bodyshop }) {
|
||||
const { t } = useTranslation();
|
||||
const { loading, error, data } = useQuery(QUERY_SHOP_ASSOCIATIONS, {
|
||||
variables: { shopid: bodyshop.id },
|
||||
fetchPolicy: "network-only",
|
||||
nextFetchPolicy: "network-only"
|
||||
});
|
||||
const columns = [
|
||||
{
|
||||
title: t("user.fields.email"),
|
||||
dataIndex: "email",
|
||||
key: "email",
|
||||
render: (text, record) => record.user.email
|
||||
},
|
||||
{
|
||||
title: t("user.fields.authlevel"),
|
||||
dataIndex: "authlevel",
|
||||
key: "authlevel",
|
||||
render: (text, record) => (
|
||||
<RbacWrapper action="users:editaccess">
|
||||
<ShopUsersAuthEdit association={record} />
|
||||
</RbacWrapper>
|
||||
)
|
||||
},
|
||||
{
|
||||
title: t("user.labels.actions"),
|
||||
dataIndex: "actions",
|
||||
key: "actions",
|
||||
render: (text, record) => (
|
||||
<div>
|
||||
<Table
|
||||
loading={loading}
|
||||
pagination={{position: "top"}}
|
||||
columns={columns}
|
||||
rowKey="id"
|
||||
dataSource={data && data.associations}
|
||||
/>
|
||||
<Button disabled onClick={() => {}}>
|
||||
{t("general.actions.delete")}
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
)
|
||||
}
|
||||
];
|
||||
|
||||
if (error) {
|
||||
return <AlertComponent type="error" message={JSON.stringify(error)} />;
|
||||
}
|
||||
return (
|
||||
<div>
|
||||
<Table
|
||||
loading={loading}
|
||||
pagination={{ position: "top" }}
|
||||
columns={columns}
|
||||
rowKey="id"
|
||||
dataSource={data && data.associations}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user