Skip to content

Commit

Permalink
Merge pull request #228 from cozy/feat/remove-playground
Browse files Browse the repository at this point in the history
feat: Remove cozy-authentication from playground
  • Loading branch information
zatteo authored Dec 12, 2024
2 parents 406a553 + 9d88145 commit a1163b9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 65 deletions.
6 changes: 0 additions & 6 deletions playgrounds/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@
yarn start
```

If you work on a local cozy and you don't have https enabled you have to define a global `ALLOW_HTTP` var at start to be able to login (see this line in cozy-authentication https://github.com/cozy/cozy-libs/blob/master/packages/cozy-authentication/src/steps/SelectServer.jsx#L111). With `parcel` you can use the `--global` option to do so

```
yarn start --global __ALLOW_HTTP__
```

Don't forget to launch your browser with disabled CORS and write the full domain for your cozy when reaching http://localhost:1234/index.html :

```
Expand Down
1 change: 0 additions & 1 deletion playgrounds/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"dependencies": {
"@material-ui/core": "3.9.3",
"@material-ui/lab": "^3.0.0-alpha.30",
"cozy-authentication": "^1.17.0",
"cozy-client": "6.64.7",
"cozy-device-helper": "^1.7.5",
"cozy-doctypes": "^1.61.0",
Expand Down
23 changes: 2 additions & 21 deletions playgrounds/src/common/App.jsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
import 'babel-polyfill'
import React from 'react'

import { hashHistory } from 'react-router'
import 'date-fns/locale/en/index'

import { CozyProvider } from 'cozy-client'

import 'cozy-ui/transpiled/react/stylesheet.css'
import IconSprite from 'cozy-ui/transpiled/react/Icon/Sprite'
import { Alerter, I18n } from 'cozy-ui/transpiled/react'
import { getUniversalLinkDomain } from 'cozy-ui/transpiled/react/AppLinker'
import icon from './icon.png'
import { MobileRouter } from 'cozy-authentication'

const styles = {
error: {
Expand Down Expand Up @@ -57,29 +54,13 @@ class ErrorBoundary extends React.Component {
/** A generic App component, meant to be used by all examples */
class App extends React.Component {
render() {
const { title, icon, client, children, existingStore } = this.props
/**
* We need to pass a loginPath with the current locationHash to be able
* to stay on the right page after a refresh since cozy-authentication
* redirect to loginPath after the login
*/

const { client, children, existingStore } = this.props
return (
<ErrorBoundary>
<Alerter />
<I18n dictRequire={() => ({})} lang="fr">
<CozyProvider store={existingStore} client={client}>
<MobileRouter
history={hashHistory}
protocol="cozyexample://"
universalLinkDomain={getUniversalLinkDomain()}
appTitle={title}
appIcon={icon}
appSlug="example"
loginPath={window.location.hash.replace('#', '')}
>
{children}
</MobileRouter>
{children}
</CozyProvider>
</I18n>
<IconSprite />
Expand Down
39 changes: 2 additions & 37 deletions playgrounds/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1711,17 +1711,6 @@ cosmiconfig@^5.0.0:
js-yaml "^3.13.1"
parse-json "^4.0.0"

cozy-authentication@^1.17.0:
version "1.17.2"
resolved "https://registry.yarnpkg.com/cozy-authentication/-/cozy-authentication-1.17.2.tgz#4decb93846490fab58d29f273a36b9301d1a3543"
integrity sha512-1M4Nk3lPoRUP0xfcIp25Nq7CBdzimtNYNQxWOFeYlqeoHWk7a7G5sGbxwTQ0Vsm7O2RqXeaRYEYlUyTtmdumMA==
dependencies:
cozy-device-helper "^1.7.5"
localforage "1.7.3"
prop-types "15.7.2"
react-markdown "4.0.8"
url-polyfill "1.1.0"

[email protected]:
version "6.64.7"
resolved "https://registry.yarnpkg.com/cozy-client/-/cozy-client-6.64.7.tgz#ea8655a8956e2f06a2953515bebb4a70bca64d5f"
Expand Down Expand Up @@ -3002,11 +2991,6 @@ ignore-walk@^3.0.1:
dependencies:
minimatch "^3.0.4"

immediate@~3.0.5:
version "3.0.6"
resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b"
integrity sha1-nbHb0Pr43m++D13V5Wu2BigN5ps=

import-fresh@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-2.0.0.tgz#d81355c15612d386c61f9ddd3922d4304822a546"
Expand Down Expand Up @@ -3572,13 +3556,6 @@ levn@~0.3.0:
prelude-ls "~1.1.2"
type-check "~0.3.2"

[email protected]:
version "3.1.1"
resolved "https://registry.yarnpkg.com/lie/-/lie-3.1.1.tgz#9a436b2cc7746ca59de7a41fa469b3efb76bd87e"
integrity sha1-mkNrLMd0bKWd56QfpGmz77dr2H4=
dependencies:
immediate "~3.0.5"

loader-utils@^1.0.0, loader-utils@^1.1.0:
version "1.2.3"
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.2.3.tgz#1ff5dc6911c9f0a062531a4c04b609406108c2c7"
Expand All @@ -3588,13 +3565,6 @@ loader-utils@^1.0.0, loader-utils@^1.1.0:
emojis-list "^2.0.0"
json5 "^1.0.1"

[email protected]:
version "1.7.3"
resolved "https://registry.yarnpkg.com/localforage/-/localforage-1.7.3.tgz#0082b3ca9734679e1bd534995bdd3b24cf10f204"
integrity sha512-1TulyYfc4udS7ECSBT2vwJksWbkwwTX8BzeUIiq8Y07Riy7bDAAnxDaPU/tWyOVmQAcWJIEIFP9lPfBGqVoPgQ==
dependencies:
lie "3.1.1"

lodash-es@^4.2.1:
version "4.17.11"
resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.11.tgz#145ab4a7ac5c5e52a3531fb4f310255a152b4be0"
Expand Down Expand Up @@ -4775,7 +4745,7 @@ promise@^7.1.1:
dependencies:
asap "~2.0.3"

prop-types@15.7.2, prop-types@^15.5.6, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2:
prop-types@^15.5.6, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2:
version "15.7.2"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5"
integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==
Expand Down Expand Up @@ -4956,7 +4926,7 @@ react-lifecycles-compat@^3.0.0, react-lifecycles-compat@^3.0.2, react-lifecycles
resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362"
integrity sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==

react-markdown@4.0.8, react-markdown@^4.0.8:
react-markdown@^4.0.8:
version "4.0.8"
resolved "https://registry.yarnpkg.com/react-markdown/-/react-markdown-4.0.8.tgz#e3621b5becaac82a651008d7bc8390d3e4e438c0"
integrity sha512-Z6oa648rufvzyO0KwYJ/9p9AsdYGIluqK6OlpJ35ouJ8HPF0Ko1WDNdyymjDSHxNrkb7HDyEcIDJCQs8NlET5A==
Expand Down Expand Up @@ -6135,11 +6105,6 @@ urix@^0.1.0:
resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72"
integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=

[email protected]:
version "1.1.0"
resolved "https://registry.yarnpkg.com/url-polyfill/-/url-polyfill-1.1.0.tgz#d34e1a596d954b864bc8608f84c592820df422db"
integrity sha512-QAbzqCwd84yA6VyjV30aZXla+lrRmczDurvlsVnK+tFOu677ZNGz8shcFWQRp5BF9/z7qvNiCQLqpWPtVoUEBg==

url-search-params-polyfill@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/url-search-params-polyfill/-/url-search-params-polyfill-7.0.0.tgz#98b56ed29e67710588fdc3c361083b0f78303d95"
Expand Down

0 comments on commit a1163b9

Please sign in to comment.