@corva/ui 0.100.0-21 → 0.100.0-23
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/README.md
CHANGED
|
@@ -1,41 +1,51 @@
|
|
|
1
1
|
# @corva/ui
|
|
2
|
+
|
|
2
3
|
<a href="https://storybook.dev.corva.ai/" target="_blank"><img src="https://raw.githubusercontent.com/storybooks/brand/master/badge/badge-storybook.svg"></a>
|
|
3
4
|
[](https://www.npmjs.com/package/@corva/ui)
|
|
4
5
|
[](https://www.npmjs.com/package/@corva/ui)
|
|
5
6
|
[](https://www.npmjs.com/package/@corva/ui)
|
|
6
7
|
|
|
7
|
-
|
|
8
8
|
develop: [](https://github.com/corva-ai/corva-ui/actions/workflows/publish.yml)
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
This repo contains components/utils which are shared for Corva ui apps.
|
|
10
|
+
This repo contains components/utils which are shared for Corva UI apps.
|
|
12
11
|
|
|
13
12
|
### When you need some library changes
|
|
14
|
-
Currently @corva/ui library is owned by the Dev Center team, but is developed by every Corva FE developer. So, if you need to make some update in it - you can do it by yourself. For small updates - just make a PR - and someone from the Dev Center team will review it.
|
|
15
13
|
|
|
16
|
-
|
|
14
|
+
Currently, `@corva/ui` library is owned by the Dev Center team, but is developed by every Corva FE developer. So, if you
|
|
15
|
+
need to make some update in it - you can do it by yourself. For small updates - just make a PR - and someone from the
|
|
16
|
+
Dev Center team will review it.
|
|
17
|
+
|
|
18
|
+
If it's something pretty big - it's better to reach out someone from the Dev Center team first, to tell what you need
|
|
19
|
+
and get feedback how to better do it. Otherwise - you risk that your huge PR on which you worked a week can be rejected
|
|
20
|
+
because it can be not consistent with the rest of the lib
|
|
17
21
|
|
|
18
22
|
### Release & deploy of the library
|
|
19
|
-
How to bump the version? What should be the branch name? And other more advanced cases, like release/hotfixes. The guideline for all of these cases can be found [here (Corva access required)](https://www.notion.so/corva/corva-ui-d510f545ffb74c9bafd6b1bfbc0b99bf)
|
|
20
23
|
|
|
24
|
+
How to bump the version? What should be the branch name? And other more advanced cases, like release/hotfixes. The
|
|
25
|
+
guideline for all of these cases can be
|
|
26
|
+
found [here (Corva access required)](https://www.notion.so/corva/corva-ui-d510f545ffb74c9bafd6b1bfbc0b99bf)
|
|
21
27
|
|
|
22
28
|
### Stories for every public component
|
|
23
|
-
|
|
29
|
+
|
|
30
|
+
Every public `@corva/ui` component has a corresponding `.stories.js` file that describes the component. When you work
|
|
31
|
+
with
|
|
32
|
+
public `@corva/ui`
|
|
24
33
|
components - please also update it's `stories.js` file when it's necessary
|
|
25
34
|
|
|
26
35
|
## Build-time variables
|
|
27
36
|
|
|
28
|
-
| Name
|
|
29
|
-
|
|
30
|
-
| REACT_APP_API_URL
|
|
31
|
-
| REACT_APP_DATA_API_URL | https://data.qa.corva.ai | No
|
|
32
|
-
| REACT_APP_CDN_URL
|
|
37
|
+
| Name | Default Value | Required |
|
|
38
|
+
|------------------------|--------------------------|----------|
|
|
39
|
+
| REACT_APP_API_URL | https://api.qa.corva.ai | No |
|
|
40
|
+
| REACT_APP_DATA_API_URL | https://data.qa.corva.ai | No |
|
|
41
|
+
| REACT_APP_CDN_URL | https://cdn.corva.ai | No |
|
|
33
42
|
|
|
34
43
|
## Local development
|
|
35
44
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
- `yarn start` will open ExampleApp.js in your browser. That's a playground for building non-public components (such
|
|
45
|
+
- `yarn storybook` will launch local storybook server which is convenient to use for components testing when you work on
|
|
46
|
+
public components. That's a playground for building public components.
|
|
47
|
+
- `yarn start` will open ExampleApp.js in your browser. That's a playground for building non-public components (such
|
|
48
|
+
components will be moved from @corva/ui soon)
|
|
39
49
|
|
|
40
50
|
## Link local `@corva/ui` to your app
|
|
41
51
|
|
|
@@ -43,46 +53,56 @@ components - please also update it's `stories.js` file when it's necessary
|
|
|
43
53
|
|
|
44
54
|
* Make sure you are using `@corva/ui` with latest updates from `development` branch
|
|
45
55
|
|
|
46
|
-
* If your app is using `getWebpackConfig` from `@corva/ui` instead of `@corva/dc-platform-shared`, migrate it according
|
|
56
|
+
* If your app is using `getWebpackConfig` from `@corva/ui` instead of `@corva/dc-platform-shared`, migrate it according
|
|
57
|
+
to [this guide](https://www.notion.so/corva/Migration-to-corva-dc-platform-shared-721cc822e23c4c43a7630b73fdeec3d9)
|
|
47
58
|
|
|
48
59
|
### Steps to link your local DC app**
|
|
49
60
|
|
|
50
61
|
1. Run `yarn build-dev` or `yarn build-watch` in @corva/ui repo
|
|
51
|
-
|
|
62
|
+
<br/>***Note:** `yarn build` will not work for linking*
|
|
52
63
|
|
|
53
64
|
2. `cd ./dist` and run `yarn link` in @corva/ui dist folder (only first time)
|
|
54
65
|
|
|
55
66
|
3. Run `yarn link @corva/ui` in your local DC app root folder
|
|
56
67
|
|
|
57
|
-
4. Add following parameters to the `config-overrides.js`.<br/>It should avoid the issue of
|
|
58
|
-
|
|
68
|
+
4. Add following parameters to the `config-overrides.js`.<br/>It should avoid the issue of multiple React instances and
|
|
69
|
+
the MUI styling issue
|
|
70
|
+
|
|
71
|
+
```js
|
|
59
72
|
{
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
73
|
+
resolve: {
|
|
74
|
+
alias: {
|
|
75
|
+
react: path.resolve('./node_modules/react'),
|
|
76
|
+
'@material-ui'
|
|
77
|
+
:
|
|
78
|
+
resolve('./node_modules/@material-ui'),
|
|
65
79
|
}
|
|
80
|
+
}
|
|
66
81
|
}
|
|
67
82
|
```
|
|
68
83
|
|
|
69
|
-
|
|
70
84
|
5. Run `yarn start` in your local DC app root folder
|
|
71
85
|
|
|
72
|
-
***Note:** npm link will not install
|
|
73
|
-
If you want to debug a change
|
|
86
|
+
***Note:** npm link will not install `@corva/ui` dependencies in your node modules folder.*
|
|
87
|
+
If you want to debug a change in `@corva/ui` dependencies, you should use `yarn add file:../corva-ui/dist`, this will
|
|
88
|
+
install new dependencies.
|
|
74
89
|
|
|
75
90
|
### Troubleshooting
|
|
76
91
|
|
|
77
92
|
#### Failed to compile.<br />`Module not found: Can't resolve '@corva/ui' in ...`
|
|
78
|
-
|
|
93
|
+
|
|
94
|
+
Most likely you need to [migrate to
|
|
95
|
+
`@corva/dc-platform-shared`](https://www.notion.so/corva/Migration-to-corva-dc-platform-shared-721cc822e23c4c43a7630b73fdeec3d9)
|
|
96
|
+
for cjs webpack config usage
|
|
79
97
|
|
|
80
98
|
#### Error.<br/>`Invalid hook call. Hooks can only be called inside of the body of a function component...`
|
|
81
99
|
|
|
82
|
-
|
|
100
|
+
In that case, your bundler might “see” two Reacts — one in application folder and one in your library folder. Assuming
|
|
101
|
+
myapp and mylib are sibling folders, one possible fix is to run npm link ../myapp/node_modules/react from mylib. This
|
|
102
|
+
should make the library use the application’s React copy.
|
|
83
103
|
|
|
104
|
+
Or change the webpack configuration in `config-overrides.js` file in your app. (Don't commit the changes of this file)
|
|
84
105
|
|
|
85
|
-
Or change the webpack configuration in `config-overrides.js` file in your app. (Don't commit the changes of this file)
|
|
86
106
|
```
|
|
87
107
|
{
|
|
88
108
|
resolve: {
|
|
@@ -94,7 +114,9 @@ Most likely you need to [migrate to `@corva/dc-platform-shared`](https://www.not
|
|
|
94
114
|
```
|
|
95
115
|
|
|
96
116
|
#### Material UI styles are corrupted
|
|
117
|
+
|
|
97
118
|
Add the following parameter to the `config-overrides.js` file in your app
|
|
119
|
+
|
|
98
120
|
```
|
|
99
121
|
{
|
|
100
122
|
resolve: {
|
|
@@ -104,3 +126,17 @@ Add the following parameter to the `config-overrides.js` file in your app
|
|
|
104
126
|
}
|
|
105
127
|
}
|
|
106
128
|
```
|
|
129
|
+
|
|
130
|
+
### CI/CD
|
|
131
|
+
|
|
132
|
+
#### Stale workflow
|
|
133
|
+
|
|
134
|
+
To prevent pull request from piling up and save on resources, there is a [stale workflow](./.github/workflows/stale.yml)
|
|
135
|
+
running in this repository. It will automatically run on schedule to mark PR's that have not received any updates in 14
|
|
136
|
+
days as stale, marking them with label and leaving a comment. More importantly, preview environment for stale PRs are
|
|
137
|
+
removed. To "unstale" the PR, you either need to make any change to it, push new commit or just remove the `stale`
|
|
138
|
+
label.
|
|
139
|
+
If for some reason your PR does need to stay not stale for a long time, you can add `never-stale` label to it.
|
|
140
|
+
|
|
141
|
+
> [!IMPORTANT]
|
|
142
|
+
> Stale pull requests will be deleted after 180 days!
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react-virtualized"),t=require("@material-ui/core"),a=t.makeStyles({tableWrapper:{borderTop:"1px solid #5C5C5C",borderBottom:"1px solid #5C5C5C",width:"100%",height:"100%",overflow:"scroll"},table:{"& .ReactVirtualized__Table__headerRow":{textTransform:"none",border:"1px solid rgba(81, 81, 81, 1)"},"& .ReactVirtualized__Table__row":{border:"1px solid rgba(81, 81, 81, 1)"},"& .ReactVirtualized__Table__Grid":{outline:"none"},"& .ReactVirtualized__Table__headerColumn":{outline:"none"}},cell:{width:200}}),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react-virtualized"),t=require("@material-ui/core"),a=require("lodash"),i=t.makeStyles({tableWrapper:{borderTop:"1px solid #5C5C5C",borderBottom:"1px solid #5C5C5C",width:"100%",height:"100%",overflow:"scroll"},table:{"& .ReactVirtualized__Table__headerRow":{textTransform:"none",border:"1px solid rgba(81, 81, 81, 1)"},"& .ReactVirtualized__Table__row":{border:"1px solid rgba(81, 81, 81, 1)"},"& .ReactVirtualized__Table__Grid":{outline:"none"},"& .ReactVirtualized__Table__headerColumn":{outline:"none"}},cell:{width:200}}),l=function(r){var t=r.cellData,l=i();return e.jsx("div",{className:l.cell,children:a.isDate(t)?t.toISOString():t})};exports.CsvViewer=function(t){var a=t.fileData,n=i(),o=Object.keys(a[0]||{});return e.jsx("div",{className:n.tableWrapper,children:e.jsx(r.AutoSizer,{children:function(t){var i=t.height;return t.width,function(t){var i=t.height;return e.jsx(r.Table,{className:n.table,width:200*(o.length||10),height:i,headerHeight:40,rowHeight:50,rowCount:a.length,rowGetter:function(e){var r=e.index;return a[r]},children:o.map((function(t){return e.jsx(r.Column,{width:200,flexGrow:1,dataKey:t,label:t,cellRenderer:function(r){var t=r.cellData;return e.jsx(l,{cellData:t})}},t)}))})}({height:i})}})})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CsvViewer.d.ts","sourceRoot":"","sources":["../../../../src/components/NewDocumentViewer/components/CsvViewer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CsvViewer.d.ts","sourceRoot":"","sources":["../../../../src/components/NewDocumentViewer/components/CsvViewer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAwC1B,UAAU,cAAc;IACtB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;CACjC;AAED,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAgCvC,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{AutoSizer as r,Table as t,Column as a}from"react-virtualized";import{makeStyles as i}from"@material-ui/core";var
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{AutoSizer as r,Table as t,Column as a}from"react-virtualized";import{makeStyles as i}from"@material-ui/core";import{isDate as l}from"lodash";var o=i({tableWrapper:{borderTop:"1px solid #5C5C5C",borderBottom:"1px solid #5C5C5C",width:"100%",height:"100%",overflow:"scroll"},table:{"& .ReactVirtualized__Table__headerRow":{textTransform:"none",border:"1px solid rgba(81, 81, 81, 1)"},"& .ReactVirtualized__Table__row":{border:"1px solid rgba(81, 81, 81, 1)"},"& .ReactVirtualized__Table__Grid":{outline:"none"},"& .ReactVirtualized__Table__headerColumn":{outline:"none"}},cell:{width:200}}),n=function(r){var t=r.cellData,a=o();return e("div",{className:a.cell,children:l(t)?t.toISOString():t})},d=function(i){var l=i.fileData,d=o(),c=Object.keys(l[0]||{});return e("div",{className:d.tableWrapper,children:e(r,{children:function(r){var i=r.height;return r.width,function(r){var i=r.height;return e(t,{className:d.table,width:200*(c.length||10),height:i,headerHeight:40,rowHeight:50,rowCount:l.length,rowGetter:function(e){var r=e.index;return l[r]},children:c.map((function(r){return e(a,{width:200,flexGrow:1,dataKey:r,label:r,cellRenderer:function(r){var t=r.cellData;return e(n,{cellData:t})}},r)}))})}({height:i})}})})};export{d as CsvViewer};
|