Skip to content

Commit

Permalink
Merge branch 'main' into chore/upgrade-axios
Browse files Browse the repository at this point in the history
  • Loading branch information
gu-stav committed Dec 22, 2022
2 parents 8563719 + 237f9bf commit 59438be
Show file tree
Hide file tree
Showing 14 changed files with 42 additions and 32 deletions.
Expand Up @@ -74,7 +74,7 @@ const Header = ({
{formatMessage({ id: 'app.utils.publish', defaultMessage: 'Publish' })}
</Button>
)}
<Button disabled={!didChangeData} isLoading={status === 'submit-pending'} type="submit">
<Button disabled={!didChangeData} loading={status === 'submit-pending'} type="submit">
{formatMessage({
id: getTrad('containers.Edit.submit'),
defaultMessage: 'Save',
Expand Down
2 changes: 1 addition & 1 deletion packages/core/admin/package.json
Expand Up @@ -62,7 +62,7 @@
"codemirror": "^5.65.8",
"cross-env": "^7.0.3",
"css-loader": "6.7.2",
"date-fns": "2.29.2",
"date-fns": "2.29.3",
"dotenv": "8.5.1",
"esbuild-loader": "^2.20.0",
"execa": "^1.0.0",
Expand Down
Expand Up @@ -117,6 +117,10 @@ module.exports = function createComponentBuilder() {
const attribute = infos.attributes[key];

if (isRelation(attribute)) {
if (['manyToMany', 'oneToOne'].includes(attribute.relation)) {
attribute.dominant = true;
}

this.setRelation({
key,
uid,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/database/package.json
Expand Up @@ -31,7 +31,7 @@
"test:unit": "jest --verbose"
},
"dependencies": {
"date-fns": "2.29.2",
"date-fns": "2.29.3",
"debug": "4.3.4",
"fs-extra": "10.0.0",
"knex": "1.0.7",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/helper-plugin/package.json
Expand Up @@ -40,7 +40,7 @@
},
"dependencies": {
"axios": "1.2.1",
"date-fns": "2.29.2",
"date-fns": "2.29.3",
"formik": "^2.2.6",
"immer": "9.0.6",
"invariant": "^2.2.1",
Expand Down
5 changes: 5 additions & 0 deletions packages/core/strapi/lib/types/core/strapi/index.d.ts
Expand Up @@ -372,6 +372,11 @@ export interface Strapi {
*/
telemetry: any;

/**
* Used to access ctx from anywhere within the Strapi application
*/
requestContext: any;

/**
* Strapi DB layer instance
*/
Expand Down
Expand Up @@ -250,11 +250,11 @@ describe('BrowseStep', () => {
it('should render the table headers', () => {
usePersistentState.mockReturnValueOnce([viewOptions.LIST]);

const { getByText } = setup();
expect(getByText('preview')).toBeInTheDocument();
const { getByText, getByRole } = setup();
expect(getByRole('gridcell', { name: 'preview' })).toBeInTheDocument();
expect(getByText('name')).toBeInTheDocument();
expect(getByText('extension')).toBeInTheDocument();
expect(getByText('size')).toBeInTheDocument();
expect(getByRole('gridcell', { name: 'extension' })).toBeInTheDocument();
expect(getByRole('gridcell', { name: 'size' })).toBeInTheDocument();
expect(getByText('created')).toBeInTheDocument();
expect(getByText('last update')).toBeInTheDocument();
});
Expand Down
16 changes: 8 additions & 8 deletions packages/core/upload/admin/src/components/TableList/index.js
Expand Up @@ -80,8 +80,8 @@ export const TableList = ({
}
key={key}
>
{isSortable ? (
<Tooltip label={sortLabel}>
<Tooltip label={isSortable ? sortLabel : tableHeaderLabel}>
{isSortable ? (
<Typography
onClick={() => handleClickSort(isSorted, name)}
as={isSorted ? 'span' : 'button'}
Expand All @@ -91,12 +91,12 @@ export const TableList = ({
>
{tableHeaderLabel}
</Typography>
</Tooltip>
) : (
<Typography textColor="neutral600" variant="sigma">
{tableHeaderLabel}
</Typography>
)}
) : (
<Typography textColor="neutral600" variant="sigma">
{tableHeaderLabel}
</Typography>
)}
</Tooltip>
</Th>
);
})}
Expand Down
Expand Up @@ -61,13 +61,13 @@ const ComponentFixture = (props) => {
const setup = (props) => render(<ComponentFixture {...props} />);

describe('TableList', () => {
it('should render table headers labels', () => {
const { getByText } = setup();
it.only('should render table headers labels', () => {
const { getByText, getByRole } = setup();

expect(getByText('preview')).toBeInTheDocument();
expect(getByRole('gridcell', { name: 'preview' })).toBeInTheDocument();
expect(getByText('name')).toBeInTheDocument();
expect(getByText('extension')).toBeInTheDocument();
expect(getByText('size')).toBeInTheDocument();
expect(getByRole('gridcell', { name: 'extension' })).toBeInTheDocument();
expect(getByRole('gridcell', { name: 'size' })).toBeInTheDocument();
expect(getByText('created')).toBeInTheDocument();
expect(getByText('last update')).toBeInTheDocument();
});
Expand Down
Expand Up @@ -136,6 +136,7 @@ export const MediaLibrary = () => {
assetsData?.results?.map((asset) => ({ ...asset, type: 'asset', isSelectable: canUpdate })) ||
[];
const assetCount = assets?.length ?? 0;
const totalAssetCount = assetsData?.pagination?.total;

const isLoading = isCurrentFolderLoading || foldersLoading || permissionsLoading || assetsLoading;
const [showUploadAssetDialog, setShowUploadAssetDialog] = useState(false);
Expand Down Expand Up @@ -458,7 +459,7 @@ export const MediaLibrary = () => {
id: getTrad('list.assets.title'),
defaultMessage: 'Assets ({count})',
},
{ count: assetCount }
{ count: totalAssetCount }
)) ||
''
}
Expand Down
Expand Up @@ -559,11 +559,11 @@ describe('Media library homepage', () => {
it('should render the table headers', () => {
usePersistentState.mockReturnValueOnce([viewOptions.LIST]);

const { getByText } = renderML();
expect(getByText('preview')).toBeInTheDocument();
const { getByText, getByRole } = renderML();
expect(getByRole('gridcell', { name: 'preview' })).toBeInTheDocument();
expect(getByText('name')).toBeInTheDocument();
expect(getByText('extension')).toBeInTheDocument();
expect(getByText('size')).toBeInTheDocument();
expect(getByRole('gridcell', { name: 'extension' })).toBeInTheDocument();
expect(getByRole('gridcell', { name: 'size' })).toBeInTheDocument();
expect(getByText('created')).toBeInTheDocument();
expect(getByText('last update')).toBeInTheDocument();
});
Expand Down
2 changes: 1 addition & 1 deletion packages/core/upload/package.json
Expand Up @@ -28,7 +28,7 @@
"@strapi/utils": "4.5.4",
"byte-size": "7.0.1",
"cropperjs": "1.5.12",
"date-fns": "2.29.2",
"date-fns": "2.29.3",
"fs-extra": "10.0.0",
"immer": "9.0.15",
"koa-range": "0.3.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/utils/package.json
Expand Up @@ -36,7 +36,7 @@
},
"dependencies": {
"@sindresorhus/slugify": "1.1.0",
"date-fns": "2.29.2",
"date-fns": "2.29.3",
"http-errors": "1.8.1",
"lodash": "4.17.21",
"yup": "0.32.9"
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Expand Up @@ -10080,10 +10080,10 @@ data-urls@^3.0.2:
whatwg-mimetype "^3.0.0"
whatwg-url "^11.0.0"

date-fns@2.29.2:
version "2.29.2"
resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.29.2.tgz#0d4b3d0f3dff0f920820a070920f0d9662c51931"
integrity sha512-0VNbwmWJDS/G3ySwFSJA3ayhbURMTJLtwM2DTxf9CWondCnh6DTNlO9JgRSq6ibf4eD0lfMJNBxUdEAHHix+bA==
date-fns@2.29.3:
version "2.29.3"
resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.29.3.tgz#27402d2fc67eb442b511b70bbdf98e6411cd68a8"
integrity sha512-dDCnyH2WnnKusqvZZ6+jA1O51Ibt8ZMRNkDZdyAyK4YfbDwa/cEmuztzG5pk6hqlp9aSBPYcjOlktquahGwGeA==

dateformat@^3.0.0:
version "3.0.3"
Expand Down

0 comments on commit 59438be

Please sign in to comment.