remove mention of Row in favour of Flew

This commit is contained in:
Dieter Stinglhamber 2021-10-25 09:48:00 +02:00
parent b3c6c298f2
commit 53156190af
4 changed files with 16 additions and 17 deletions

View File

@ -70,12 +70,12 @@
"prettier:code": "prettier \"**/*.js\"", "prettier:code": "prettier \"**/*.js\"",
"prettier:other": "prettier \"**/*.{md,css,scss,yaml,yml}\"", "prettier:other": "prettier \"**/*.{md,css,scss,yaml,yml}\"",
"test:clean": "rimraf ./coverage", "test:clean": "rimraf ./coverage",
"test:front": "npm run test:clean && cross-env TZ=UTC NODE_ENV=test IS_EE=true jest --config ./jest.config.front.js", "test:front": "npm run test:clean && cross-env NODE_ENV=test IS_EE=true jest --config ./jest.config.front.js",
"test:front:watch": "cross-env TZ=UTC NODE_ENV=test IS_EE=true jest --config ./jest.config.front.js --watchAll", "test:front:watch": "cross-env NODE_ENV=test IS_EE=true jest --config ./jest.config.front.js --watchAll",
"test:front:update": "cross-env TZ=UTC NODE_ENV=test IS_EE=true jest --config ./jest.config.front.js --u", "test:front:update": "cross-env NODE_ENV=test IS_EE=true jest --config ./jest.config.front.js --u",
"test:front:ce": "npm run test:clean && cross-env TZ=UTC NODE_ENV=test IS_EE=false jest --config ./jest.config.front.js --coverage", "test:front:ce": "npm run test:clean && cross-env NODE_ENV=test IS_EE=false jest --config ./jest.config.front.js --coverage",
"test:front:watch:ce": "cross-env TZ=UTC NODE_ENV=test IS_EE=false jest --config ./jest.config.front.js --watchAll", "test:front:watch:ce": "cross-env NODE_ENV=test IS_EE=false jest --config ./jest.config.front.js --watchAll",
"test:front:update:ce": "cross-env TZ=UTC NODE_ENV=test IS_EE=false jest --config ./jest.config.front.js --u", "test:front:update:ce": "cross-env NODE_ENV=test IS_EE=false jest --config ./jest.config.front.js --u",
"test:snyk": "snyk test", "test:snyk": "snyk test",
"test:unit": "jest --verbose", "test:unit": "jest --verbose",
"test:e2e": "FORCE_COLOR=true jest --config jest.config.e2e.js --verbose --runInBand --testRunner=jest-circus/runner --forceExit --detectOpenHandles", "test:e2e": "FORCE_COLOR=true jest --config jest.config.e2e.js --verbose --runInBand --testRunner=jest-circus/runner --forceExit --detectOpenHandles",

View File

@ -1,7 +1,7 @@
import React from 'react'; import React from 'react';
import { Text } from '@strapi/parts/Text'; import { Text } from '@strapi/parts/Text';
import { Tbody, Tr, Td } from '@strapi/parts/Table'; import { Tbody, Tr, Td } from '@strapi/parts/Table';
import { Row } from '@strapi/parts/Row'; import { Flex } from '@strapi/parts/Flex';
import { RelativeTime, useQueryParams } from '@strapi/helper-plugin'; import { RelativeTime, useQueryParams } from '@strapi/helper-plugin';
import { useIntl } from 'react-intl'; import { useIntl } from 'react-intl';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
@ -50,7 +50,7 @@ const TableRows = ({ canDelete, canUpdate, onClickDelete, withBulkActions, rows
{withBulkActions && ( {withBulkActions && (
<Td> <Td>
<Row justifyContent="end"> <Flex justifyContent="end">
{canUpdate && <UpdateButton tokenName={apiToken.name} tokenId={apiToken.id} />} {canUpdate && <UpdateButton tokenName={apiToken.name} tokenId={apiToken.id} />}
{canDelete && ( {canDelete && (
<DeleteButton <DeleteButton
@ -58,7 +58,7 @@ const TableRows = ({ canDelete, canUpdate, onClickDelete, withBulkActions, rows
onClickDelete={() => onClickDelete(apiToken.id)} onClickDelete={() => onClickDelete(apiToken.id)}
/> />
)} )}
</Row> </Flex>
</Td> </Td>
)} )}
</Tr> </Tr>

View File

@ -304,14 +304,13 @@ describe('ADMIN | Pages | API TOKENS | ListPage', () => {
display: -webkit-flex; display: -webkit-flex;
display: -ms-flexbox; display: -ms-flexbox;
display: flex; display: flex;
-webkit-flex-direction: column; -webkit-flex-direction: row;
-ms-flex-direction: column; -ms-flex-direction: row;
flex-direction: column; flex-direction: row;
-webkit-align-items: center; -webkit-align-items: center;
-webkit-box-align: center; -webkit-box-align: center;
-ms-flex-align: center; -ms-flex-align: center;
align-items: center; align-items: center;
text-align: center;
} }
.c4 { .c4 {

View File

@ -7,14 +7,14 @@ import RelativeTime from '../index';
const App = ( const App = (
<ThemeProvider theme={lightTheme}> <ThemeProvider theme={lightTheme}>
<IntlProvider locale="en" messages={{}} textComponent="span"> <IntlProvider locale="en" messages={{}} textComponent="span">
<RelativeTime timestamp={new Date('2015-10-01T07:55:00.000Z')} /> <RelativeTime timestamp={new Date('2015-10-01 07:55:00')} />
</IntlProvider> </IntlProvider>
</ThemeProvider> </ThemeProvider>
); );
describe('RelativeTime', () => { describe('RelativeTime', () => {
beforeEach(() => { beforeEach(() => {
jest.spyOn(Date, 'now').mockImplementation(() => new Date('2015-10-01T08:00:00.000Z')); jest.spyOn(Date, 'now').mockImplementation(() => new Date('2015-10-01 08:00:00'));
}); });
afterAll(() => { afterAll(() => {
@ -37,7 +37,7 @@ describe('RelativeTime', () => {
}); });
it('can display the relative time for a future date', () => { it('can display the relative time for a future date', () => {
jest.spyOn(Date, 'now').mockImplementation(() => new Date('2015-10-01T07:50:00.000Z')); jest.spyOn(Date, 'now').mockImplementation(() => new Date('2015-10-01 07:50:00'));
render(App); render(App);
@ -45,7 +45,7 @@ describe('RelativeTime', () => {
}); });
it('can display the relative time for a past date', () => { it('can display the relative time for a past date', () => {
jest.spyOn(Date, 'now').mockImplementation(() => new Date('2015-10-01T08:00:00.000Z')); jest.spyOn(Date, 'now').mockImplementation(() => new Date('2015-10-01 08:00:00'));
render(App); render(App);