mirror of
https://github.com/strapi/strapi.git
synced 2025-09-09 00:26:28 +00:00
Remove old files
Signed-off-by: soupette <cyril@strapi.io>
This commit is contained in:
parent
ff8069a1c8
commit
cedd532e54
@ -1,100 +0,0 @@
|
||||
import React, { useMemo } from 'react';
|
||||
import { Padded, Text, Flex } from '@buffetjs/core';
|
||||
import { get, isEmpty } from 'lodash';
|
||||
import moment from 'moment';
|
||||
import styled from 'styled-components';
|
||||
import { useIntl } from 'react-intl';
|
||||
import { useCMEditViewDataManager } from '@strapi/helper-plugin';
|
||||
import { InjectionZone } from '../../../shared/components';
|
||||
import { SubWrapper, StatusWrapper } from './components';
|
||||
import { getTrad } from '../../utils';
|
||||
|
||||
const BaselineAlignment = styled.div`
|
||||
padding-top: ${({ size }) => size};
|
||||
`;
|
||||
|
||||
const InformationCard = () => {
|
||||
const { initialData, hasDraftAndPublish, layout } = useCMEditViewDataManager();
|
||||
const { formatMessage } = useIntl();
|
||||
|
||||
const updatedAtName = useMemo(
|
||||
() => get(layout, ['options', 'timestamps'], ['created_at', 'updated_at'])[1],
|
||||
[layout]
|
||||
);
|
||||
|
||||
const updatedBy = useMemo(() => {
|
||||
const firstname = get(initialData, ['updated_by', 'firstname'], '');
|
||||
const lastname = get(initialData, ['updated_by', 'lastname'], '');
|
||||
|
||||
return `${firstname} ${lastname}`;
|
||||
}, [initialData]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<SubWrapper>
|
||||
<BaselineAlignment size="3px" />
|
||||
<Padded top left right bottom size="smd">
|
||||
<Text fontWeight="bold">
|
||||
{formatMessage({
|
||||
id: getTrad('containers.Edit.information'),
|
||||
})}
|
||||
</Text>
|
||||
<Padded top size="smd">
|
||||
<BaselineAlignment size="2px" />
|
||||
<Flex justifyContent="space-between">
|
||||
<Text fontSize="xs" color="grey" textTransform="uppercase" fontWeight="semiBold">
|
||||
{formatMessage({
|
||||
id: getTrad('containers.Edit.information.lastUpdate'),
|
||||
})}
|
||||
</Text>
|
||||
<Text lineHeight="12px">
|
||||
{isEmpty(initialData) ? '-' : moment(initialData[updatedAtName]).fromNow()}
|
||||
</Text>
|
||||
</Flex>
|
||||
</Padded>
|
||||
<Padded top size="smd">
|
||||
<BaselineAlignment size="3px" />
|
||||
<Flex justifyContent="space-between">
|
||||
<Text fontSize="xs" color="grey" textTransform="uppercase" fontWeight="semiBold">
|
||||
{formatMessage({
|
||||
id: getTrad('containers.Edit.information.by'),
|
||||
})}
|
||||
</Text>
|
||||
<Text lineHeight="12px">{isEmpty(initialData) ? '-' : updatedBy}</Text>
|
||||
</Flex>
|
||||
</Padded>
|
||||
</Padded>
|
||||
<InjectionZone area="contentManager.editView.informations" />
|
||||
</SubWrapper>
|
||||
<Padded top size="sm" />
|
||||
{hasDraftAndPublish && (
|
||||
<StatusWrapper isGreen={initialData.published_at}>
|
||||
<Text fontSize="sm" lineHeight="18px">
|
||||
•
|
||||
</Text>
|
||||
<Padded left size="xs" />
|
||||
<Flex>
|
||||
<Text lineHeight="18px">
|
||||
{formatMessage({
|
||||
id: getTrad('containers.Edit.information.editing'),
|
||||
})}
|
||||
</Text>
|
||||
|
||||
<Text lineHeight="18px" fontWeight="bold">
|
||||
{formatMessage({
|
||||
id: getTrad(
|
||||
initialData.published_at
|
||||
? 'containers.Edit.information.publishedVersion'
|
||||
: 'containers.Edit.information.draftVersion'
|
||||
),
|
||||
})}
|
||||
</Text>
|
||||
</Flex>
|
||||
</StatusWrapper>
|
||||
)}
|
||||
<BaselineAlignment size="2px" />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default InformationCard;
|
@ -15,7 +15,6 @@ import { Box } from '@strapi/parts/Box';
|
||||
import { Grid, GridItem } from '@strapi/parts/Grid';
|
||||
import { Main } from '@strapi/parts/Main';
|
||||
import { Stack } from '@strapi/parts/Stack';
|
||||
|
||||
// import { Padded } from '@buffetjs/core';
|
||||
import { InjectionZone } from '../../../shared/components';
|
||||
// import permissions from '../../../permissions';
|
||||
|
@ -1,8 +1,8 @@
|
||||
import React from 'react';
|
||||
import { useIntl } from 'react-intl';
|
||||
import { Text } from '@strapi/parts/Text';
|
||||
import { getTrad } from '../../utils';
|
||||
import useHasI18n from '../../hooks/useHasI18n';
|
||||
import { getTrad } from '../../../utils';
|
||||
import useHasI18n from '../../../hooks/useHasI18n';
|
||||
|
||||
const DeleteModalAdditionalInfos = () => {
|
||||
const hasI18nEnabled = useHasI18n();
|
@ -14,7 +14,7 @@ import { getTrad } from './utils';
|
||||
import mutateCTBContentTypeSchema from './utils/mutateCTBContentTypeSchema';
|
||||
import LOCALIZED_FIELDS from './utils/localizedFields';
|
||||
import i18nReducers from './hooks/reducers';
|
||||
import DeleteModalAdditionalInfos from './components/DeleteModalAdditionalInfos';
|
||||
import DeleteModalAdditionalInfos from './components/CMListViewInjectedComponents/DeleteModalAdditionalInfos';
|
||||
import addLocaleToCollectionTypesLinksHook from './contentManagerHooks/addLocaleToCollectionTypesLinks';
|
||||
import addLocaleToSingleTypesLinksHook from './contentManagerHooks/addLocaleToSingleTypesLinks';
|
||||
import addColumnToTableHook from './contentManagerHooks/addColumnToTable';
|
||||
|
Loading…
x
Reference in New Issue
Block a user