Skip to content
Snippets Groups Projects
Commit 1fbe2378 authored by Romain CREY's avatar Romain CREY
Browse files

modal connect + all doctype names change

parent 8b4f7b9d
Branches
Tags
2 merge requests!32Dev,!30Features/us158 review design
Showing
with 112 additions and 183 deletions
......@@ -34,15 +34,15 @@
},
"enedis": {
"description": "Utilisé pour partager vos données Enedis",
"type": "io.enedis.*"
"type": "com.grandlyon.enedis.*"
},
"grdf": {
"description": "Utilisé pour partager vos données GRDF",
"type": "io.grdf.*"
"type": "com.grandlyon.grdf.*"
},
"egl": {
"description": "Utilisé pour partager vos données EGL",
"type": "io.egl.*"
"type": "com.grandlyon.egl.*"
},
"accounts": {
"description": "Utilisé pour obtenir les données du compte",
......@@ -62,7 +62,7 @@
},
"ecolyo": {
"description": "Utilisé pour partager vos données Ecolyo.",
"type": "io.ecolyo.*"
"type": "com.grandlyon.ecolyo.*"
}
}
}
<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 10C0 4.47715 4.47715 0 10 0H38C43.5229 0 48 4.47715 48 10V38C48 43.5229 43.5228 48 38 48H0V10Z" fill="black"/>
<path d="M0 21V28H9V30C9 36.6274 14.3726 42 21 42H47.1679C47.7031 40.775 48 39.4222 48 38V35H21C18.2386 35 16 32.7615 16 30V28H33C36.3137 28 39 25.3137 39 22V12C39 8.68628 36.3137 6 33 6H15C11.6863 6 9 8.68628 9 12V19H16V16C16 14.3431 17.3431 13 19 13H29C30.6569 13 32 14.3431 32 16V18C32 19.6569 30.6569 21 29 21H0Z" fill="#F1C017"/>
<path d="M10 0C4.47715 0 0 4.47715 0 10V21H29C30.6569 21 32 19.6569 32 18V16C32 14.3431 30.6569 13 29 13H19C17.3431 13 16 14.3431 16 16V19H9V12C9 8.68628 11.6863 6 15 6H33C36.3137 6 39 8.68628 39 12V22C39 25.3137 36.3137 28 33 28H16V30C16 32.7615 18.2386 35 21 35H48V10C48 4.47715 43.5229 0 38 0H10Z" fill="black"/>
<path d="M47.2141 41.8925C47.1989 41.9284 47.1835 41.9643 47.1679 42H21C14.3726 42 9 36.6274 9 30V28H0V48H38C42.1421 48 45.6961 45.4816 47.2141 41.8925Z" fill="black"/>
</svg>
......@@ -78,20 +78,20 @@ const KonnectorLaunch: React.FC<KonnectorLaunchProps> = ({
}, [])
return (
<div className="klaunch-content">
{!state ? (
<>
<Lottie options={loadingOptions} height={50} width={50} />
<div className="klaunch-content-text klaunch-content-text-center text-16-normal">
<div>{t('KONNECTORCONFIG.PLZ_WAIT')}</div>
</div>
<div className="klaunch-content-text text-16-normal">
<div>{t('KONNECTORCONFIG.LOADING_DATA')}</div>
</div>
</>
) : (
<>
<Modal open={openModal} handleCloseClick={handleCloseClick} border>
<Modal open={openModal} handleCloseClick={handleCloseClick} border>
<div className="klaunch-content">
{!state ? (
<>
<Lottie options={loadingOptions} height={50} width={50} speed={2} />
<div className="klaunch-content-text klaunch-content-text-center text-16-normal">
<div>{t('KONNECTORCONFIG.PLZ_WAIT')}</div>
</div>
<div className="klaunch-content-text text-16-normal">
<div>{t('KONNECTORCONFIG.LOADING_DATA')}</div>
</div>
</>
) : (
<>
<div className="klaunch-info-txt">
{state === ERROR_EVENT
? t('KONNECTORCONFIG.ERROR_DATA')
......@@ -100,10 +100,10 @@ const KonnectorLaunch: React.FC<KonnectorLaunchProps> = ({
<div>{t('KONNECTORCONFIG.OK')}</div>
</StyledButton>
</div>
</Modal>
</>
)}
</div>
</>
)}
</div>
</Modal>
)
}
......
......@@ -14,7 +14,7 @@ const Test: React.FC<TestProps> = ({ client }: TestProps) => {
async function loadData() {
const data = await client.query(
client
.find('io.ecolyo.challengetype')
.find('com.grandlyon.ecolyo.challengetype')
.where({ level: { $lte: 0 } })
.include(['availableEcogestures'])
.limitBy(20)
......@@ -27,7 +27,7 @@ const Test: React.FC<TestProps> = ({ client }: TestProps) => {
async function loadUserChallenge() {
const data = await client.query(
client
.find('io.ecolyo.userchallenge')
.find('com.grandlyon.ecolyo.userchallenge')
.where({ state: { $eq: 0 } })
.include(['selectedEcogestures', 'challengeType'])
.limitBy(1)
......@@ -71,9 +71,9 @@ const Test: React.FC<TestProps> = ({ client }: TestProps) => {
challenge en cours - challenge type:
{userChallenge &&
userChallenge.included.map((item, index) => {
if (item._type === 'io.ecolyo.challengetype') {
if (item._type === 'com.grandlyon.ecolyo.challengetype') {
return <ul key={index}>Challenge Type : {item.title}</ul>
} else if (item._type === 'io.ecolyo.ecogesture') {
} else if (item._type === 'com.grandlyon.ecolyo.ecogesture') {
return <ul key={index}>Ecogeste : {item.shortName}</ul>
}
})}
......
......@@ -10,8 +10,8 @@
"relationships": {
"availableEcogestures": {
"data": [
{ "_id": "0085", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0092", "_type": "io.ecolyo.ecogesture" }
{ "_id": "0085", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0092", "_type": "com.grandlyon.ecolyo.ecogesture" }
]
}
}
......@@ -27,20 +27,20 @@
"relationships": {
"availableEcogestures": {
"data": [
{ "_id": "0032", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0034", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0041", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0042", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0043", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0045", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0050", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0058", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0064", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0066", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0071", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0078", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0082", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0093", "_type": "io.ecolyo.ecogesture" }
{ "_id": "0032", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0034", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0041", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0042", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0043", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0045", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0050", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0058", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0064", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0066", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0071", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0078", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0082", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0093", "_type": "com.grandlyon.ecolyo.ecogesture" }
]
}
}
......@@ -56,20 +56,20 @@
"relationships": {
"availableEcogestures": {
"data": [
{ "_id": "0032", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0034", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0041", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0042", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0043", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0045", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0050", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0058", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0064", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0066", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0071", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0078", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0082", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0093", "_type": "io.ecolyo.ecogesture" }
{ "_id": "0032", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0034", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0041", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0042", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0043", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0045", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0050", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0058", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0064", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0066", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0071", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0078", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0082", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0093", "_type": "com.grandlyon.ecolyo.ecogesture" }
]
}
}
......@@ -85,20 +85,20 @@
"relationships": {
"availableEcogestures": {
"data": [
{ "_id": "0032", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0034", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0041", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0042", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0043", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0045", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0050", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0058", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0064", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0066", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0071", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0078", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0082", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0093", "_type": "io.ecolyo.ecogesture" }
{ "_id": "0032", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0034", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0041", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0042", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0043", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0045", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0050", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0058", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0064", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0066", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0071", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0078", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0082", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0093", "_type": "com.grandlyon.ecolyo.ecogesture" }
]
}
}
......@@ -114,20 +114,20 @@
"relationships": {
"availableEcogestures": {
"data": [
{ "_id": "0032", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0034", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0041", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0042", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0043", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0045", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0050", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0058", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0064", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0066", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0071", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0078", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0082", "_type": "io.ecolyo.ecogesture" },
{ "_id": "0093", "_type": "io.ecolyo.ecogesture" }
{ "_id": "0032", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0034", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0041", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0042", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0043", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0045", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0050", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0058", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0064", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0066", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0071", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0078", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0082", "_type": "com.grandlyon.ecolyo.ecogesture" },
{ "_id": "0093", "_type": "com.grandlyon.ecolyo.ecogesture" }
]
}
}
......
......@@ -9,18 +9,18 @@
"challengeType": {
"data": {
"_id": "CHA00000001",
"_type": "io.ecolyo.challengetype"
"_type": "com.grandlyon.ecolyo.challengetype"
}
},
"selectedEcogestures": {
"data": [
{
"_id": "0085",
"_type": "io.ecolyo.ecogesture"
"_type": "com.grandlyon.ecolyo.ecogesture"
},
{
"_id": "0092",
"_type": "io.ecolyo.ecogesture"
"_type": "com.grandlyon.ecolyo.ecogesture"
}
]
}
......
import { ENEDIS_DAY_DOCTYPE } from './io-enedis-day'
import { GRDF_DAY_DOCTYPE } from './io-grdf-day'
import { EGL_DAY_DOCTYPE } from './io-egl-day'
import { ENEDIS_DAY_DOCTYPE } from './com-grandlyon-enedis-day'
import { GRDF_DAY_DOCTYPE } from './com-grandlyon-grdf-day'
import { EGL_DAY_DOCTYPE } from './com-grandlyon-egl-day'
import { KONNECTORS_DOCTYPE } from './io-cozy-konnectors'
import { ACCOUNTS_DOCTYPE } from './io-cozy-accounts'
import { JOBS_DOCTYPE } from './io-cozy-jobs'
import { CHALLENGETYPE_DOCTYPE } from './io-ecolyo-challengetype'
import { USERCHALLENGE_DOCTYPE } from './io-ecolyo-userchallenge'
import { ECOGESTURE_DOCTYPE } from './io-ecolyo-ecogesture'
import { USERPROFILE_DOCTYPE } from './io-ecolyo-userprofile'
import { CHALLENGETYPE_DOCTYPE } from './com-grandlyon-ecolyo-challengetype'
import { USERCHALLENGE_DOCTYPE } from './com-grandlyon-ecolyo-userchallenge'
import { ECOGESTURE_DOCTYPE } from './com-grandlyon-ecolyo-ecogesture'
import { USERPROFILE_DOCTYPE } from './com-grandlyon-ecolyo-userprofile'
// the documents schema, necessary for CozyClient
const doctypes = {
......@@ -82,27 +82,27 @@ const doctypes = {
export default doctypes
// export all doctypes for the application
export * from './io-enedis-minute'
export * from './io-enedis-hour'
export * from './io-enedis-day'
export * from './io-enedis-month'
export * from './io-enedis-year'
export * from './com-grandlyon-enedis-minute'
export * from './com-grandlyon-enedis-hour'
export * from './com-grandlyon-enedis-day'
export * from './com-grandlyon-enedis-month'
export * from './com-grandlyon-enedis-year'
export * from './io-grdf-hour'
export * from './io-grdf-day'
export * from './io-grdf-month'
export * from './io-grdf-year'
export * from './com-grandlyon-grdf-hour'
export * from './com-grandlyon-grdf-day'
export * from './com-grandlyon-grdf-month'
export * from './com-grandlyon-grdf-year'
export * from './io-egl-day'
export * from './io-egl-month'
export * from './io-egl-year'
export * from './com-grandlyon-egl-day'
export * from './com-grandlyon-egl-month'
export * from './com-grandlyon-egl-year'
export * from './io-cozy-konnectors'
export * from './io-cozy-accounts'
export * from './io-cozy-triggers'
export * from './io-cozy-jobs'
export * from './io-ecolyo-challengetype'
export * from './io-ecolyo-userchallenge'
export * from './io-ecolyo-ecogesture'
export * from './io-ecolyo-userprofile'
export * from './com-grandlyon-ecolyo-challengetype'
export * from './com-grandlyon-ecolyo-userchallenge'
export * from './com-grandlyon-ecolyo-ecogesture'
export * from './com-grandlyon-ecolyo-userprofile'
export const CHALLENGETYPE_DOCTYPE = 'io.ecolyo.challengetype'
export const ECOGESTURE_DOCTYPE = 'io.ecolyo.ecogesture'
export const USERCHALLENGE_DOCTYPE = 'io.ecolyo.userchallenge'
export const USERPROFILE_DOCTYPE = 'io.ecolyo.userprofile'
import { QueryDefinitionBuilder } from 'cozy-client'
export const EGL_DAY_DOCTYPE = 'io.egl.day'
export type EglDay = {
time: string
load: string
type: string
}
export function isEglDay(day: any): day is EglDay {
return day && 'time' in day && 'load' in day
}
export function isEglData(data: any[]): data is EglDay[] {
return data.every(isEglDay)
}
// queries for CozyClient
export const eglQueryClient: QueryDefinitionBuilder = client =>
client.find(EGL_DAY_DOCTYPE)
export const EGL_MONTH_DOCTYPE = 'io.egl.month'
export const EGL_YEAR_DOCTYPE = 'io.egl.year'
import { QueryDefinitionBuilder } from 'cozy-client'
export const ENEDIS_DAY_DOCTYPE = 'io.enedis.day'
export type EnedisDay = {
time: string
load: string
}
export function isEnedisDay(day: any): day is EnedisDay {
return day && 'time' in day && 'load' in day
}
export function isEnedisData(data: any[]): data is EnedisDay[] {
return data.every(isEnedisDay)
}
// queries for CozyClient
export const enedisQueryClient: QueryDefinitionBuilder = client =>
client.find(ENEDIS_DAY_DOCTYPE)
export const ENEDIS_HOUR_DOCTYPE = 'io.enedis.hour'
export const ENEDIS_MINUTE_DOCTYPE = 'io.enedis.minute'
export const ENEDIS_MONTH_DOCTYPE = 'io.enedis.month'
export const ENEDIS_YEAR_DOCTYPE = 'io.enedis.year'
import { QueryDefinitionBuilder } from 'cozy-client'
export const GRDF_DAY_DOCTYPE = 'io.grdf.day'
export type GrdfDay = {
time: string
load: string
}
export function isGrdfDay(day: any): day is GrdfDay {
return day && 'time' in day && 'load' in day
}
export function isGrdfData(data: any[]): data is GrdfDay[] {
return data.every(isGrdfDay)
}
// queries for CozyClient
export const grdfQueryClient: QueryDefinitionBuilder = client =>
client.find(GRDF_DAY_DOCTYPE)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment