Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsingwersen committed Oct 16, 2024
2 parents dd8ae1b + c823b10 commit e9a6b5d
Show file tree
Hide file tree
Showing 75 changed files with 586 additions and 399 deletions.
2 changes: 1 addition & 1 deletion .github/actions/check-pr-status/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "check-pr-status",
"version": "5.0.6",
"version": "5.1.0",
"private": true,
"license": "MIT",
"main": "dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "5.0.6",
"version": "5.1.0",
"npmClient": "yarn"
}
2 changes: 1 addition & 1 deletion packages/admin-test-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@strapi/admin-test-utils",
"version": "5.0.6",
"version": "5.1.0",
"private": true,
"description": "Test utilities for the Strapi administration panel",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/cloud/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@strapi/cloud-cli",
"version": "5.0.6",
"version": "5.1.0",
"description": "Commands to interact with the Strapi Cloud",
"keywords": [
"strapi",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/create-strapi-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-strapi-app",
"version": "5.0.6",
"version": "5.1.0",
"description": "Generate a new Strapi application.",
"keywords": [
"create-strapi-app",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/create-strapi/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-strapi",
"version": "5.0.6",
"version": "5.1.0",
"description": "Generate a new Strapi application.",
"keywords": [
"create-strapi",
Expand Down
1 change: 1 addition & 0 deletions packages/core/admin/admin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export { useQueryParams } from './hooks/useQueryParams';
export { useFetchClient } from './hooks/useFetchClient';
export { useFocusInputField } from './hooks/useFocusInputField';
export { useRBAC } from './hooks/useRBAC';
export { useClipboard } from './hooks/useClipboard';
export { useAdminUsers } from './services/users';

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/core/admin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@strapi/admin",
"version": "5.0.6",
"version": "5.1.0",
"description": "Strapi Admin",
"repository": {
"type": "git",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import * as React from 'react';

import { Button } from '@strapi/design-system';
import { useClipboard, useNotification } from '@strapi/admin/strapi-admin';
import { Button, Flex, IconButton } from '@strapi/design-system';
import { Link as LinkIcon } from '@strapi/icons';
import { UID } from '@strapi/types';
import { useIntl } from 'react-intl';
import { Link } from 'react-router-dom';
Expand All @@ -11,6 +13,8 @@ import type { PanelComponent } from '@strapi/content-manager/strapi-admin';

const PreviewSidePanel: PanelComponent = ({ model, documentId, document }) => {
const { formatMessage } = useIntl();
const { toggleNotification } = useNotification();
const { copy } = useClipboard();
const { data, error } = useGetPreviewUrlQuery({
params: {
contentType: model as UID.ContentType,
Expand All @@ -26,15 +30,40 @@ const PreviewSidePanel: PanelComponent = ({ model, documentId, document }) => {
return null;
}

const { url } = data.data;

const handleCopyLink = () => {
copy(url);
toggleNotification({
message: formatMessage({
id: 'content-manager.preview.copy.success',
defaultMessage: 'Copied preview link',
}),
type: 'success',
});
};

return {
title: formatMessage({ id: 'content-manager.preview.panel.title', defaultMessage: 'Preview' }),
content: (
<Button variant="tertiary" fullWidth tag={Link} to={data.data.url} target="_blank">
{formatMessage({
id: 'content-manager.preview.panel.button',
defaultMessage: 'Open preview',
})}
</Button>
<Flex gap={2} width="100%">
<Button variant="tertiary" tag={Link} to={url} target="_blank" flex="auto">
{formatMessage({
id: 'content-manager.preview.panel.button',
defaultMessage: 'Open preview',
})}
</Button>
<IconButton
type="button"
label={formatMessage({
id: 'preview.copy.label',
defaultMessage: 'Copy preview link',
})}
onClick={handleCopyLink}
>
<LinkIcon />
</IconButton>
</Flex>
),
};
};
Expand Down
11 changes: 4 additions & 7 deletions packages/core/content-manager/admin/src/preview/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { PreviewSidePanel } from './components/PreviewSidePanel';
import { FEATURE_ID } from './constants';

import type { ContentManagerPlugin } from '../content-manager';
import type { PluginDefinition } from '@strapi/admin/strapi-admin';

const previewAdmin = {
Expand All @@ -12,14 +13,10 @@ const previewAdmin = {
return;
}

const contentManagerPluginApis = app.getPlugin('content-manager').apis;
const contentManagerPluginApis = app.getPlugin('content-manager')
.apis as ContentManagerPlugin['config']['apis'];

if (
'addEditViewSidePanel' in contentManagerPluginApis &&
typeof contentManagerPluginApis.addEditViewSidePanel === 'function'
) {
contentManagerPluginApis.addEditViewSidePanel([PreviewSidePanel]);
}
contentManagerPluginApis.addEditViewSidePanel([PreviewSidePanel]);
},
} satisfies Partial<PluginDefinition>;

Expand Down
2 changes: 2 additions & 0 deletions packages/core/content-manager/admin/src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@
"popover.display-relations.label": "Display relations",
"preview.panel.title": "Preview",
"preview.panel.button": "Open preview",
"preview.copy.label": "Copy preview link",
"preview.copy.success": "Copied preview link",
"relation.add": "Add relation",
"relation.disconnect": "Remove",
"relation.error-adding-relation": "An error occurred while trying to add the relation.",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/content-manager/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@strapi/content-manager",
"version": "5.0.6",
"version": "5.1.0",
"description": "A powerful UI to easily manage your data.",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/content-releases/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@strapi/content-releases",
"version": "5.0.6",
"version": "5.1.0",
"description": "Strapi plugin for organizing and releasing content",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/content-type-builder/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@strapi/content-type-builder",
"version": "5.0.6",
"version": "5.1.0",
"description": "Create and manage content types",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@strapi/core",
"version": "5.0.6",
"version": "5.1.0",
"description": "Core of Strapi",
"homepage": "https://strapi.io",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/data-transfer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@strapi/data-transfer",
"version": "5.0.6",
"version": "5.1.0",
"description": "Data transfer capabilities for Strapi",
"keywords": [
"strapi",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/database/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@strapi/database",
"version": "5.0.6",
"version": "5.1.0",
"description": "Strapi's database layer",
"homepage": "https://strapi.io",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/database/src/query/helpers/where.ts
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ const applyWhere = (qb: Knex.QueryBuilder, where: Where) => {

const fieldLowerFn = (qb: Knex.QueryBuilder) => {
// Postgres requires string to be passed
if (qb.client.config.client === 'postgres') {
if (qb.client.dialect === 'postgresql') {
return 'LOWER(CAST(?? AS VARCHAR))';
}

Expand Down
2 changes: 1 addition & 1 deletion packages/core/email/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@strapi/email",
"version": "5.0.6",
"version": "5.1.0",
"description": "Easily configure your Strapi application to send emails.",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/permissions/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@strapi/permissions",
"version": "5.0.6",
"version": "5.1.0",
"description": "Strapi's permission layer.",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/review-workflows/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@strapi/review-workflows",
"version": "5.0.6",
"version": "5.1.0",
"description": "Review workflows for your content",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/strapi/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@strapi/strapi",
"version": "5.0.6",
"version": "5.1.0",
"description": "An open source headless CMS solution to create and manage your own API. It provides a powerful dashboard and features to make your life easier. Databases supported: MySQL, MariaDB, PostgreSQL, SQLite",
"keywords": [
"strapi",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/types/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@strapi/types",
"version": "5.0.6",
"version": "5.1.0",
"description": "Shared typescript types for Strapi internal use",
"keywords": [
"strapi"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import React from 'react';

import { useNotification } from '@strapi/admin/strapi-admin';
import { useNotification, useClipboard } from '@strapi/admin/strapi-admin';
import { IconButton } from '@strapi/design-system';
import { Link as LinkIcon } from '@strapi/icons';
import PropTypes from 'prop-types';
import { useIntl } from 'react-intl';

import { useClipboard } from '../../hooks/useClipboard';
import { getTrad } from '../../utils';

export const CopyLinkButton = ({ url }) => {
Expand Down
24 changes: 0 additions & 24 deletions packages/core/upload/admin/src/hooks/tests/useClipboard.test.ts

This file was deleted.

37 changes: 0 additions & 37 deletions packages/core/upload/admin/src/hooks/useClipboard.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/core/upload/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@strapi/upload",
"version": "5.0.6",
"version": "5.1.0",
"description": "Makes it easy to upload images and files to your Strapi Application.",
"license": "SEE LICENSE IN LICENSE",
"author": {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@strapi/utils",
"version": "5.0.6",
"version": "5.1.0",
"description": "Shared utilities for the Strapi packages",
"keywords": [
"strapi",
Expand Down
2 changes: 1 addition & 1 deletion packages/generators/generators/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@strapi/generators",
"version": "5.0.6",
"version": "5.1.0",
"description": "Interactive API generator.",
"keywords": [
"strapi",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/cloud/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@strapi/plugin-cloud",
"version": "5.0.6",
"version": "5.1.0",
"description": "Instructions to deploy your local project to Strapi Cloud",
"license": "MIT",
"author": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/color-picker/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@strapi/plugin-color-picker",
"version": "5.0.6",
"version": "5.1.0",
"description": "Strapi maintained Custom Fields",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/documentation/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@strapi/plugin-documentation",
"version": "5.0.6",
"version": "5.1.0",
"description": "Create an OpenAPI Document and visualize your API with SWAGGER UI.",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/graphql/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@strapi/plugin-graphql",
"version": "5.0.6",
"version": "5.1.0",
"description": "Adds GraphQL endpoint with default API methods.",
"repository": {
"type": "git",
Expand Down
Loading

0 comments on commit e9a6b5d

Please sign in to comment.