diff --git a/README.md b/README.md index 8144e393a..30a4bb4f3 100644 --- a/README.md +++ b/README.md @@ -51,11 +51,6 @@ Help link is defined in your Cozy's [configuration file](https://github.com/cozy Coming Soon applications (or apps) are defined in your Cozy's [configuration file](https://github.com/cozy/cozy-stack/blob/master/docs/config.md#main-configuration-file). See the `cozy.example.yaml` file [provided by the stack](https://github.com/cozy/cozy-stack/blob/master/cozy.example.yaml#L80). -## Claudy actions list - -Claudy actions are declared in `src/config/claudy.yaml` with a slug as property name and some options (icon name and link options for example). The slugs list that will be used for Claudy is defined in your Cozy's [configuration file](https://github.com/cozy/cozy-stack/blob/master/docs/config.md#main-configuration-file). See the `cozy.example.yaml` file [provided by the stack](https://github.com/cozy/cozy-stack/blob/master/cozy.example.yaml#L101). -If no `claudy_actions` property is defined in the configuration, Claudy won't be displayed. - ## Customizing the content of the bar From within your app, you can decide to take over certain areas of the cozy-bar. This might especially be useful on mobile where the area it occupies is prime real estate — we generally don't recommend to use this option on larger screen resolutions. diff --git a/src/assets/icons/32/icon-claudy.svg b/src/assets/icons/32/icon-claudy.svg deleted file mode 100644 index 1cfd78b0f..000000000 --- a/src/assets/icons/32/icon-claudy.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/assets/icons/claudyActions/icon-bills.svg b/src/assets/icons/claudyActions/icon-bills.svg deleted file mode 100644 index 3f880858f..000000000 --- a/src/assets/icons/claudyActions/icon-bills.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/src/assets/icons/claudyActions/icon-laptop.svg b/src/assets/icons/claudyActions/icon-laptop.svg deleted file mode 100644 index 7e6a63d1e..000000000 --- a/src/assets/icons/claudyActions/icon-laptop.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/src/assets/icons/claudyActions/icon-phone.svg b/src/assets/icons/claudyActions/icon-phone.svg deleted file mode 100644 index d6041e6ad..000000000 --- a/src/assets/icons/claudyActions/icon-phone.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/src/assets/icons/claudyActions/icon-question-mark.svg b/src/assets/icons/claudyActions/icon-question-mark.svg deleted file mode 100644 index 271e0938a..000000000 --- a/src/assets/icons/claudyActions/icon-question-mark.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/src/components/Bar.jsx b/src/components/Bar.jsx index 1d087d14a..af02a795a 100644 --- a/src/components/Bar.jsx +++ b/src/components/Bar.jsx @@ -12,7 +12,6 @@ import Banner from 'components/Banner' import Drawer from 'components/Drawer' import Settings from 'components/Settings' import Apps from 'components/Apps' -import Claudy from 'components/Claudy' import { getTheme, hasFetched, @@ -21,7 +20,6 @@ import { fetchApps, fetchContext, fetchSettingsData, - shouldEnableClaudy, getWebviewContext } from 'lib/reducers' @@ -41,8 +39,6 @@ export class Bar extends Component { constructor(props) { super(props) this.state = { - claudyFired: false, // true to fire claudy (used by the drawer) - claudyOpened: false, drawerVisible: false } this.fetchApps = this.fetchApps.bind(this) @@ -90,26 +86,12 @@ export class Bar extends Component { } toggleDrawer = () => { - // don't allow to toggle the drawer if claudy opened or is opening - if (this.state.claudyOpened || this.state.claudyFired) return const drawerVisible = !this.state.drawerVisible // don't wait for transitionend if displaying if (drawerVisible) this.props.onDrawer(drawerVisible) this.setState({ drawerVisible }) } - toggleClaudy = (isFromDrawer = false) => { - if (!this.props.claudyEnabled) return - const { claudyOpened } = this.state - if (isFromDrawer && !claudyOpened) { - // if opened from drawer - // reset to toggle via the Claudy component - return this.setState({ claudyFired: true }) - } - if (this.state.claudyFired) this.setState({ claudyFired: false }) - this.setState({ claudyOpened: !claudyOpened }) - } - renderCenter() { const { appName, @@ -163,7 +145,7 @@ export class Bar extends Component { } render() { - const { claudyFired, claudyOpened, drawerVisible } = this.state + const { drawerVisible } = this.state const { theme, @@ -172,7 +154,6 @@ export class Bar extends Component { barRight, barCenter, barSearch, - claudyEnabled, onDrawer, isPublic, onLogOut, @@ -202,22 +183,11 @@ export class Bar extends Component { this.toggleClaudy(true))) || false - } - isClaudyLoading={claudyFired} drawerListener={() => onDrawer(drawerVisible)} onLogOut={onLogOut} isInvertedTheme={isInvertedTheme} /> ) : null} - {claudyEnabled && ( - this.toggleClaudy(false)} - opened={claudyOpened} - /> - )} {userActionRequired && } @@ -247,7 +217,6 @@ export const mapStateToProps = state => ({ barCenter: getContent(state, 'center'), barSearch: getContent(state, 'search'), isDrive: isCurrentApp(state, { slug: 'drive' }), - claudyEnabled: shouldEnableClaudy(state), hasFetchedApps: hasFetched(state), webviewContext: getWebviewContext(state) }) diff --git a/src/components/Claudy.jsx b/src/components/Claudy.jsx deleted file mode 100644 index eed43a9c4..000000000 --- a/src/components/Claudy.jsx +++ /dev/null @@ -1,83 +0,0 @@ -import React, { Component } from 'react' -import { getIntents } from 'lib/stack' -import ClaudyIcon from './ClaudyIcon' -import Icon from 'cozy-ui/transpiled/react/Icon' - -class Claudy extends Component { - constructor(props, context) { - super(props) - this.store = context.barStore - this.state = { - isLoading: false, - isActive: false - } - this.intents = getIntents() - } - - UNSAFE_componentWillReceiveProps(nextProps) { - if (nextProps.claudyFired) this.toggle() - } - - toggle = () => { - if (!this.props.opened && !this.intentWrapperRef.childNodes.length) { - this.setState({ isLoading: true }) - // init Claudy intent - this.intents - .create('CLAUDY', 'io.cozy.settings', { - exposeIntentFrameRemoval: true - }) - .start(this.intentWrapperRef, () => { - this.setState({ isLoading: false, isActive: true }) - this.props.onToggle() // toggle claudy when the intent is loaded - }) - .then(({ removeIntentIframe }) => { - // exposeFrameRemoval intent event - // remove the intent frame at the end of the menu closing transition - const closedListener = e => { - if (e.propertyName === 'transform') { - removeIntentIframe() - this.setState({ isActive: false }) - e.target.removeEventListener('transitionend', closedListener) - } - } - this.intentWrapperRef.addEventListener( - 'transitionend', - closedListener, - false - ) - this.props.onToggle() - }) - } else { - this.setState({ isActive: !this.state.isActive }) - this.props.onToggle() - } - } - - render() { - const { opened } = this.props - const { isLoading, isActive } = this.state - return ( -
- -
{ - this.intentWrapperRef = wrapper - }} - /> -
- ) - } -} - -export default Claudy diff --git a/src/components/ClaudyIcon.jsx b/src/components/ClaudyIcon.jsx deleted file mode 100644 index 68dc6f6f7..000000000 --- a/src/components/ClaudyIcon.jsx +++ /dev/null @@ -1,18 +0,0 @@ -import React from 'react' - -function SvgIconClaudy(props) { - return ( - - - - - ) -} - -export default SvgIconClaudy diff --git a/src/components/Drawer.jsx b/src/components/Drawer.jsx index 237488981..523f12379 100644 --- a/src/components/Drawer.jsx +++ b/src/components/Drawer.jsx @@ -163,14 +163,7 @@ class Drawer extends Component { } render() { - const { - onClaudy, - visible, - isClaudyLoading, - settingsAppURL, - storageData, - isInvertedTheme - } = this.props + const { visible, settingsAppURL, storageData, isInvertedTheme } = this.props return (
@@ -212,8 +203,6 @@ Drawer.propTypes = { visible: PropTypes.bool, onClose: PropTypes.func, onLogOut: PropTypes.func, - onClaudy: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]), - isClaudyLoading: PropTypes.bool, isInvertedTheme: PropTypes.bool, storageData: PropTypes.object, settingsAppURL: PropTypes.string, diff --git a/src/components/Settings/SettingsContent.jsx b/src/components/Settings/SettingsContent.jsx index f878269ee..3da0a0102 100644 --- a/src/components/Settings/SettingsContent.jsx +++ b/src/components/Settings/SettingsContent.jsx @@ -7,7 +7,6 @@ import { isMobileApp } from 'cozy-device-helper' import { translate } from 'cozy-ui/transpiled/react/I18n' import Icon from 'cozy-ui/transpiled/react/Icon' import OpenwithIcon from 'cozy-ui/transpiled/react/Icons/Openwith' -import CloudIcon from 'cozy-ui/transpiled/react/Icons/Cloud' import PeopleIcon from 'cozy-ui/transpiled/react/Icons/People' import GraphCircleIcon from 'cozy-ui/transpiled/react/Icons/GraphCircle' import CozyCircleIcon from 'cozy-ui/transpiled/react/Icons/CozyCircle' @@ -47,9 +46,7 @@ const SettingsContent = ({ onLogOut, settingsAppURL, storageData, - onClaudy, isDrawer = false, - isClaudyLoading, shoulDisplayViewOfferButton, managerUrlPremiumLink }) => ( @@ -135,21 +132,6 @@ const SettingsContent = ({ - {isDrawer && onClaudy && !isMobileApp() && ( - - - - - - )} {!isMobileApp() && ( <> @@ -203,8 +185,6 @@ SettingsContent.propTypes = { onLogOut: PropTypes.func.isRequired, settingsAppURL: PropTypes.string, storageData: PropTypes.object, - onClaudy: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]), - isDrawer: PropTypes.bool, - isClaudyLoading: PropTypes.bool + isDrawer: PropTypes.bool } export default translate()(SettingsContent) diff --git a/src/components/__snapshots__/Bar.spec.jsx.snap b/src/components/__snapshots__/Bar.spec.jsx.snap index 8bb9f2df5..f9f6e6c39 100644 --- a/src/components/__snapshots__/Bar.spec.jsx.snap +++ b/src/components/__snapshots__/Bar.spec.jsx.snap @@ -41,8 +41,6 @@ exports[`Bar should change allow theme overrides 1`] = ` @@ -87,8 +85,6 @@ exports[`Bar should change theme 1`] = ` @@ -110,7 +106,6 @@ Object { "barLeft": undefined, "barRight": undefined, "barSearch": undefined, - "claudyEnabled": false, "hasFetchedApps": false, "isDrive": false, "theme": "default", diff --git a/src/config/claudyActions.json b/src/config/claudyActions.json deleted file mode 100644 index d0c508b91..000000000 --- a/src/config/claudyActions.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "desktop": { - "icon": "icon-laptop.svg", - "link": { - "type": "external" - } - }, - "mobile": { - "icon": "icon-phone.svg", - "link": { - "type": "external" - } - }, - "support": { - "icon": "icon-question-mark.svg", - "link": { - "type": "external" - } - } -} \ No newline at end of file diff --git a/src/lib/reducers/context.js b/src/lib/reducers/context.js index 0be5ea4bb..ccae95a00 100644 --- a/src/lib/reducers/context.js +++ b/src/lib/reducers/context.js @@ -1,7 +1,5 @@ import stack from 'lib/stack' -import CLAUDY_ACTIONS from 'config/claudyActions.json' import { LOG_OUT } from 'lib/reducers/settings' -import flag from 'cozy-flags' const FETCH_CONTEXT = 'FETCH_CONTEXT' const FETCH_CONTEXT_SUCCESS = 'FETCH_CONTEXT_SUCCESS' @@ -12,14 +10,6 @@ export const getHelpLink = state => { return state.helpLink } -export const getClaudyActions = state => { - return state.claudyActions -} -export const shouldEnableClaudy = state => { - const claudyActions = getClaudyActions(state) - return !!claudyActions && !!claudyActions.length -} - // actions export const fetchContext = () => async (dispatch, getState) => { dispatch({ type: FETCH_CONTEXT }) @@ -41,7 +31,6 @@ export const fetchContext = () => async (dispatch, getState) => { // reducers const defaultState = { - claudyActions: [], contextNotExist: false, helpLink: null, isFetching: false @@ -54,22 +43,9 @@ const reducer = (state = defaultState, action) => { case FETCH_CONTEXT_SUCCESS: { const attr = action.context && action.context.data && action.context.data.attributes - const contextActions = flag('bar.claudy.force-all-actions') - ? Object.keys(CLAUDY_ACTIONS) - : attr && attr['claudy_actions'] - // get an arrays of action - const claudyActions = contextActions - .map(slug => { - if (CLAUDY_ACTIONS.hasOwnProperty(slug)) { - // adding also the action slug - return Object.assign({}, CLAUDY_ACTIONS[slug], { slug }) - } - }) - .filter(action => action) return { ...state, helpLink: (attr && attr['help_link']) || null, - claudyActions, isFetching: false, contextNotExist: false } diff --git a/src/lib/reducers/index.js b/src/lib/reducers/index.js index 204ec036a..a277c99b2 100644 --- a/src/lib/reducers/index.js +++ b/src/lib/reducers/index.js @@ -49,8 +49,6 @@ export const getSettingsAppURL = proxy('settings', settings.getSettingsAppURL) export const isSettingsBusy = proxy('settings', settings.isSettingsBusy) export const isFetchingSettings = proxy('settings', settings.isFetchingSettings) export const getHelpLink = proxy('context', context.getHelpLink) -export const getClaudyActions = proxy('context', context.getClaudyActions) -export const shouldEnableClaudy = proxy('context', context.shouldEnableClaudy) export const getWebviewContext = proxy( 'unserializable', unserializable.getWebviewContext diff --git a/src/locales/de.json b/src/locales/de.json index 6e5843d43..0946108f6 100644 --- a/src/locales/de.json +++ b/src/locales/de.json @@ -25,9 +25,6 @@ "ptnb": "expPTNB", "others": "Andere Anwendungen" }, - "claudy": { - "title": "Wie willst du dein Cozy steuern?" - }, "permsModal": { "title": "Greife von deiner Anwendung aus auf dein komplettes Cozy zu", "description": "Erlaube %{app} den Zugriff auf deine Cozy Anwendungen auf diesem Gerät", diff --git a/src/locales/en.json b/src/locales/en.json index 95012dd80..2d89c5453 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -27,9 +27,6 @@ "ptnb": "expPTNB", "others": "Other apps" }, - "claudy": { - "title": "How to drive your Cozy?" - }, "permsModal": { "title": "Access your whole Cozy from your application", "description": "Authorize %{app} to display your Cozy applications on this device", diff --git a/src/locales/es.json b/src/locales/es.json index deca80bf2..0ba2492e8 100644 --- a/src/locales/es.json +++ b/src/locales/es.json @@ -25,9 +25,6 @@ "ptnb": "expPTNB", "others": "Otras aplicaciones" }, - "claudy": { - "title": "¿Cómo utilizar su Cozy?" - }, "permsModal": { "title": "Acceder a su Cozy desde su aplicación", "description": "Autorizar a %{app} para mostrar sus aplicaciones Cozy en este aparato", diff --git a/src/locales/fr.json b/src/locales/fr.json index f69bf1c8e..7b2e52cbe 100644 --- a/src/locales/fr.json +++ b/src/locales/fr.json @@ -27,9 +27,6 @@ "ptnb": "Expérimentation Carnet du logement", "others": "Autres apps" }, - "claudy": { - "title": "Comment utiliser votre Cozy ?" - }, "permsModal": { "title": "Accéder à ton Cozy à partir de ton application", "description": "Autoriser %{app} à afficher les applications de ton Cozy sur cet appareil", diff --git a/src/locales/it.json b/src/locales/it.json index 93867f151..6b786bb25 100644 --- a/src/locales/it.json +++ b/src/locales/it.json @@ -25,9 +25,6 @@ "ptnb": "expPTNB", "others": "Altre app" }, - "claudy": { - "title": "Come usare il tuo Cozy?" - }, "permsModal": { "title": "Accedi al tuo Cozy dalla tua applicazione", "description": "Autorizza %{app} a mostrare le applicazioni del tuo Cozy su questo dispositivo", diff --git a/src/locales/ja.json b/src/locales/ja.json index 7651d6ed2..4912d6db3 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -25,9 +25,6 @@ "ptnb": "expPTNB", "others": "他のアプリ" }, - "claudy": { - "title": "Cozy をドライブする方法は?" - }, "permsModal": { "title": "お使いのアプリケーションから Cozy 全体にアクセス", "description": "%{app} を承認して、このデバイスにお使いの Cozy アプリケーションを表示します", diff --git a/src/locales/nl_NL.json b/src/locales/nl_NL.json index d168db345..8e7c80360 100644 --- a/src/locales/nl_NL.json +++ b/src/locales/nl_NL.json @@ -25,9 +25,6 @@ "ptnb": "expPTNB", "others": "Overige apps" }, - "claudy": { - "title": "How beheers je je Cozy?" - }, "permsModal": { "title": "Toegang tot je gehele Cozy vanuit je app", "description": "%{app} machtigen om je Cozy-apps te tonen op dit apparaat", diff --git a/src/locales/pl.json b/src/locales/pl.json index 916d59011..e7414a63b 100644 --- a/src/locales/pl.json +++ b/src/locales/pl.json @@ -25,9 +25,6 @@ "ptnb": "expPTNB", "others": "Aplikacje inne" }, - "claudy": { - "title": "Jak korzystać z Twojego Cozy?" - }, "permsModal": { "title": "Uzyskaj dostęp do swojego Cozy z dowolnej aplikacji.", "description": "Autoryzuj %{app} aby korzystać z aplikacji Cozy na tym urządzeniu", diff --git a/src/locales/ru.json b/src/locales/ru.json index 39229980a..0fb26d9ac 100644 --- a/src/locales/ru.json +++ b/src/locales/ru.json @@ -25,9 +25,6 @@ "ptnb": "expPTNB", "others": "Другие приложения" }, - "claudy": { - "title": "Как найти ваш Cozy?" - }, "permsModal": { "title": "Получите доступ ко всем функциям Cozy из приложения", "description": "Авторизация %{app} для отображения приложений Cozy на этом устройстве", diff --git a/src/locales/sq.json b/src/locales/sq.json index 3a7a54571..451ca2fbb 100644 --- a/src/locales/sq.json +++ b/src/locales/sq.json @@ -25,9 +25,6 @@ "ptnb": "expPTNB", "others": "Aplikacione të tjerë" }, - "claudy": { - "title": "How to drive your Cozy?" - }, "permsModal": { "title": "Hyni në krejt Cozy-n nga aplikacioni juaj", "description": "Autorizojeni %{app} të shfaqë në këtë pajisje aplikacionet tuaja Cozy", diff --git a/src/locales/zh_CN.json b/src/locales/zh_CN.json index b15e98eca..08a72c786 100644 --- a/src/locales/zh_CN.json +++ b/src/locales/zh_CN.json @@ -25,9 +25,6 @@ "ptnb": "expPTNB", "others": "其他应用" }, - "claudy": { - "title": "如何驱动您的Cozy?" - }, "permsModal": { "title": "从您的应用程序访问整个Cozy", "description": "授权%{app}在此设备上显示您的Cozy应用程序", diff --git a/src/styles/claudy.css b/src/styles/claudy.css deleted file mode 100644 index 72a2a4e85..000000000 --- a/src/styles/claudy.css +++ /dev/null @@ -1,98 +0,0 @@ -[role=banner] .coz-claudy { - position: fixed; - bottom: 5em; - right: 2em; -} - -@media (min-width: 64em) { - [role=banner] .coz-claudy { - bottom: 2em; - } -} - -[role=banner] .coz-claudy-icon { - width: 3.5em; - height: 3.5em; - border-radius: 100%; - border: none; - background-color: var(--dodgerBlue); - box-shadow: 0 1px 3px 0 rgba(50, 54, 63, 0.19), 0 6px 18px 0 rgba(50, 54, 63, 0.39); - animation: none; - cursor: pointer; - opacity: .5; - transition: all .2s ease-out; - outline: 0; - display: flex; - justify-content: center; - align-items: center; -} - -[role=banner] .coz-claudy-icon:hover, -[role=banner] .coz-claudy-icon:focus, -[role=banner] .coz-claudy-icon:active, -[role=banner] .coz-claudy [data-claudy-opened=true] { - animation: none; - transform: scale(1.1); - opacity: 1; - transition: all .2s ease-out; -} - -[role=banner] .coz-claudy .coz-claudy-intent-wrapper { - position: fixed; - bottom: 9.5em; - right: 2em; - width: 25em; - border-radius: .3em; - background: white; - transform-origin: 100% 100% 0; - transform: scale(0) translateY(6em); - filter: drop-shadow(0 4px 6px rgba(50, 54, 63, 0.5)); - opacity: 0; - transition: .2s transform ease-in, .1s opacity ease-in; -} - -[role=banner] .coz-claudy--opened .coz-claudy-intent-wrapper { - transform: scale(1) translateY(0); - opacity: 1; - transition: .2s transform cubic-bezier(0.2, 0.75, 0.3, 1.15), .1s opacity ease-in; -} - -[role=banner] .coz-claudy-intent-wrapper::after { - position: fixed; - content: ''; - right: 3em; - width: 0; - height: 0; - /* Make it a bit taller to avoid browser spacing issue - between it and the tooltip */ - border-bottom: .8em solid transparent; - border-right: 1.5em solid white; - bottom: -.6em; -} - -[role=banner] .coz-claudy .coz-claudy-intent-wrapper .coz-intent{ - width: 100%; - height: 100%; - border: none; - border-radius: .3em; -} - -@media (min-width: 64em) { - [role=banner] .coz-claudy .coz-claudy-intent-wrapper { - bottom: 6.5em; - } -} - -@media (max-width: 48em) { - [role=banner] .coz-claudy .coz-claudy-intent-wrapper { - width: calc(100% - 2em); - height: calc(100% - 2em)!important; /* overwritte intent setSize here */ - right: 1em; - top: 1em; - transform-origin: 50% 50% 0; - } - - [role=banner] .coz-claudy-intent-wrapper::after { - display: none; - } -} diff --git a/src/styles/index.styl b/src/styles/index.styl index f741709da..55749402b 100644 --- a/src/styles/index.styl +++ b/src/styles/index.styl @@ -8,7 +8,6 @@ @import './settings.css' @import './storage.css' @import './drawer.css' -@import './claudy.css' @import './theme.styl' diff --git a/src/styles/indicators.css b/src/styles/indicators.css index acd07cae0..c722ee3bc 100644 --- a/src/styles/indicators.css +++ b/src/styles/indicators.css @@ -40,19 +40,3 @@ font-size: .875em; color: var(--pomegranate); } - -/* Claudy loading */ -[role=banner] .coz-claudy [data-claudy-loading=true]::before { - position: absolute; - content: ''; - width: 100%; - height: 100%; - bottom: 0; - right: 0; - background: none; - border-radius: 100%; - border: .2em solid var(--scienceBlue); - border-right: .2em solid white; - box-sizing: border-box; - animation: 1s linear infinite spin; -}