code7-leia 0.2.30 → 0.2.33
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/dist/code7-leia.cjs.development.js +12 -6
- package/dist/code7-leia.cjs.development.js.map +1 -1
- package/dist/code7-leia.cjs.production.min.js +1 -1
- package/dist/code7-leia.cjs.production.min.js.map +1 -1
- package/dist/code7-leia.esm.js +12 -6
- package/dist/code7-leia.esm.js.map +1 -1
- package/dist/contexts/SharedPropsProvider.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/FileArea/components/Table/styles.tsx +1 -0
- package/src/components/FileArea/index.tsx +4 -4
- package/src/components/FileArea/styles.tsx +6 -1
- package/src/components/TestArea/index.tsx +2 -2
- package/src/contexts/SharedPropsProvider.tsx +2 -1
- package/src/index.tsx +2 -1
package/dist/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -23,7 +23,7 @@ import { SharedPropsProvider, useSharedProps } from '../../contexts/SharedPropsP
|
|
|
23
23
|
import { deleteFilesAction, getFilesAction, uploadFilesAction, trainingAction } from '../../store/modules/actions';
|
|
24
24
|
|
|
25
25
|
export const FileArea = () => {
|
|
26
|
-
const { id, language, propTags, token, env } = useSharedProps();
|
|
26
|
+
const { id, language, propTags, token, env, readonly } = useSharedProps();
|
|
27
27
|
const [files, setFiles] = useState<FileData[]>([]);
|
|
28
28
|
const [initialFiles, setInitialFiles] = useState<FileData[]>([]);
|
|
29
29
|
const [uploadFile, setUploadFile] = useState<{ content: ArrayBuffer | string; properties: File }>();
|
|
@@ -145,8 +145,8 @@ export const FileArea = () => {
|
|
|
145
145
|
<div className='actions'>
|
|
146
146
|
<Search placeholder={t.fileArea.search} setFiles={setFiles} initialFiles={initialFiles}></Search>
|
|
147
147
|
<div>
|
|
148
|
-
<button id='button-upload' onClick={handleOpenModal}><FaUpload size={14} /> {t.fileArea.fileUpload}</button>
|
|
149
|
-
<button onClick={() => handleOpenModalTraining(undefined)}><GiWeightLiftingUp size={14} /> {t.fileArea.training}</button>
|
|
148
|
+
<button id='button-upload' onClick={handleOpenModal} disabled={readonly}><FaUpload size={14} /> {t.fileArea.fileUpload}</button>
|
|
149
|
+
<button onClick={() => handleOpenModalTraining(undefined)} disabled={readonly}><GiWeightLiftingUp size={14} /> {t.fileArea.training}</button>
|
|
150
150
|
</div>
|
|
151
151
|
</div>
|
|
152
152
|
</S.Header>
|
|
@@ -272,7 +272,7 @@ export const FileArea = () => {
|
|
|
272
272
|
}
|
|
273
273
|
|
|
274
274
|
return (
|
|
275
|
-
<SharedPropsProvider id={id} language={language} token={token} env={env} propTags={{ tags: [] }} personas={[{name: '', description: ''}]}>
|
|
275
|
+
<SharedPropsProvider readonly={readonly} id={id} language={language} token={token} env={env} propTags={{ tags: [] }} personas={[{name: '', description: ''}]}>
|
|
276
276
|
<S.Container>
|
|
277
277
|
{renderFiles()}
|
|
278
278
|
</S.Container>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import styled, { css }
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
2
|
|
|
3
3
|
interface ContainerProps {
|
|
4
4
|
isloading?: boolean;
|
|
@@ -162,6 +162,11 @@ export const Header = styled.div`
|
|
|
162
162
|
padding: 10px 20px;
|
|
163
163
|
color: white;
|
|
164
164
|
border-radius: 4px;
|
|
165
|
+
|
|
166
|
+
&:disabled {
|
|
167
|
+
cursor: not-allowed;
|
|
168
|
+
opacity: 0.5;
|
|
169
|
+
}
|
|
165
170
|
}
|
|
166
171
|
}
|
|
167
172
|
|
|
@@ -13,7 +13,7 @@ import { useDispatch, useSelector } from 'react-redux';
|
|
|
13
13
|
import { testAction } from '../../store/modules/actions';
|
|
14
14
|
|
|
15
15
|
export const TestArea = () => {
|
|
16
|
-
const { id, language, personas, propTags, token, env } = useSharedProps();
|
|
16
|
+
const { id, language, personas, propTags, token, env, readonly } = useSharedProps();
|
|
17
17
|
const t = getLanguage(language)
|
|
18
18
|
const results = useSelector((state: any) => state.message);
|
|
19
19
|
const isloading = useSelector((state: any) => state.isloading);
|
|
@@ -92,7 +92,7 @@ export const TestArea = () => {
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
return (
|
|
95
|
-
<SharedPropsProvider id={id} token={token} language={language} env={env} propTags={{ tags: [] }} personas={[{name: '', description: ''}]}>
|
|
95
|
+
<SharedPropsProvider id={id} token={token} readonly={readonly} language={language} env={env} propTags={{ tags: [] }} personas={[{name: '', description: ''}]}>
|
|
96
96
|
<S.Container>
|
|
97
97
|
{returnTest()}
|
|
98
98
|
</S.Container>
|
|
@@ -4,8 +4,9 @@ import { getApi } from '../utils/getApi';
|
|
|
4
4
|
interface Props {
|
|
5
5
|
id: string;
|
|
6
6
|
language: "en" | "pt-br" | "es";
|
|
7
|
-
propTags: { tags: [] }
|
|
7
|
+
propTags: { tags: [] };
|
|
8
8
|
personas: [{ name: string, description: string }];
|
|
9
|
+
readonly: boolean;
|
|
9
10
|
token: string;
|
|
10
11
|
env: string;
|
|
11
12
|
children?: React.ReactNode;
|