Merge branch 'master' into fix/media-preview

This commit is contained in:
Alexandre BODIN 2019-09-23 09:44:45 +02:00 committed by GitHub
commit e6e1a70c2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 76 additions and 11 deletions

View File

@ -101,6 +101,7 @@ Strapi comes with the following providers:
- [Google](https://github.com/strapi/strapi-examples/blob/master/login-react/doc/google_setup.md)
- [Github](https://github.com/strapi/strapi-examples/blob/master/login-react/doc/github_setup.md)
- [Twitter](https://github.com/strapi/strapi-examples/blob/master/login-react/doc/twitter_setup.md)
- [Instagram](https://github.com/strapi/strapi-examples/blob/master/login-react/doc/instagram_setup.md)
[👀   See our complete example with detailed tutorials for each provider (with React)](https://github.com/strapi/strapi-examples/tree/master/login-react)

View File

@ -91,7 +91,7 @@ Sort users by email.
Sorting on multiple fileds
- `GET /users?_sort=email:asc,createdAt:desc`
- `GET /users?_sort=email:asc,dateField:desc`
- `GET /users?_sort=email:DESC,username:ASC`
### Limit

View File

@ -159,6 +159,12 @@ module.exports = () => {
};
```
**No Function**
```js
module.exports = () => {};
```
### Custom hooks
If you have custom [hooks](../advanced/hooks.md) in your project, the `initialize` function will not receive a callback anymore. You can either use an async function, return a promise or simply run a synchronous function.

View File

@ -79,7 +79,7 @@
"terser-webpack-plugin": "^1.2.3",
"url-loader": "^1.1.2",
"video-react": "^0.13.2",
"webpack": "^4.29.6",
"webpack": "^4.40.1",
"webpackbar": "^3.2.0",
"yup": "^0.27.0"
},
@ -102,7 +102,7 @@
"license": "MIT",
"gitHead": "c85658a19b8fef0f3164c19693a45db305dc07a9",
"devDependencies": {
"webpack": "^4.29.6",
"webpack": "^4.40.1",
"webpack-cli": "^3.3.2",
"webpack-dev-server": "^3.4.1"
}

View File

@ -28,7 +28,7 @@ function InputNumber(props) {
onFocus={props.onFocus}
placeholder={message}
ref={props.inputRef}
step={!Number.isNaN(Number(props.step)) ? Number(props.step) : 1}
step={props.step}
style={props.style}
tabIndex={props.tabIndex}
type="number"
@ -49,7 +49,7 @@ InputNumber.defaultProps = {
onBlur: () => {},
onFocus: () => {},
placeholder: 'app.utils.placeholder.defaultMessage',
step: 1,
step: 'any',
style: {},
tabIndex: '0',
};

View File

@ -165,7 +165,7 @@ InputNumberWithErrors.defaultProps = {
labelStyle: {},
noErrorsDescription: false,
placeholder: 'app.utils.placeholder.defaultMessage',
step: 1,
step: 'any',
style: {},
tabIndex: '0',
validations: {},

View File

@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import { isEmpty } from 'lodash';
import { useDrop } from 'react-dnd';
import Select from 'react-select';
import Select, { createFilter } from 'react-select';
import ItemTypes from '../../utils/ItemTypes';
import { ListShadow, ListWrapper } from './components';
@ -48,17 +48,31 @@ function SelectMany({
[value]
);
const filterConfig = {
ignoreCase: true,
ignoreAccents: true,
trim: false,
matchFrom: 'any',
};
return (
<>
<Select
isDisabled={isDisabled}
id={name}
filterOption={el => {
if (isEmpty(value)) {
return true;
filterOption={(candidate, input) => {
if (!isEmpty(value)) {
const isSelected = value.findIndex(item => item.id === candidate.value.id) !== -1;
if (isSelected) {
return false;
}
}
return value.findIndex(obj => obj.id === el.value.id) === -1;
if (input) {
return createFilter(filterConfig)(candidate, input);
}
return true;
}}
isLoading={isLoading}
isMulti

View File

@ -60,6 +60,8 @@ class PopUpForm extends React.Component {
return `${strapi.backendURL}/connect/microsoft/callback`;
case 'twitter':
return `${strapi.backendURL}/connect/twitter/callback`;
case 'instagram':
return `${strapi.backendURL}/connect/instagram/callback`;
default: {
const value = get(this.props.values, 'callback', '');

View File

@ -76,6 +76,7 @@
"PopUpForm.Providers.facebook.providerConfig.redirectURL": "عنوان URL لإعادة التوجيه لإضافتة تكوين تطبيق Facebook",
"PopUpForm.Providers.github.providerConfig.redirectURL": "عنوان URL لإعادة التوجيه لإضافتة تكوين تطبيق Github",
"PopUpForm.Providers.google.providerConfig.redirectURL": "عنوان URL لإعادة التوجيه لإضافتة تكوين تطبيق Google",
"PopUpForm.Providers.instagram.providerConfig.redirectURL": "عنوان URL لإعادة التوجيه لإضافتة تكوين تطبيق Instagram",
"PopUpForm.Providers.key.label": "معرف العميل",
"PopUpForm.Providers.key.placeholder": "نص",
"PopUpForm.Providers.linkedin2.providerConfig.redirectURL": "عنوان URL لإعادة التوجيه لإضافتة تكوين تطبيق Linkedin",

View File

@ -82,6 +82,7 @@
"PopUpForm.Providers.facebook.providerConfig.redirectURL": "Die URL, die in den Einstellungen deiner Facebook-App gesetzt wird",
"PopUpForm.Providers.github.providerConfig.redirectURL": "Die URL, die in den Einstellungen deiner Github-App gesetzt wird",
"PopUpForm.Providers.google.providerConfig.redirectURL": "Die URL, die in den Einstellungen deiner Google-App gesetzt wird",
"PopUpForm.Providers.instagram.providerConfig.redirectURL": "Die URL, die in den Einstellungen deiner Instagram-App gesetzt wird",
"PopUpForm.Providers.microsoft.providerConfig.redirectURL": "Die URL, die in den Einstellungen deiner Microsoft-App gesetzt wird",
"PopUpForm.Providers.key.label": "Client ID",
"PopUpForm.Providers.key.placeholder": "TEXT",

View File

@ -82,6 +82,7 @@
"PopUpForm.Providers.facebook.providerConfig.redirectURL": "The redirect URL to add in your Facebook application configurations",
"PopUpForm.Providers.github.providerConfig.redirectURL": "The redirect URL to add in your GitHub application configurations",
"PopUpForm.Providers.google.providerConfig.redirectURL": "The redirect URL to add in your Google application configurations",
"PopUpForm.Providers.instagram.providerConfig.redirectURL": "The redirect URL to add in your Instagram application configurations",
"PopUpForm.Providers.key.label": "Client ID",
"PopUpForm.Providers.key.placeholder": "TEXT",
"PopUpForm.Providers.linkedin2.providerConfig.redirectURL": "The redirect URL to add in your Linkedin application configurations",

View File

@ -81,6 +81,7 @@
"PopUpForm.Providers.facebook.providerConfig.redirectURL": "La URL de redirección que se debe agregar en la configuración de la aplicación Facebook",
"PopUpForm.Providers.github.providerConfig.redirectURL": "La URL de redirección que se debe agregar en la configuración de la aplicación GitHub",
"PopUpForm.Providers.google.providerConfig.redirectURL": "La URL de redirección que se debe agregar en la configuración de la aplicación Google",
"PopUpForm.Providers.instagram.providerConfig.redirectURL": "La URL de redirección que se debe agregar en la configuración de la aplicación Instagram",
"PopUpForm.Providers.key.label": "ID de cliente",
"PopUpForm.Providers.key.placeholder": "TEXTO",
"PopUpForm.Providers.linkedin2.providerConfig.redirectURL": "La URL de redirección que se debe agregar en la configuración de la aplicación Linkedin",

View File

@ -83,6 +83,7 @@
"PopUpForm.Providers.facebook.providerConfig.redirectURL": "L'URL de redirection à ajouter dans les configurations Facebook de votre application",
"PopUpForm.Providers.github.providerConfig.redirectURL": "L'URL de redirection à ajouter dans les configurations GitHub de votre application",
"PopUpForm.Providers.google.providerConfig.redirectURL": "L'URL de redirection à ajouter dans les configurations Google de votre application",
"PopUpForm.Providers.instagram.providerConfig.redirectURL": "L'URL de redirection à ajouter dans les configurations Instagram de votre application",
"PopUpForm.Providers.key.label": "Client ID",
"PopUpForm.Providers.key.placeholder": "TEXT",
"PopUpForm.Providers.linkedin2.providerConfig.redirectURL": "L'URL de redirection à ajouter dans les configurations Linkedin de votre application",

View File

@ -75,6 +75,7 @@
"PopUpForm.Providers.facebook.providerConfig.redirectURL": "L'URL di redirect per aggiungere la tua configurazione dell'applicazione Facebook",
"PopUpForm.Providers.github.providerConfig.redirectURL": "L'URL di redirect per aggiungere la tua configurazione dell'applicazione Github",
"PopUpForm.Providers.google.providerConfig.redirectURL": "L'URL di redirect per aggiungere la tua configurazione dell'applicazione Google",
"PopUpForm.Providers.instagram.providerConfig.redirectURL": "L'URL di redirect per aggiungere la tua configurazione dell'applicazione Instagram",
"PopUpForm.Providers.key.placeholder": "TEXT",
"PopUpForm.Providers.linkedin2.providerConfig.redirectURL": "L'URL di redirect per aggiungere la tua configurazione dell'applicazione Linkdin",
"PopUpForm.Providers.redirectURL.front-end.label": "L'URL di redirect per la tua app di front-end",

View File

@ -81,6 +81,7 @@
"PopUpForm.Providers.facebook.providerConfig.redirectURL": "Facebookアプリケーション設定で追加するリダイレクトURL",
"PopUpForm.Providers.github.providerConfig.redirectURL": "GitHubアプリケーションの設定で追加するリダイレクトURL",
"PopUpForm.Providers.google.providerConfig.redirectURL": "Googleアプリケーション設定で追加するリダイレクトURL",
"PopUpForm.Providers.instagram.providerConfig.redirectURL": "Instagramアプリケーション設定で追加するリダイレクトURL",
"PopUpForm.Providers.key.label": "クライアントID",
"PopUpForm.Providers.key.placeholder": "TEXT",
"PopUpForm.Providers.linkedin2.providerConfig.redirectURL": "あなたのLinkedinアプリケーション構成に追加するリダイレクトURL",

View File

@ -76,6 +76,7 @@
"PopUpForm.Providers.facebook.providerConfig.redirectURL": "Facebook 애플리케이션 구성에 추가 할 리다이렉트 URL",
"PopUpForm.Providers.github.providerConfig.redirectURL": "Github 애플리케이션 구성에 추가 할 리다이렉트 URL",
"PopUpForm.Providers.google.providerConfig.redirectURL": "Google 애플리케이션 구성에 추가 할 리다이렉트 URL",
"PopUpForm.Providers.instagram.providerConfig.redirectURL": "Instagram 애플리케이션 구성에 추가 할 리다이렉트 URL",
"PopUpForm.Providers.key.label": "클라이언트 ID(Client ID)",
"PopUpForm.Providers.key.placeholder": "텍스트",
"PopUpForm.Providers.linkedin2.providerConfig.redirectURL": "Linkedin",

View File

@ -82,6 +82,7 @@
"PopUpForm.Providers.facebook.providerConfig.redirectURL": "De doorstuur URL om in je Facebook applicatie configuratie te zetten",
"PopUpForm.Providers.github.providerConfig.redirectURL": "De doorstuur URL om in je GitHub applicatie configuratie te zetten",
"PopUpForm.Providers.google.providerConfig.redirectURL": "De doorstuur URL om in je Google applicatie configuratie te zetten",
"PopUpForm.Providers.instagram.providerConfig.redirectURL": "De doorstuur URL om in je Instagram applicatie configuratie te zetten",
"PopUpForm.Providers.key.label": "Client ID",
"PopUpForm.Providers.key.placeholder": "TEXT",
"PopUpForm.Providers.microsoft.providerConfig.redirectURL": "De doorstuur URL om in je Microsoft applicatie configuratie te zetten",

View File

@ -81,6 +81,7 @@
"PopUpForm.Providers.facebook.providerConfig.redirectURL": "Adres przekierowania do dodania w aplikacji Facebook",
"PopUpForm.Providers.github.providerConfig.redirectURL": "Adres przekierowania do dodania w aplikacji GitHub",
"PopUpForm.Providers.google.providerConfig.redirectURL": "Adres przekierowania do dodania w aplikacji Google",
"PopUpForm.Providers.instagram.providerConfig.redirectURL": "Adres przekierowania do dodania w aplikacji Instagram",
"PopUpForm.Providers.key.label": "ID klienta",
"PopUpForm.Providers.key.placeholder": "TEKST",
"PopUpForm.Providers.discord.providerConfig.redirectURL": "Adres przekierowania do dodania w aplikacji Discord",

View File

@ -76,6 +76,7 @@
"PopUpForm.Providers.facebook.providerConfig.redirectURL": "O URL de redirecionamento para adicionar em suas configurações de aplicativos do Facebook",
"PopUpForm.Providers.github.providerConfig.redirectURL": "O URL de redirecionamento para adicionar nas configurações do aplicativo GitHub",
"PopUpForm.Providers.google.providerConfig.redirectURL": "O URL de redirecionamento a adicionar nas suas configurações de aplicativo do Google",
"PopUpForm.Providers.instagram.providerConfig.redirectURL": "O URL de redirecionamento a adicionar nas suas configurações de aplicativo do Instagram",
"PopUpForm.Providers.key.label": "ID do cliente",
"PopUpForm.Providers.key.placeholder": "TEXT",
"PopUpForm.Providers.linkedin2.providerConfig.redirectURL": "O URL de redirecionamento a ser adicionado nas configurações do aplicativo Linkedin",

View File

@ -81,6 +81,7 @@
"PopUpForm.Providers.facebook.providerConfig.redirectURL": "Endereço de redirecionamento para adicionar às configurações da sua aplicação do Facebook",
"PopUpForm.Providers.github.providerConfig.redirectURL": "Endereço de redirecionamento para adicionar às configurações da sua aplicação de GitHub",
"PopUpForm.Providers.google.providerConfig.redirectURL": "Endereço de redirecionamento para adicionar às configurações da sua aplicação da Google",
"PopUpForm.Providers.instagram.providerConfig.redirectURL": "Endereço de redirecionamento para adicionar às configurações da sua aplicação da Instagram",
"PopUpForm.Providers.key.label": "ID de Client",
"PopUpForm.Providers.key.placeholder": "TEXTO",
"PopUpForm.Providers.linkedin2.providerConfig.redirectURL": "Endereço de redirecionamento para adicionar às configurações da sua aplicação de Linkedin",

View File

@ -83,6 +83,7 @@
"PopUpForm.Providers.facebook.providerConfig.redirectURL": "URL-адрес перенаправления, который необходимо добавить в настройки Facebook приложения",
"PopUpForm.Providers.github.providerConfig.redirectURL": "URL-адрес перенаправления, который необходимо добавить в настройки GitHub приложения",
"PopUpForm.Providers.google.providerConfig.redirectURL": "URL-адрес перенаправления, который необходимо добавить в настройки Google приложения",
"PopUpForm.Providers.instagram.providerConfig.redirectURL": "URL-адрес перенаправления, который необходимо добавить в настройки Instagram приложения",
"PopUpForm.Providers.key.label": "Client ID",
"PopUpForm.Providers.key.placeholder": "TEXT",
"PopUpForm.Providers.linkedin2.providerConfig.redirectURL": "URL-адрес перенаправления, который необходимо добавить в настройки Linkedin приложения",

View File

@ -82,6 +82,7 @@
"PopUpForm.Providers.facebook.providerConfig.redirectURL": "Facebook uygulama yapılandırmalarınıza eklenecek yönlendirme URL'si",
"PopUpForm.Providers.github.providerConfig.redirectURL": "GitHub uygulama yapılandırmalarınıza eklenecek yönlendirme URL'si",
"PopUpForm.Providers.google.providerConfig.redirectURL": "Google uygulama yapılandırmalarınıza eklenecek yönlendirme URL'si",
"PopUpForm.Providers.instagram.providerConfig.redirectURL": "Instagram uygulama yapılandırmalarınıza eklenecek yönlendirme URL'si",
"PopUpForm.Providers.key.label": "Web istemcisi ID",
"PopUpForm.Providers.key.placeholder": "METİN",
"PopUpForm.Providers.linkedin2.providerConfig.redirectURL": "Linkedin uygulama yapılandırmalarınıza eklenecek yönlendirme URL'si",

View File

@ -76,6 +76,7 @@
"PopUpForm.Providers.facebook.providerConfig.redirectURL": "Facebook应用中配置的重定向URL",
"PopUpForm.Providers.github.providerConfig.redirectURL": "GitHub应用中配置的重定向URL",
"PopUpForm.Providers.google.providerConfig.redirectURL": "Google应用中配置的重定向URL",
"PopUpForm.Providers.instagram.providerConfig.redirectURL": "Instagram应用中配置的重定向URL",
"PopUpForm.Providers.key.label": "Client ID",
"PopUpForm.Providers.key.placeholder": "TEXT",
"PopUpForm.Providers.linkedin2.providerConfig.redirectURL": "Linkedin应用中配置的重定向URL",

View File

@ -81,6 +81,7 @@
"PopUpForm.Providers.facebook.providerConfig.redirectURL": "在 Facebook 的設定中填入的重新導向網址",
"PopUpForm.Providers.github.providerConfig.redirectURL": "在 GitHub 的設定中填入的重新導向網址",
"PopUpForm.Providers.google.providerConfig.redirectURL": "在 Google 的設定中填入的重新導向網址",
"PopUpForm.Providers.instagram.providerConfig.redirectURL": "在 Instagram 的設定中填入的重新導向網址",
"PopUpForm.Providers.key.label": "客戶端 ID",
"PopUpForm.Providers.key.placeholder": "TEXT",
"PopUpForm.Providers.linkedin2.providerConfig.redirectURL": "在 Linkedin 的設定中填入的重新導向網址",

View File

@ -80,6 +80,13 @@ module.exports = async () => {
secret: '',
callback: '/auth/twitter/callback',
},
instagram: {
enabled: false,
icon: 'instagram',
key: '',
secret: '',
callback: '/auth/instagram/callback',
},
};
const prevGrantConfig = (await pluginStore.get({ key: 'grant' })) || {};
// store grant auth config to db

View File

@ -332,6 +332,25 @@ const getProfile = async (provider, query, callback) => {
});
break;
}
case 'instagram': {
const instagram = new Purest({
provider: 'instagram',
key: grant.instagram.key,
secret: grant.instagram.secret
});
instagram.query().get('users/self').qs({access_token}).request((err, res, body) => {
if (err) {
callback(err);
} else {
callback(null, {
username: body.data.username,
email: `${body.data.username}@strapi.io` // dummy email as Instagram does not provide user email
});
}
});
break;
}
default:
callback({
message: 'Unknown provider.',