@pareto-engineering/design-system 2.0.0-alpha.43 → 2.0.0-alpha.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.scripts.example +4 -0
- package/.eslintrc.js +25 -1
- package/babel.config.js +1 -0
- package/dist/cjs/f/FormInput/FormInput.js +5 -2
- package/dist/cjs/f/FormInput/styles.scss +11 -0
- package/dist/cjs/f/fields/QueryCombobox/QueryCombobox.js +222 -0
- package/dist/cjs/f/fields/QueryCombobox/common/Combobox/Combobox.js +148 -0
- package/dist/cjs/f/fields/QueryCombobox/common/Combobox/index.js +15 -0
- package/dist/cjs/f/fields/QueryCombobox/common/Menu/Menu.js +103 -0
- package/dist/cjs/f/fields/QueryCombobox/common/Menu/index.js +15 -0
- package/dist/cjs/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +229 -0
- package/dist/cjs/f/fields/QueryCombobox/common/MultipleCombobox/index.js +15 -0
- package/dist/cjs/f/fields/QueryCombobox/common/index.js +29 -0
- package/dist/cjs/f/fields/QueryCombobox/index.js +15 -0
- package/dist/cjs/f/fields/QueryCombobox/styles.scss +65 -0
- package/dist/cjs/f/fields/SelectInput/SelectInput.js +0 -1
- package/dist/cjs/f/fields/SelectInput/styles.scss +8 -6
- package/dist/cjs/index.js +13 -0
- package/dist/cjs/test/QueryLoader/QueryLoader.js +41 -0
- package/dist/cjs/test/QueryLoader/__generated__/QueryLoaderHelloQuery.graphql.js +71 -0
- package/dist/cjs/test/QueryLoader/common/PreloadedTestData/PreloadedTestData.js +49 -0
- package/dist/cjs/test/QueryLoader/common/PreloadedTestData/index.js +15 -0
- package/dist/cjs/test/QueryLoader/common/index.js +13 -0
- package/dist/cjs/test/QueryLoader/index.js +15 -0
- package/dist/cjs/test/QueryLoader/styles.scss +9 -0
- package/dist/cjs/test/index.js +13 -0
- package/dist/es/f/FormInput/FormInput.js +4 -1
- package/dist/es/f/FormInput/styles.scss +11 -0
- package/dist/es/f/fields/QueryCombobox/QueryCombobox.js +197 -0
- package/dist/es/f/fields/QueryCombobox/common/Combobox/Combobox.js +129 -0
- package/dist/es/f/fields/QueryCombobox/common/Combobox/index.js +2 -0
- package/dist/es/f/fields/QueryCombobox/common/Menu/Menu.js +77 -0
- package/dist/es/f/fields/QueryCombobox/common/Menu/index.js +2 -0
- package/dist/es/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +202 -0
- package/dist/es/f/fields/QueryCombobox/common/MultipleCombobox/index.js +2 -0
- package/dist/es/f/fields/QueryCombobox/common/index.js +3 -0
- package/dist/es/f/fields/QueryCombobox/index.js +2 -0
- package/dist/es/f/fields/QueryCombobox/styles.scss +65 -0
- package/dist/es/f/fields/SelectInput/SelectInput.js +0 -1
- package/dist/es/f/fields/SelectInput/styles.scss +8 -6
- package/dist/es/index.js +2 -1
- package/dist/es/test/QueryLoader/QueryLoader.js +29 -0
- package/dist/es/test/QueryLoader/__generated__/QueryLoaderHelloQuery.graphql.js +71 -0
- package/dist/es/test/QueryLoader/common/PreloadedTestData/PreloadedTestData.js +31 -0
- package/dist/es/test/QueryLoader/common/PreloadedTestData/index.js +2 -0
- package/dist/es/test/QueryLoader/common/index.js +1 -0
- package/dist/es/test/QueryLoader/index.js +2 -0
- package/dist/es/test/QueryLoader/styles.scss +9 -0
- package/dist/es/test/index.js +1 -0
- package/package.json +14 -2
- package/relay.config.js +12 -0
- package/schema.graphql +4075 -0
- package/scripts/fetchSchema.js +74 -0
- package/src/__snapshots__/Storyshots.test.js.snap +10 -8
- package/src/stories/test/QueryLoader.stories.jsx +36 -0
- package/src/stories/utils/relay/EnvironmentProvider.jsx +14 -0
- package/src/stories/utils/relay/environment.js +5 -0
- package/src/stories/utils/relay/index.js +4 -0
- package/src/stories/utils/relay/mockRelayOperation.js +14 -0
- package/src/stories/utils/relay/mockResolvers.js +299 -0
- package/src/ui/f/FormInput/FormInput.jsx +5 -1
- package/src/ui/f/FormInput/styles.scss +11 -0
- package/src/ui/f/fields/SelectInput/SelectInput.jsx +1 -1
- package/src/ui/f/fields/SelectInput/styles.scss +8 -6
- package/src/ui/index.js +1 -0
- package/src/ui/test/QueryLoader/QueryLoader.jsx +41 -0
- package/src/ui/test/QueryLoader/__generated__/QueryLoaderHelloQuery.graphql.js +68 -0
- package/src/ui/test/QueryLoader/common/PreloadedTestData/PreloadedTestData.jsx +51 -0
- package/src/ui/test/QueryLoader/common/PreloadedTestData/index.js +2 -0
- package/src/ui/test/QueryLoader/common/index.js +1 -0
- package/src/ui/test/QueryLoader/index.js +2 -0
- package/src/ui/test/index.js +1 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
const https = require('https')
|
|
2
|
+
const fs = require('fs')
|
|
3
|
+
|
|
4
|
+
require('dotenv').config({ path: '.env.scripts' })
|
|
5
|
+
|
|
6
|
+
const {
|
|
7
|
+
GITHUB_BACKEND_ORG,
|
|
8
|
+
GITHUB_BACKEND_REPO,
|
|
9
|
+
GITHUB_READONLY_PAT,
|
|
10
|
+
DEBUG,
|
|
11
|
+
} = process.env
|
|
12
|
+
|
|
13
|
+
const isDebug = DEBUG === 'True'
|
|
14
|
+
|
|
15
|
+
const host = 'api.github.com'
|
|
16
|
+
const contentEndpoint = `/repos/${GITHUB_BACKEND_ORG}/${GITHUB_BACKEND_REPO}/contents/schema.graphql`
|
|
17
|
+
const authToken = GITHUB_READONLY_PAT
|
|
18
|
+
|
|
19
|
+
const defaultBranch = 'development'
|
|
20
|
+
const indexOfRefArg = process.argv.findIndex((arg) => arg === '--ref')
|
|
21
|
+
const selectedRef = (indexOfRefArg > -1) ? process.argv[indexOfRefArg + 1] : defaultBranch
|
|
22
|
+
|
|
23
|
+
const filename = 'schema.graphql'
|
|
24
|
+
|
|
25
|
+
const processContent = (data) => {
|
|
26
|
+
if (data.content) {
|
|
27
|
+
if (isDebug) {
|
|
28
|
+
console.log(Buffer.from(data.content, 'base64').toString('utf-8'))
|
|
29
|
+
}
|
|
30
|
+
fs.writeFile(filename, Buffer.from(data.content, 'base64'), 'utf8', (err) => {
|
|
31
|
+
if (err) {
|
|
32
|
+
console.log(err)
|
|
33
|
+
} else {
|
|
34
|
+
console.log(`${filename} successfully saved`)
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
} else {
|
|
38
|
+
console.error('Error in downloading the schema.')
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function performRequest(success) {
|
|
43
|
+
console.log(`Fetching schema from ref=${selectedRef}`)
|
|
44
|
+
const options = {
|
|
45
|
+
host,
|
|
46
|
+
path :`${contentEndpoint}?ref=${selectedRef}`,
|
|
47
|
+
method :'GET',
|
|
48
|
+
headers:{
|
|
49
|
+
Authorization:`token ${authToken}`,
|
|
50
|
+
'User-Agent' :'Nodejs CI script',
|
|
51
|
+
},
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const req = https.request(options, (res) => {
|
|
55
|
+
res.setEncoding('utf-8')
|
|
56
|
+
|
|
57
|
+
let responseString = ''
|
|
58
|
+
|
|
59
|
+
res.on('data', (data) => {
|
|
60
|
+
responseString += data
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
res.on('end', () => {
|
|
64
|
+
// console.log(responseString)
|
|
65
|
+
const responseObject = JSON.parse(responseString)
|
|
66
|
+
success(responseObject)
|
|
67
|
+
})
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
// req.write()
|
|
71
|
+
req.end()
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
performRequest(processContent)
|
|
@@ -2663,7 +2663,7 @@ exports[`Storyshots a/Timestamp Distance Format 1`] = `
|
|
|
2663
2663
|
className="base timestamp"
|
|
2664
2664
|
onClick={[Function]}
|
|
2665
2665
|
>
|
|
2666
|
-
in
|
|
2666
|
+
in 4 months
|
|
2667
2667
|
</p>
|
|
2668
2668
|
`;
|
|
2669
2669
|
|
|
@@ -10361,7 +10361,7 @@ exports[`Storyshots f/FormInput Base 1`] = `
|
|
|
10361
10361
|
className="base select-input form-input y-background2"
|
|
10362
10362
|
>
|
|
10363
10363
|
<label
|
|
10364
|
-
className="base label
|
|
10364
|
+
className="base label x-main2"
|
|
10365
10365
|
htmlFor="food"
|
|
10366
10366
|
>
|
|
10367
10367
|
What do you want for dinner ?
|
|
@@ -10550,7 +10550,7 @@ exports[`Storyshots f/FormInput Disabled Form Input 1`] = `
|
|
|
10550
10550
|
className="base select-input form-input y-background2"
|
|
10551
10551
|
>
|
|
10552
10552
|
<label
|
|
10553
|
-
className="base label
|
|
10553
|
+
className="base label x-main2"
|
|
10554
10554
|
htmlFor="food"
|
|
10555
10555
|
>
|
|
10556
10556
|
What do you want for dinner ?
|
|
@@ -11995,7 +11995,7 @@ exports[`Storyshots f/fields/SelectInput Base 1`] = `
|
|
|
11995
11995
|
className="base select-input y-background2"
|
|
11996
11996
|
>
|
|
11997
11997
|
<label
|
|
11998
|
-
className="base label
|
|
11998
|
+
className="base label x-main2"
|
|
11999
11999
|
htmlFor="workType"
|
|
12000
12000
|
>
|
|
12001
12001
|
Work Type
|
|
@@ -12059,7 +12059,7 @@ exports[`Storyshots f/fields/SelectInput Disabled Select Input 1`] = `
|
|
|
12059
12059
|
className="base select-input y-background2"
|
|
12060
12060
|
>
|
|
12061
12061
|
<label
|
|
12062
|
-
className="base label
|
|
12062
|
+
className="base label x-main2"
|
|
12063
12063
|
htmlFor="workType"
|
|
12064
12064
|
>
|
|
12065
12065
|
Work Type
|
|
@@ -12135,7 +12135,7 @@ exports[`Storyshots f/fields/SelectInput Objects 1`] = `
|
|
|
12135
12135
|
className="base select-input y-background2"
|
|
12136
12136
|
>
|
|
12137
12137
|
<label
|
|
12138
|
-
className="base label
|
|
12138
|
+
className="base label x-main2"
|
|
12139
12139
|
htmlFor="workType"
|
|
12140
12140
|
>
|
|
12141
12141
|
Work Type
|
|
@@ -12193,7 +12193,7 @@ exports[`Storyshots f/fields/SelectInput Required Select 1`] = `
|
|
|
12193
12193
|
className="base select-input y-background2"
|
|
12194
12194
|
>
|
|
12195
12195
|
<label
|
|
12196
|
-
className="base label
|
|
12196
|
+
className="base label x-main2"
|
|
12197
12197
|
htmlFor="activity"
|
|
12198
12198
|
>
|
|
12199
12199
|
Activity Type
|
|
@@ -12251,7 +12251,7 @@ exports[`Storyshots f/fields/SelectInput String And Objects 1`] = `
|
|
|
12251
12251
|
className="base select-input y-background2"
|
|
12252
12252
|
>
|
|
12253
12253
|
<label
|
|
12254
|
-
className="base label
|
|
12254
|
+
className="base label x-main2"
|
|
12255
12255
|
htmlFor="workType"
|
|
12256
12256
|
>
|
|
12257
12257
|
Work Type
|
|
@@ -12674,3 +12674,5 @@ exports[`Storyshots f/fields/TextareaInput Validation 1`] = `
|
|
|
12674
12674
|
exports[`Storyshots r/SwitchRouteMap Base 1`] = `"This component does not need a visual test."`;
|
|
12675
12675
|
|
|
12676
12676
|
exports[`Storyshots r/common/PrivateRoute Base 1`] = `"This component does not need a visual test."`;
|
|
12677
|
+
|
|
12678
|
+
exports[`Storyshots test/QueryLoader Base 1`] = `null`;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
|
|
4
|
+
import { QueryLoader } from 'ui'
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
RelayEnvironmentProvider,
|
|
8
|
+
mockRelayOperation,
|
|
9
|
+
} from '../utils/relay'
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
title :'test/QueryLoader',
|
|
13
|
+
component :QueryLoader,
|
|
14
|
+
subcomponents:{
|
|
15
|
+
// Item:QueryLoader.Item
|
|
16
|
+
},
|
|
17
|
+
decorators:[
|
|
18
|
+
// storyfn => <div className="">{ storyfn() }</div>,
|
|
19
|
+
(storyfn) => (
|
|
20
|
+
<RelayEnvironmentProvider>
|
|
21
|
+
{ storyfn() }
|
|
22
|
+
</RelayEnvironmentProvider>
|
|
23
|
+
),
|
|
24
|
+
],
|
|
25
|
+
argTypes:{
|
|
26
|
+
backgroundColor:{ control: 'color' },
|
|
27
|
+
},
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const Base = () => {
|
|
31
|
+
mockRelayOperation()
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<QueryLoader />
|
|
35
|
+
)
|
|
36
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { RelayEnvironmentProvider } from 'react-relay/hooks'
|
|
3
|
+
|
|
4
|
+
import environment from './environment'
|
|
5
|
+
|
|
6
|
+
const RelayEnvProvider = (props) => (
|
|
7
|
+
<RelayEnvironmentProvider
|
|
8
|
+
environment={environment}
|
|
9
|
+
// history={history}
|
|
10
|
+
{...props}
|
|
11
|
+
/>
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
export default RelayEnvProvider
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MockPayloadGenerator } from 'relay-test-utils'
|
|
2
|
+
import relayEnvironment from './environment'
|
|
3
|
+
import mockResolvers from './mockResolvers'
|
|
4
|
+
|
|
5
|
+
function mockRelayOperation(overrideMockResolvers = null) {
|
|
6
|
+
relayEnvironment.mock.queueOperationResolver(
|
|
7
|
+
(operation) => MockPayloadGenerator.generate(
|
|
8
|
+
operation,
|
|
9
|
+
overrideMockResolvers || mockResolvers,
|
|
10
|
+
),
|
|
11
|
+
)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default mockRelayOperation
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
const customMockResolvers = {
|
|
2
|
+
String :() => 'Test string',
|
|
3
|
+
UserNode:() => ({
|
|
4
|
+
id :'VXNlck5vZGU6OTZkZTA3M2MtNTE3Ni00ZjgyLTg4OWMtMzIwYmVmYzU5ODFj',
|
|
5
|
+
firstName :'Collins',
|
|
6
|
+
isSuperuser:false,
|
|
7
|
+
}),
|
|
8
|
+
TaskNode:() => ({
|
|
9
|
+
id :'VGFza05vZGU6MDAwZmQ4N2UtYjNlNS00NWE5LTg5ZjEtNWI0ZDViNWE2NTlj',
|
|
10
|
+
title :'Task1',
|
|
11
|
+
status:{
|
|
12
|
+
id :'VGFza1N0YXR1c05vZGU6OTczYmM4NTgtMzA0NC00NWNiLTg2MDQtYTRhM2JmNjFmZjEx',
|
|
13
|
+
status:'In Review',
|
|
14
|
+
},
|
|
15
|
+
requester:{
|
|
16
|
+
id :'VXNlck5vZGU6OTZkZTA3M2MtNTE3Ni00ZjgyLTg4OWMtMzIwYmVmYzU5ODFj',
|
|
17
|
+
firstName:'Collins',
|
|
18
|
+
},
|
|
19
|
+
userTeam:{
|
|
20
|
+
id :'VGVhbU5vZGU6MDAxZTIyOGEtYzA5My00MGI0LWE1MTUtYTNkMTM1NTE1MDNl',
|
|
21
|
+
name:'Team 1',
|
|
22
|
+
},
|
|
23
|
+
manager:{
|
|
24
|
+
id :'VXNlck5vZGU6OTZkZTA3M2MtNTE3Ni00ZjgyLTg4OWMtMzIwYmVmYzU5ODFj',
|
|
25
|
+
firstName:'manager',
|
|
26
|
+
},
|
|
27
|
+
createdAt :'2021-09-23',
|
|
28
|
+
dueDate :'2021-10-30',
|
|
29
|
+
requestDate:'2020-01-01',
|
|
30
|
+
description:'First task',
|
|
31
|
+
}),
|
|
32
|
+
TeamNode:() => ({
|
|
33
|
+
id :'VGVhbU5vZGU6MDAxZTIyOGEtYzA5My00MGI0LWE1MTUtYTNkMTM1NTE1MDNl',
|
|
34
|
+
name :'Team 1',
|
|
35
|
+
credits :20.12,
|
|
36
|
+
billingEmail:'team1@hellopareto.com',
|
|
37
|
+
hourlyRate :20,
|
|
38
|
+
partner :{
|
|
39
|
+
firstName:'Test1',
|
|
40
|
+
lastName :'assd',
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
}),
|
|
44
|
+
GroupNode:() => ({
|
|
45
|
+
id :'VGFza05vZGU6MDAwZmQ4N2UtYjNlNS00NWE5LTg5ZjEtNWI0ZDViNWE2NTlk',
|
|
46
|
+
name:'admin',
|
|
47
|
+
}),
|
|
48
|
+
TaskNodeConnection:() => ({
|
|
49
|
+
pageInfo:{
|
|
50
|
+
hasNextPage :true,
|
|
51
|
+
hasPreviousPage:true,
|
|
52
|
+
},
|
|
53
|
+
edges:[
|
|
54
|
+
{
|
|
55
|
+
node:{
|
|
56
|
+
id :'VGFza05vZGU6MDAwZmQ4N2UtYjNlNS00NWE5LTg5ZjEtNWI0ZDViNWE2NTlj',
|
|
57
|
+
title :'Task1',
|
|
58
|
+
status:{
|
|
59
|
+
id :'VGFza1N0YXR1c05vZGU6OTczYmM4NTgtMzA0NC00NWNiLTg2MDQtYTRhM2JmNjFmZjEx',
|
|
60
|
+
status:'In Review',
|
|
61
|
+
},
|
|
62
|
+
requester:{
|
|
63
|
+
id :'VXNlck5vZGU6OTZkZTA3M2MtNTE3Ni00ZjgyLTg4OWMtMzIwYmVmYzU5ODFj',
|
|
64
|
+
firstName:'Collins',
|
|
65
|
+
},
|
|
66
|
+
userTeam:{
|
|
67
|
+
id :'VGVhbU5vZGU6MDAxZTIyOGEtYzA5My00MGI0LWE1MTUtYTNkMTM1NTE1MDNl',
|
|
68
|
+
name:'Team 1',
|
|
69
|
+
},
|
|
70
|
+
manager:{
|
|
71
|
+
id :'VXNlck5vZGU6OTZkZTA3M2MtNTE3Ni00ZjgyLTg4OWMtMzIwYmVmYzU5ODFj',
|
|
72
|
+
firstName:'manager',
|
|
73
|
+
},
|
|
74
|
+
createdAt :'2021-09-23',
|
|
75
|
+
dueDate :'2021-10-30',
|
|
76
|
+
requestDate:'2020-01-01',
|
|
77
|
+
description:'First task',
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
node:{
|
|
82
|
+
id :'VGFza05vZGU6MDAwZmQ4N2UtYjNlNS00NWE5LTg5ZjEtNWI0ZDViNWE2NTlj',
|
|
83
|
+
title :'Task2',
|
|
84
|
+
status:{
|
|
85
|
+
id :'VGFza1N0YXR1c05vZGU6OTczYmM4NTgtMzA0NC00NWNiLTg2MDQtYTRhM2JmNjFmZjEx',
|
|
86
|
+
status:'In Review',
|
|
87
|
+
},
|
|
88
|
+
requester:{
|
|
89
|
+
id :'VXNlck5vZGU6OTZkZTA3M2MtNTE3Ni00ZjgyLTg4OWMtMzIwYmVmYzU5ODFj',
|
|
90
|
+
firstName:'Collins',
|
|
91
|
+
},
|
|
92
|
+
userTeam:{
|
|
93
|
+
id :'VGVhbU5vZGU6MDAxZTIyOGEtYzA5My00MGI0LWE1MTUtYTNkMTM1NTE1MDNl',
|
|
94
|
+
name:'Team 2',
|
|
95
|
+
},
|
|
96
|
+
manager:{
|
|
97
|
+
id :'VXNlck5vZGU6OTZkZTA3M2MtNTE3Ni00ZjgyLTg4OWMtMzIwYmVmYzU5ODFj',
|
|
98
|
+
firstName:'manager',
|
|
99
|
+
},
|
|
100
|
+
createdAt :'2021-09-23',
|
|
101
|
+
dueDate :'2021-10-30',
|
|
102
|
+
requestDate:'2020-01-01',
|
|
103
|
+
description:'Second task',
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
],
|
|
107
|
+
}),
|
|
108
|
+
UserNodeConnection:(allArgs) => {
|
|
109
|
+
const { args :{ first, offset } } = allArgs
|
|
110
|
+
|
|
111
|
+
const edges = [
|
|
112
|
+
{
|
|
113
|
+
node:{
|
|
114
|
+
id :'VXNlck5vZGU6OTZkZTA3M2MtNTE3Ni00ZjgyLTg4OWMtMzIwYmVmYzU5ODFj',
|
|
115
|
+
firstName:'Collins',
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
node:{
|
|
120
|
+
id :'VXNlck5vZGU6MDEyN2E1NmItYjAxOS00NmQxLTg2NTEtYWEzOGIxZTUwNTA5',
|
|
121
|
+
firstName:'Amritha',
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
node:{
|
|
126
|
+
id :'VXNlck5vZGU6YzcwYWIxMDItZWE2Yy00ZWNhLTk0M2ItOTA2OWQwN2RiMDQ0',
|
|
127
|
+
firstName:'Marsya',
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
node:{
|
|
132
|
+
id :'VXNlck5vZGU6OTUyNjg1NWYtZTg3NC00ZTlkLWFlZTgtZDZjODc3NDNlNTRh',
|
|
133
|
+
firstName:'James',
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
node:{
|
|
138
|
+
id :'VXNlck5vZGU6OTFmOTE4NTYtNjg0Yi00ODhhLWE0YzktZGU5ZDQ5YmJjM2Mz',
|
|
139
|
+
firstName:'Adrian',
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
node:{
|
|
144
|
+
id :'VXNlck5vZGU6OTNkZGU3NGEtYTA2Yi00MDMzLWIwMDAtMTFkZDY0N2Y3OWE4',
|
|
145
|
+
firstName:'Melissa',
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
node:{
|
|
150
|
+
id :'VXNlck5vZGU6MjgyYTk1MjctMDI4OS00MDlhLWFjNTktYWJkNTFkODAyMjFj',
|
|
151
|
+
firstName:'Beto',
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
node:{
|
|
156
|
+
id :'VXNlck5vZGU6YmIxYzI5YmEtYTk0OS00M2I3LWIxMWEtZDQxMjM5ZWI0ZWI2',
|
|
157
|
+
firstName:'Romie',
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
node:{
|
|
162
|
+
id :'VXNlck5vZGU6ZjZhNzBiZTgtY2FkMC00NzNjLWEyODUtNDdkMGVmYjQxYTRl',
|
|
163
|
+
firstName:'Miguel',
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
node:{
|
|
168
|
+
id :'VXNlck5vZGU6Y2JlOGM4ZTYtY2Q2Zi00M2RlLWI4YmQtODU3YWRhZjYyMzVj',
|
|
169
|
+
firstName:'Phoebe',
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
node:{
|
|
174
|
+
id :'VXNlck5vZGU6NDA5MWM1MDUtYjY1MC00M2Y1LTg3NTEtMDc1NTBkMzJhYTcy',
|
|
175
|
+
firstName:'Kim',
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
node:{
|
|
180
|
+
id :'VXNlck5vZGU6ZjE0MGUxYTItM2I4My00NmY1LWIzMDQtYmFiOGZjMTc5ZmU4',
|
|
181
|
+
firstName:'Liz',
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
node:{
|
|
186
|
+
id :'VXNlck5vZGU6ZGYyOGE5MDYtM2NhMS00NTVmLWIzZmUtNjY5YWFkZTNiZjRk',
|
|
187
|
+
firstName:'Deepanshu',
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
node:{
|
|
192
|
+
id :'VXNlck5vZGU6MjBhMDBkYjgtZDExNi00YzAyLWEyOTUtYWM5MzIwMjUwMWU3',
|
|
193
|
+
firstName:'Jennica',
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
node:{
|
|
198
|
+
id :'VXNlck5vZGU6MjczNDllYjMtYzNmYi00ZmVkLWE1N2YtNTFjZGJlODI0MWU2',
|
|
199
|
+
firstName:'Michelle',
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
]
|
|
203
|
+
|
|
204
|
+
return ({
|
|
205
|
+
pageInfo:{
|
|
206
|
+
hasNextPage :true,
|
|
207
|
+
hasPreviousPage:true,
|
|
208
|
+
},
|
|
209
|
+
edges:edges.slice(offset, offset + first),
|
|
210
|
+
})
|
|
211
|
+
},
|
|
212
|
+
WorkHoursNodeConnection:() => ({
|
|
213
|
+
pageInfo:{
|
|
214
|
+
hasNextPage :true,
|
|
215
|
+
hasPreviousPage:true,
|
|
216
|
+
},
|
|
217
|
+
edges:[
|
|
218
|
+
{
|
|
219
|
+
node:{
|
|
220
|
+
id :'V29ya0hvdXJzTm9kZTplYWJlYmEyNC0wNTlmLTQxMjEtODIzYi0yYmU2YzMxMmZlNzA=',
|
|
221
|
+
associate:{
|
|
222
|
+
firstName:'Des',
|
|
223
|
+
lastName :'assd',
|
|
224
|
+
},
|
|
225
|
+
timeSpent :15,
|
|
226
|
+
log :'asd',
|
|
227
|
+
paidOut :false,
|
|
228
|
+
sentInvoice:true,
|
|
229
|
+
createdAt :'2021-09-05T17:08:49.000-0430',
|
|
230
|
+
startedAt :'2021-09-05T17:08:49.000-0430',
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
node:{
|
|
235
|
+
id :'V29ya0hvdXJzTm9kZTplYmZiZTllZS04NWNkLTRhNDktYTZhMi0zNmNhMTU0M2EwMDU=',
|
|
236
|
+
associate:{
|
|
237
|
+
firstName:'Ella',
|
|
238
|
+
lastName :'asdasd',
|
|
239
|
+
},
|
|
240
|
+
timeSpent :25,
|
|
241
|
+
log :'aasdasdsd',
|
|
242
|
+
paidOut :true,
|
|
243
|
+
sentInvoice:false,
|
|
244
|
+
createdAt :'2021-09-15T17:08:49.000-0430',
|
|
245
|
+
startedAt :'2021-09-15T17:08:49.000-0430',
|
|
246
|
+
},
|
|
247
|
+
},
|
|
248
|
+
],
|
|
249
|
+
}),
|
|
250
|
+
TeamNodeConnection:() => ({
|
|
251
|
+
pageInfo:{
|
|
252
|
+
hasNextPage :true,
|
|
253
|
+
hasPreviousPage:true,
|
|
254
|
+
},
|
|
255
|
+
edges:[
|
|
256
|
+
{
|
|
257
|
+
node:{
|
|
258
|
+
id :'VGVhbU5vZGU6MDAxZTIyOGEtYzA5My00MGI0LWE1MTUtYTNkMTM1NTE1MDNl',
|
|
259
|
+
name :'Team 1',
|
|
260
|
+
credits :20.12,
|
|
261
|
+
billingEmail:'team1@hellopareto.com',
|
|
262
|
+
hourlyRate :20,
|
|
263
|
+
partner :{
|
|
264
|
+
firstName:'Test1',
|
|
265
|
+
lastName :'assd',
|
|
266
|
+
},
|
|
267
|
+
},
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
node:{
|
|
271
|
+
id :'VGVhbU5vZGU6MDA0N2U4MzktODY0Zi00N2U5LTg3ZjgtZGUwMmM2Yzg1YWJm',
|
|
272
|
+
name :'Team 2',
|
|
273
|
+
credits :20.12,
|
|
274
|
+
billingEmail:'team2@hellopareto.com',
|
|
275
|
+
hourlyRate :20,
|
|
276
|
+
partner :{
|
|
277
|
+
firstName:'Test2',
|
|
278
|
+
lastName :'assd',
|
|
279
|
+
},
|
|
280
|
+
},
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
node:{
|
|
284
|
+
id :'VGVhbU5vZGU6MDExMmEyZmEtYzE0YS00MGRhLThiNWQtMDMzNTkyNDQ3ZDI2',
|
|
285
|
+
name :'Team 3',
|
|
286
|
+
credits :20.12,
|
|
287
|
+
billingEmail:'team3@hellopareto.com',
|
|
288
|
+
hourlyRate :20,
|
|
289
|
+
partner :{
|
|
290
|
+
firstName:'Test3',
|
|
291
|
+
lastName :'assd',
|
|
292
|
+
},
|
|
293
|
+
},
|
|
294
|
+
},
|
|
295
|
+
],
|
|
296
|
+
}),
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
export default customMockResolvers
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
2
|
import * as React from 'react'
|
|
3
3
|
|
|
4
|
-
import { memo } from 'react'
|
|
4
|
+
import { memo, useLayoutEffect } from 'react'
|
|
5
5
|
|
|
6
6
|
import PropTypes from 'prop-types'
|
|
7
7
|
|
|
@@ -28,6 +28,10 @@ const FormInput = ({
|
|
|
28
28
|
disabled,
|
|
29
29
|
...otherProps
|
|
30
30
|
}) => {
|
|
31
|
+
useLayoutEffect(() => {
|
|
32
|
+
import('./styles.scss')
|
|
33
|
+
}, [])
|
|
34
|
+
|
|
31
35
|
const newClassName = [
|
|
32
36
|
className,
|
|
33
37
|
componentClassName,
|
|
@@ -55,7 +55,7 @@ const SelectInput = ({
|
|
|
55
55
|
style={style}
|
|
56
56
|
// {...otherProps}
|
|
57
57
|
>
|
|
58
|
-
<FormLabel
|
|
58
|
+
<FormLabel name={name}>{label}</FormLabel>
|
|
59
59
|
<select className="input" {...field} value={field.value || ''} id={name} disabled={disabled}>
|
|
60
60
|
{
|
|
61
61
|
options.map((option) => {
|
|
@@ -6,24 +6,27 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
$default-padding: 0.75em;
|
|
9
|
-
|
|
9
|
+
$default-margin: 1em;
|
|
10
10
|
|
|
11
11
|
.#{bem.$base}.select-input {
|
|
12
12
|
display: flex;
|
|
13
13
|
flex-direction: column;
|
|
14
14
|
|
|
15
|
+
.#{bem.$base}.label {
|
|
16
|
+
margin-bottom: $default-margin
|
|
17
|
+
}
|
|
15
18
|
|
|
16
19
|
.input {
|
|
17
20
|
border: var(--theme-border-style) var(--dark-y);
|
|
18
21
|
background: var(--light-y);
|
|
19
|
-
color:var(--on-y);
|
|
22
|
+
color: var(--on-y);
|
|
20
23
|
padding: $default-padding;
|
|
21
24
|
|
|
22
|
-
|
|
25
|
+
&:not(:disabled):hover {
|
|
23
26
|
border: var(--theme-border-style) var(--light-background4);
|
|
24
27
|
}
|
|
25
28
|
|
|
26
|
-
|
|
29
|
+
&:disabled {
|
|
27
30
|
background-color: var(--dark-y);
|
|
28
31
|
}
|
|
29
32
|
|
|
@@ -31,5 +34,4 @@ $default-padding: 0.75em;
|
|
|
31
34
|
background: var(--y);
|
|
32
35
|
}
|
|
33
36
|
}
|
|
34
|
-
}
|
|
35
|
-
|
|
37
|
+
}
|
package/src/ui/index.js
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
|
|
4
|
+
import { useEffect, Suspense } from 'react'
|
|
5
|
+
|
|
6
|
+
import { useQueryLoader } from 'react-relay'
|
|
7
|
+
|
|
8
|
+
// Local Definitions
|
|
9
|
+
|
|
10
|
+
import { PreloadedTestData } from './common'
|
|
11
|
+
|
|
12
|
+
const testQuery = graphql`
|
|
13
|
+
query QueryLoaderHelloQuery {
|
|
14
|
+
hello
|
|
15
|
+
}
|
|
16
|
+
`
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* This is the component description.
|
|
20
|
+
*/
|
|
21
|
+
const QueryLoader = () => {
|
|
22
|
+
const [queryReference, loadQuery] = useQueryLoader(testQuery)
|
|
23
|
+
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
loadQuery({})
|
|
26
|
+
}, [])
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<Suspense fallback="loading">
|
|
30
|
+
{queryReference ? (
|
|
31
|
+
<PreloadedTestData queryReference={queryReference} query={testQuery} />
|
|
32
|
+
) : null}
|
|
33
|
+
</Suspense>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
QueryLoader.defaultProps = {
|
|
38
|
+
// someProp:false
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export default QueryLoader
|