Show absolute dates (#3186)
This commit is contained in:
parent
9c88e17f34
commit
67c674126a
14 changed files with 59 additions and 58 deletions
|
@ -42,10 +42,8 @@ export const ChannelCreateView = ({}) => {
|
|||
},
|
||||
});
|
||||
|
||||
const [
|
||||
reorderChannelWarehouses,
|
||||
reorderChannelWarehousesOpts,
|
||||
] = useChannelReorderWarehousesMutation({
|
||||
const [reorderChannelWarehouses, reorderChannelWarehousesOpts] =
|
||||
useChannelReorderWarehousesMutation({
|
||||
onCompleted: data => {
|
||||
const errors = data.channelReorderWarehouses.errors;
|
||||
if (errors.length) {
|
||||
|
|
|
@ -84,10 +84,8 @@ export const ChannelDetails: React.FC<ChannelDetailsProps> = ({
|
|||
},
|
||||
});
|
||||
|
||||
const [
|
||||
deactivateChannel,
|
||||
deactivateChannelOpts,
|
||||
] = useChannelDeactivateMutation({
|
||||
const [deactivateChannel, deactivateChannelOpts] =
|
||||
useChannelDeactivateMutation({
|
||||
onCompleted: data => {
|
||||
const errors = data.channelDeactivate.errors;
|
||||
if (errors.length) {
|
||||
|
@ -96,10 +94,8 @@ export const ChannelDetails: React.FC<ChannelDetailsProps> = ({
|
|||
},
|
||||
});
|
||||
|
||||
const [
|
||||
reorderChannelWarehouses,
|
||||
reorderChannelWarehousesOpts,
|
||||
] = useChannelReorderWarehousesMutation({
|
||||
const [reorderChannelWarehouses, reorderChannelWarehousesOpts] =
|
||||
useChannelReorderWarehousesMutation({
|
||||
onCompleted: data => {
|
||||
const errors = data.channelReorderWarehouses.errors;
|
||||
if (errors.length) {
|
||||
|
|
|
@ -71,6 +71,7 @@ interface TimelineNoteProps {
|
|||
firstName?: string;
|
||||
lastName?: string;
|
||||
};
|
||||
hasPlainDate?: boolean;
|
||||
}
|
||||
|
||||
interface NoteMessageProps {
|
||||
|
@ -90,7 +91,7 @@ const NoteMessage: React.FC<NoteMessageProps> = ({ message }) => (
|
|||
);
|
||||
|
||||
export const TimelineNote: React.FC<TimelineNoteProps> = props => {
|
||||
const { date, user, message } = props;
|
||||
const { date, user, message, hasPlainDate } = props;
|
||||
const { user: currentUser } = useUser();
|
||||
|
||||
const classes = useStyles(props);
|
||||
|
@ -127,7 +128,7 @@ export const TimelineNote: React.FC<TimelineNoteProps> = props => {
|
|||
<div className={classes.title}>
|
||||
<Typography>{getUserTitleOrEmail()}</Typography>
|
||||
<Typography>
|
||||
<DateTime date={date} />
|
||||
<DateTime date={date} plain={hasPlainDate} />
|
||||
</Typography>
|
||||
</div>
|
||||
<Card className={classes.card} elevation={16}>
|
||||
|
|
|
@ -76,10 +76,8 @@ const CustomerListPage: React.FC<CustomerListPageProps> = ({
|
|||
const userPermissions = useUserPermissions();
|
||||
const structure = createFilterStructure(intl, filterOpts, userPermissions);
|
||||
|
||||
const {
|
||||
CUSTOMER_OVERVIEW_CREATE,
|
||||
CUSTOMER_OVERVIEW_MORE_ACTIONS,
|
||||
} = useExtensions(extensionMountPoints.CUSTOMER_LIST);
|
||||
const { CUSTOMER_OVERVIEW_CREATE, CUSTOMER_OVERVIEW_MORE_ACTIONS } =
|
||||
useExtensions(extensionMountPoints.CUSTOMER_LIST);
|
||||
const extensionMenuItems = mapToMenuItemsForCustomerOverviewActions(
|
||||
CUSTOMER_OVERVIEW_MORE_ACTIONS,
|
||||
selectedCustomerIds,
|
||||
|
|
|
@ -49,7 +49,7 @@ const CustomerStats: React.FC<CustomerStatsProps> = props => {
|
|||
{customer.lastLogin === null ? (
|
||||
"-"
|
||||
) : (
|
||||
<DateTime date={customer.lastLogin} />
|
||||
<DateTime date={customer.lastLogin} plain />
|
||||
)}
|
||||
</Typography>
|
||||
) : (
|
||||
|
@ -69,6 +69,7 @@ const CustomerStats: React.FC<CustomerStatsProps> = props => {
|
|||
) : (
|
||||
<DateTime
|
||||
date={customer.lastPlacedOrder.edges[0].node.created}
|
||||
plain
|
||||
/>
|
||||
)}
|
||||
</Typography>
|
||||
|
|
|
@ -214,14 +214,14 @@ const SaleList: React.FC<SaleListProps> = props => {
|
|||
</TableCell>
|
||||
<TableCell className={classes.colStart}>
|
||||
{sale && sale.startDate ? (
|
||||
<Date date={sale.startDate} />
|
||||
<Date date={sale.startDate} plain />
|
||||
) : (
|
||||
<Skeleton />
|
||||
)}
|
||||
</TableCell>
|
||||
<TableCell className={classes.colEnd}>
|
||||
{sale && sale.endDate ? (
|
||||
<Date date={sale.endDate} />
|
||||
<Date date={sale.endDate} plain />
|
||||
) : sale && sale.endDate === null ? (
|
||||
"-"
|
||||
) : (
|
||||
|
|
|
@ -281,14 +281,14 @@ const VoucherList: React.FC<VoucherListProps> = props => {
|
|||
</TableCell>
|
||||
<TableCell className={classes.colStart}>
|
||||
{voucher?.startDate ? (
|
||||
<Date date={voucher.startDate} />
|
||||
<Date date={voucher.startDate} plain />
|
||||
) : (
|
||||
<Skeleton />
|
||||
)}
|
||||
</TableCell>
|
||||
<TableCell className={classes.colEnd}>
|
||||
{voucher?.endDate ? (
|
||||
<Date date={voucher.endDate} />
|
||||
<Date date={voucher.endDate} plain />
|
||||
) : voucher && voucher.endDate === null ? (
|
||||
"-"
|
||||
) : (
|
||||
|
|
|
@ -87,6 +87,7 @@ const GiftCardHistory: React.FC = () => {
|
|||
user={user}
|
||||
message={message}
|
||||
key={id}
|
||||
hasPlainDate
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -122,7 +122,13 @@ const GiftCardTimelineEvent: React.FC<GiftCardTimelineEventProps> = ({
|
|||
event,
|
||||
}) => {
|
||||
const intl = useIntl();
|
||||
return <TimelineEvent date={date} title={getEventMessage(event, intl)} />;
|
||||
return (
|
||||
<TimelineEvent
|
||||
date={date}
|
||||
title={getEventMessage(event, intl)}
|
||||
hasPlainDate
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default GiftCardTimelineEvent;
|
||||
|
|
|
@ -16,11 +16,8 @@ const GiftCardsListHeader: React.FC = () => {
|
|||
const intl = useIntl();
|
||||
const navigate = useNavigator();
|
||||
|
||||
const {
|
||||
openCreateDialog,
|
||||
openBulkCreateDialog,
|
||||
openExportDialog,
|
||||
} = useGiftCardListDialogs();
|
||||
const { openCreateDialog, openBulkCreateDialog, openExportDialog } =
|
||||
useGiftCardListDialogs();
|
||||
|
||||
const openSettings = () => navigate(giftCardSettingsUrl);
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ const HomeActivityCard: React.FC<HomeActivityCardProps> = props => {
|
|||
{getActivityMessage(activity, intl)}
|
||||
</Typography>
|
||||
}
|
||||
secondary={<DateTime date={activity.date} />}
|
||||
secondary={<DateTime date={activity.date} plain />}
|
||||
/>
|
||||
) : (
|
||||
<ListItemText className={classes.loadingProducts}>
|
||||
|
|
|
@ -416,7 +416,7 @@ export const ProductList: React.FC<ProductListProps> = props => {
|
|||
>
|
||||
<TableCell className={classes.colDate} data-test-id="date">
|
||||
{product?.updatedAt ? (
|
||||
<Date date={product.updatedAt} />
|
||||
<Date date={product.updatedAt} plain />
|
||||
) : (
|
||||
<Skeleton />
|
||||
)}
|
||||
|
|
|
@ -27,7 +27,8 @@ export interface TranslationsEntitiesFilters {
|
|||
onMenuItemsTabClick: () => void;
|
||||
}
|
||||
|
||||
export type TranslationsEntitiesListFilterTab = keyof typeof TranslatableEntities;
|
||||
export type TranslationsEntitiesListFilterTab =
|
||||
keyof typeof TranslatableEntities;
|
||||
|
||||
const tabs: TranslationsEntitiesListFilterTab[] = [
|
||||
"categories",
|
||||
|
@ -41,7 +42,9 @@ const tabs: TranslationsEntitiesListFilterTab[] = [
|
|||
"menuItems",
|
||||
];
|
||||
|
||||
const TranslationsEntitiesListPage: React.FC<TranslationsEntitiesListPageProps> = props => {
|
||||
const TranslationsEntitiesListPage: React.FC<
|
||||
TranslationsEntitiesListPageProps
|
||||
> = props => {
|
||||
const { filters, language, children } = props;
|
||||
|
||||
const intl = useIntl();
|
||||
|
|
|
@ -9,9 +9,9 @@ export interface TranslationsLanguageListPageProps {
|
|||
languages: LanguageFragment[];
|
||||
}
|
||||
|
||||
const TranslationsLanguageListPage: React.FC<TranslationsLanguageListPageProps> = ({
|
||||
languages,
|
||||
}) => {
|
||||
const TranslationsLanguageListPage: React.FC<
|
||||
TranslationsLanguageListPageProps
|
||||
> = ({ languages }) => {
|
||||
const intl = useIntl();
|
||||
|
||||
return (
|
||||
|
|
Loading…
Reference in a new issue