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