Skip to content

Commit

Permalink
publish: Add Ubuntu 24.04 cozy-stack packages
Browse files Browse the repository at this point in the history
generated from commit b2d4b2f
  • Loading branch information
Travis CI User committed Jul 12, 2024
1 parent 6e7dd3c commit 960fe82
Show file tree
Hide file tree
Showing 25 changed files with 763 additions and 759 deletions.
102 changes: 38 additions & 64 deletions en/cozy-flags/CHANGELOG/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion en/cozy-flags/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cozy-flags",
"version": "3.2.2",
"version": "4.0.0",
"description": "Flag library used in Cozy",
"main": "dist/index.js",
"browser": "dist/index.browser.js",
Expand Down
15 changes: 9 additions & 6 deletions en/cozy-flags/src/flag.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@ const store = new FlagStore()

/**
* Public API to use flags
* @template T
* @param {string} key - The flag key to get or set.
* @param {T} [value] - The value to set for the flag key. If not provided, the function will return the value of the key.
* @returns {T} The value of the flag key when getting, or the set value when setting.
*/
const flag = function () {
const args = [].slice.call(arguments)
if (args.length === 1) {
return store.get(args[0])
const flag = function (key, value) {
if (arguments.length === 1) {
return store.get(key)
} else {
store.set(args[0], args[1])
return args[1]
store.set(key, value)
return value
}
}

Expand Down
2 changes: 1 addition & 1 deletion en/cozy-home/manifest.webapp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"name": "Cozy Cloud",
"url": "https://cozy.io"
},
"version": "1.78.0",
"version": "1.79.0",
"licence": "AGPL-3.0",
"permissions": {
"home": {
Expand Down
13 changes: 1 addition & 12 deletions en/cozy-home/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cozy-home",
"version": "1.78.0",
"version": "1.79.0",
"main": "src/index.jsx",
"scripts": {
"tx": "tx pull --all || true",
Expand Down Expand Up @@ -89,7 +89,6 @@
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-import-alias": "^1.2.0",
"git-directory-deploy": "1.5.1",
"husky": "1.3.1",
"ignore-not-found-export-webpack-plugin": "1.0.2",
"jest": "28.1.3",
"jest-environment-jsdom": "28.1.3",
Expand All @@ -103,15 +102,5 @@
"stylint": "2.0.0",
"stylus": "0.55.0",
"url-search-params-polyfill": "8.1.1"
},
"lint-staged": {
"{src,test}/**/*.{js,jsx}": [
"eslint"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
}
}
49 changes: 49 additions & 0 deletions en/cozy-home/src/assets/images/default-wallpaper.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions en/cozy-home/src/components/AddServiceTile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ import AppLinker from 'cozy-ui/transpiled/react/AppLinker'

import SquareAppIcon from 'cozy-ui/transpiled/react/SquareAppIcon'

/**
* AddServiceTile component.
*
* @param {Object} props - The component props.
* @param {string} props.label - The label for the service tile.
* @param {string} [props.category] - The category of the service tile.
* @returns {JSX.Element} The rendered AddServiceTile component.
*/
const AddServiceTile = ({ label, category }) => {
const client = useClient()
const nativePath = `/discover/?type=konnector${
Expand Down
11 changes: 10 additions & 1 deletion en/cozy-home/src/components/AnimatedWrapper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { isFlagshipApp } from 'cozy-device-helper'
import homeConfig from 'config/home.json'
import { useOpenApp } from 'hooks/useOpenApp'
import { RemoveScroll } from 'react-remove-scroll'
import { useWallpaperContext } from 'hooks/useWallpaperContext'
import cx from 'classnames'

import App from 'containers/App'

Expand All @@ -16,6 +18,9 @@ const RemoveScrollOnFlaghsip = ({ children }) => {

const AnimatedWrapper = () => {
const { getAppState } = useOpenApp()
const {
data: { isCustomWallpaper }
} = useWallpaperContext()

const mainStyle = isFlagshipApp()
? {
Expand All @@ -27,7 +32,11 @@ const AnimatedWrapper = () => {
return (
<RemoveScrollOnFlaghsip>
<div
className={`App ${getAppState} u-flex u-flex-column u-w-100 u-miw-100 u-flex-items-center`}
className={cx(
`App u-flex u-flex-column u-w-100 u-miw-100 u-flex-items-center`,
{ [getAppState]: !!getAppState },
{ 'custom-wallpaper': isCustomWallpaper }
)}
style={mainStyle}
>
<App {...homeConfig} />
Expand Down
24 changes: 17 additions & 7 deletions en/cozy-home/src/components/AppWrapper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@ import CozyTheme from 'cozy-ui/transpiled/react/providers/CozyTheme'
import { BreakpointsProvider } from 'cozy-ui/transpiled/react/providers/Breakpoints'
import { PersistGate } from 'redux-persist/integration/react'
import AlertProvider from 'cozy-ui/transpiled/react/providers/Alert'
import { useCozyTheme } from 'cozy-ui/transpiled/react/providers/CozyTheme'

import configureStore from 'store/configureStore'
import { RealtimePlugin } from 'cozy-realtime'
// import { isFlagshipApp } from 'cozy-device-helper'

import { usePreferedTheme } from 'hooks/usePreferedTheme'
import { useWallpaperContext } from 'hooks/useWallpaperContext'

import schema from '../schema'
import { ConditionalWrapper } from './ConditionalWrapper'
import { CustomWallPaperProvider } from 'hooks/useCustomWallpaperContext'
import { WallPaperProvider } from 'hooks/useWallpaperContext'
import { SectionsProvider } from './Sections/SectionsContext'
const dictRequire = lang => require(`locales/${lang}.json`)

Expand Down Expand Up @@ -73,11 +74,20 @@ const Inner = ({ children, lang, context }) => (
)

const ThemeProvider = ({ children }) => {
const preferedTheme = usePreferedTheme()
const {
data: { isCustomWallpaper }
} = useWallpaperContext()
const { type } = useCozyTheme()

const variant = isCustomWallpaper
? type === 'light'
? 'inverted'
: 'normal'
: 'normal'

return (
<CozyTheme
variant={preferedTheme}
variant={variant}
className="u-flex u-flex-column u-w-100 u-miw-100 u-flex-items-center"
>
{children}
Expand All @@ -97,8 +107,8 @@ const AppWrapper = ({ children }) => {
<AppContext.Provider value={appContext}>
<BreakpointsProvider>
<CozyProvider client={cozyClient}>
<CustomWallPaperProvider>
<CozyTheme ignoreItself>
<WallPaperProvider>
<CozyTheme>
<ThemeProvider>
<AlertProvider>
<ReduxProvider store={store}>
Expand All @@ -118,7 +128,7 @@ const AppWrapper = ({ children }) => {
</AlertProvider>
</ThemeProvider>
</CozyTheme>
</CustomWallPaperProvider>
</WallPaperProvider>
</CozyProvider>
</BreakpointsProvider>
</AppContext.Provider>
Expand Down
11 changes: 4 additions & 7 deletions en/cozy-home/src/components/AppWrapper.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import AppWrapper, { setupAppContext } from './AppWrapper'
import { render } from '@testing-library/react'
import React from 'react'
import AppLike from 'test/AppLike'
import { CustomWallPaperProvider } from 'hooks/useCustomWallpaperContext'
import { WallPaperProvider } from 'hooks/useWallpaperContext'
import { act } from 'react-dom/test-utils'

const mockClient = {
Expand Down Expand Up @@ -44,9 +44,6 @@ jest.mock('redux-persist/integration/react', () => ({
}))
const AddButtonMock = () => <></>
jest.mock('./AddButton/AddButton', () => AddButtonMock)
jest.mock('hooks/usePreferedTheme', () => ({
usePreferedTheme: jest.fn().mockReturnValue('inverted')
}))

describe('AppWrapper.jsx', () => {
beforeEach(() => {
Expand Down Expand Up @@ -80,9 +77,9 @@ describe('AppWrapper.jsx', () => {
// When
const { getByText } = render(
<AppLike>
<CustomWallPaperProvider>
<WallPaperProvider>
<AppWrapper>children</AppWrapper>
</CustomWallPaperProvider>
</WallPaperProvider>
</AppLike>
)
await act(async () => {})
Expand All @@ -99,7 +96,7 @@ describe('AppWrapper.jsx', () => {
// When
const { getAllByTestId } = render(
<AppWrapper>
<CustomWallPaperProvider>children </CustomWallPaperProvider>
<WallPaperProvider>children</WallPaperProvider>
</AppWrapper>
)
await act(async () => {})
Expand Down
48 changes: 18 additions & 30 deletions en/cozy-home/src/components/BackgroundContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,42 +1,30 @@
import React from 'react'
import cx from 'classnames'

import { useCustomWallpaperContext } from 'hooks/useCustomWallpaperContext'
import { getHomeThemeCssVariable } from 'hooks/usePreferedTheme'

type BackgroundContainerComputedProps = {
className: string
style?: { backgroundImage: string }
}

const makeProps = (
backgroundURL: string | null,
isCustomWallpaper: boolean,
binaryCustomWallpaper: string | null
): BackgroundContainerComputedProps => ({
className: cx('background-container', {
'background-container-darken':
isCustomWallpaper || getHomeThemeCssVariable() !== 'normal',
'home-default-partner-background':
!isCustomWallpaper && getHomeThemeCssVariable() === 'normal'
}),
...(binaryCustomWallpaper && {
style: { backgroundImage: `url(${binaryCustomWallpaper})` }
}),
...(!binaryCustomWallpaper &&
backgroundURL && {
style: { backgroundImage: `url(${backgroundURL})` }
})
})
import { useWallpaperContext } from 'hooks/useWallpaperContext'
import { useCozyTheme } from 'cozy-ui/transpiled/react/providers/CozyTheme'

export const BackgroundContainer = (): JSX.Element => {
const {
data: { wallpaperLink, binaryCustomWallpaper, isCustomWallpaper }
} = useCustomWallpaperContext()
data: { binaryCustomWallpaper, isCustomWallpaper }
} = useWallpaperContext()
const { type } = useCozyTheme()

return (
<div
{...makeProps(wallpaperLink, isCustomWallpaper, binaryCustomWallpaper)}
className={cx(
'home-background-container',
`home-background-container--${type}`,
{
'home-default-background': !isCustomWallpaper,
'home-custom-background': isCustomWallpaper
}
)}
style={
binaryCustomWallpaper
? { backgroundImage: `url(${binaryCustomWallpaper})` }
: undefined
}
>
<div></div>
<div></div>
Expand Down
56 changes: 56 additions & 0 deletions en/cozy-home/src/components/Sections/GroupedSectionTile.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import React from 'react'
import { useNavigate } from 'react-router-dom'

import SquareAppIcon from 'cozy-ui/transpiled/react/SquareAppIcon'
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'

import SectionAppGroup from 'components/Sections/SectionAppGroup'
import { get4FirstItems } from 'components/Sections/utils'
import { GroupedSectionTileProps } from 'components/Sections/SectionsTypes'

const GroupedSectionTile = ({
section
}: GroupedSectionTileProps): JSX.Element | null => {
const navigate = useNavigate()
const { t } = useI18n()

const handleNavigation = (
name: string,
type: 'konnectors' | 'shortcuts'
): void => {
navigate(`categories/${type}/${name}`)
}

// We add a failsafe in the view to avoid rendering an empty section
// This case appeared in prod environment but wasn't expected to be possible
if (section.items.length === 0) return null

return (
<a
key={section.id}
onClick={(): void =>
handleNavigation(
section.id,
section.type === 'category' ? 'konnectors' : 'shortcuts'
)
}
className="scale-hover u-c-pointer"
>
<SquareAppIcon
name={
section.type === 'category'
? t(`category.${section.name}`)
: section.name
}
IconContent={<SectionAppGroup items={get4FirstItems(section)} />}
variant={section.pristine ? 'ghost' : 'normal'}
style={{
alignItems: 'flex-start',
justifyContent: 'flex-start'
}}
/>
</a>
)
}

export default GroupedSectionTile
Loading

0 comments on commit 960fe82

Please sign in to comment.