@axelor/aos-mobile-quality 8.0.0
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 +44 -0
- package/lib/api/control-entry-api.d.ts +19 -0
- package/lib/api/control-entry-api.js +83 -0
- package/lib/api/control-entry-api.js.map +1 -0
- package/lib/api/control-entry-sample-api.d.ts +4 -0
- package/lib/api/control-entry-sample-api.js +37 -0
- package/lib/api/control-entry-sample-api.js.map +1 -0
- package/lib/api/control-entry-sample-line-api.d.ts +13 -0
- package/lib/api/control-entry-sample-line-api.js +96 -0
- package/lib/api/control-entry-sample-line-api.js.map +1 -0
- package/lib/api/control-plan-api.d.ts +3 -0
- package/lib/api/control-plan-api.js +26 -0
- package/lib/api/control-plan-api.js.map +1 -0
- package/lib/api/index.d.ts +4 -0
- package/lib/api/index.js +22 -0
- package/lib/api/index.js.map +1 -0
- package/lib/components/atoms/ControlEntryCard/ControlEntryCard.d.ts +11 -0
- package/lib/components/atoms/ControlEntryCard/ControlEntryCard.js +99 -0
- package/lib/components/atoms/ControlEntryCard/ControlEntryCard.js.map +1 -0
- package/lib/components/atoms/ControlEntryHeader/ControlEntryHeader.d.ts +2 -0
- package/lib/components/atoms/ControlEntryHeader/ControlEntryHeader.js +47 -0
- package/lib/components/atoms/ControlEntryHeader/ControlEntryHeader.js.map +1 -0
- package/lib/components/atoms/ControlEntrySampleCard/ControlEntrySampleCard.d.ts +8 -0
- package/lib/components/atoms/ControlEntrySampleCard/ControlEntrySampleCard.js +86 -0
- package/lib/components/atoms/ControlEntrySampleCard/ControlEntrySampleCard.js.map +1 -0
- package/lib/components/atoms/ControlEntrySampleLineHeader/ControlEntrySampleLineHeader.d.ts +2 -0
- package/lib/components/atoms/ControlEntrySampleLineHeader/ControlEntrySampleLineHeader.js +52 -0
- package/lib/components/atoms/ControlEntrySampleLineHeader/ControlEntrySampleLineHeader.js.map +1 -0
- package/lib/components/atoms/NavigationButton/NavigationButton.d.ts +7 -0
- package/lib/components/atoms/NavigationButton/NavigationButton.js +40 -0
- package/lib/components/atoms/NavigationButton/NavigationButton.js.map +1 -0
- package/lib/components/atoms/index.d.ts +5 -0
- package/lib/components/atoms/index.js +23 -0
- package/lib/components/atoms/index.js.map +1 -0
- package/lib/components/index.d.ts +2 -0
- package/lib/components/index.js +20 -0
- package/lib/components/index.js.map +1 -0
- package/lib/components/molecules/ControlEntryDetailsButtons/ControlEntryDetailsButtons.d.ts +2 -0
- package/lib/components/molecules/ControlEntryDetailsButtons/ControlEntryDetailsButtons.js +38 -0
- package/lib/components/molecules/ControlEntryDetailsButtons/ControlEntryDetailsButtons.js.map +1 -0
- package/lib/components/molecules/ControlEntryDetailsHeader/ControlEntryDetailsHeader.d.ts +5 -0
- package/lib/components/molecules/ControlEntryDetailsHeader/ControlEntryDetailsHeader.js +72 -0
- package/lib/components/molecules/ControlEntryDetailsHeader/ControlEntryDetailsHeader.js.map +1 -0
- package/lib/components/molecules/ControlEntryFormButtons/ControlEntryFormButtons.d.ts +12 -0
- package/lib/components/molecules/ControlEntryFormButtons/ControlEntryFormButtons.js +66 -0
- package/lib/components/molecules/ControlEntryFormButtons/ControlEntryFormButtons.js.map +1 -0
- package/lib/components/molecules/ControlEntryFormHeader/ControlEntryFormHeader.d.ts +8 -0
- package/lib/components/molecules/ControlEntryFormHeader/ControlEntryFormHeader.js +54 -0
- package/lib/components/molecules/ControlEntryFormHeader/ControlEntryFormHeader.js.map +1 -0
- package/lib/components/molecules/FillingMethodAlert/FillingMethodAlert.d.ts +8 -0
- package/lib/components/molecules/FillingMethodAlert/FillingMethodAlert.js +60 -0
- package/lib/components/molecules/FillingMethodAlert/FillingMethodAlert.js.map +1 -0
- package/lib/components/molecules/index.d.ts +5 -0
- package/lib/components/molecules/index.js +23 -0
- package/lib/components/molecules/index.js.map +1 -0
- package/lib/features/asyncFunctions-index.d.ts +4 -0
- package/lib/features/asyncFunctions-index.js +22 -0
- package/lib/features/asyncFunctions-index.js.map +1 -0
- package/lib/features/controlEntrySampleLineSlice.d.ts +26 -0
- package/lib/features/controlEntrySampleLineSlice.js +66 -0
- package/lib/features/controlEntrySampleLineSlice.js.map +1 -0
- package/lib/features/controlEntrySampleSlice.d.ts +16 -0
- package/lib/features/controlEntrySampleSlice.js +49 -0
- package/lib/features/controlEntrySampleSlice.js.map +1 -0
- package/lib/features/controlEntrySlice.d.ts +38 -0
- package/lib/features/controlEntrySlice.js +81 -0
- package/lib/features/controlEntrySlice.js.map +1 -0
- package/lib/features/controlPlanSlice.d.ts +14 -0
- package/lib/features/controlPlanSlice.js +48 -0
- package/lib/features/controlPlanSlice.js.map +1 -0
- package/lib/features/index.d.ts +4 -0
- package/lib/features/index.js +22 -0
- package/lib/features/index.js.map +1 -0
- package/lib/hooks/use-quality-header-actions.d.ts +1 -0
- package/lib/hooks/use-quality-header-actions.js +50 -0
- package/lib/hooks/use-quality-header-actions.js.map +1 -0
- package/lib/i18n/en.json +29 -0
- package/lib/i18n/fr.json +29 -0
- package/lib/index.d.ts +7 -0
- package/lib/index.js +60 -0
- package/lib/index.js.map +1 -0
- package/lib/models/index.d.ts +3 -0
- package/lib/models/index.js +21 -0
- package/lib/models/index.js.map +1 -0
- package/lib/models/objectFields.d.ts +2 -0
- package/lib/models/objectFields.js +51 -0
- package/lib/models/objectFields.js.map +1 -0
- package/lib/models/searchFields.d.ts +2 -0
- package/lib/models/searchFields.js +21 -0
- package/lib/models/searchFields.js.map +1 -0
- package/lib/models/sortFields.d.ts +2 -0
- package/lib/models/sortFields.js +26 -0
- package/lib/models/sortFields.js.map +1 -0
- package/lib/screens/ControlEntryDetailsScreen.d.ts +4 -0
- package/lib/screens/ControlEntryDetailsScreen.js +49 -0
- package/lib/screens/ControlEntryDetailsScreen.js.map +1 -0
- package/lib/screens/ControlEntryFormScreen.d.ts +5 -0
- package/lib/screens/ControlEntryFormScreen.js +190 -0
- package/lib/screens/ControlEntryFormScreen.js.map +1 -0
- package/lib/screens/ControlEntryListScreen.d.ts +4 -0
- package/lib/screens/ControlEntryListScreen.js +78 -0
- package/lib/screens/ControlEntryListScreen.js.map +1 -0
- package/lib/screens/index.d.ts +35 -0
- package/lib/screens/index.js +48 -0
- package/lib/screens/index.js.map +1 -0
- package/lib/types/controlEntry.d.ts +45 -0
- package/lib/types/controlEntry.js +155 -0
- package/lib/types/controlEntry.js.map +1 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.js +19 -0
- package/lib/types/index.js.map +1 -0
- package/package.json +50 -0
package/README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Quality
|
|
3
|
+
tags: Readme
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<h1 align="center">@axelor/aos-mobile-quality</h1>
|
|
7
|
+
|
|
8
|
+
<div align="center">
|
|
9
|
+
<img src="https://i.imgur.com/KJAAFlT.png" width="30%"/>
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
## Presentation
|
|
13
|
+
|
|
14
|
+
This package was developed for the [Axelor Open Mobile](https://github.com/axelor/axelor-mobile) application.
|
|
15
|
+
|
|
16
|
+
The purpose of this package is to link with the QUALITY module of the [Axelor Open Suite (AOS)](https://github.com/axelor/axelor-open-suite) ERP. It provides a simplified version of a number of processes available on the webapp. This package is compatible with AOS from version 8.0.0.
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
Install the library :
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
yarn add @axelor/aos-mobile-quality
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Compatibility with React v18.2.x and React Native v0.68.x.
|
|
27
|
+
|
|
28
|
+
To add this package in your application, you need to add it in the _modules_ props of the component `Application` from @axelor/aos-mobile-core package.
|
|
29
|
+
|
|
30
|
+
```javascript
|
|
31
|
+
import React from 'react';
|
|
32
|
+
import {Application} from '@axelor/aos-mobile-core';
|
|
33
|
+
import {QualityModule} from '@axelor/aos-mobile-quality';
|
|
34
|
+
|
|
35
|
+
const App = () => {
|
|
36
|
+
return <Application modules={[QualityModule]} mainMenu="auth_menu_user" />;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export default App;
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Developpment
|
|
43
|
+
|
|
44
|
+
This package is developed as part of the Axelor Open Mobile application. To contribute, please go to the [Github project](https://github.com/axelor/axelor-mobile) and follow the guidelines. You will also find an installation guide to help you configure your environment.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export function searchControlEntry({ searchValue, page, isInspector, userId, date, selectedStatus, }: {
|
|
2
|
+
searchValue?: any;
|
|
3
|
+
page?: number;
|
|
4
|
+
isInspector?: boolean;
|
|
5
|
+
userId?: any;
|
|
6
|
+
date?: any;
|
|
7
|
+
selectedStatus?: any;
|
|
8
|
+
}): Promise<any>;
|
|
9
|
+
export function fetchControlEntryById({ controlEntryId }: {
|
|
10
|
+
controlEntryId: any;
|
|
11
|
+
}): Promise<any>;
|
|
12
|
+
export function updateControlEntry({ controlEntry }: {
|
|
13
|
+
controlEntry: any;
|
|
14
|
+
}): Promise<any>;
|
|
15
|
+
export function getProgressValues({ controlEntryId, characteristicId, sampleId, }: {
|
|
16
|
+
controlEntryId: any;
|
|
17
|
+
characteristicId: any;
|
|
18
|
+
sampleId: any;
|
|
19
|
+
}): Promise<any>;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2024 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { axiosApiProvider, createStandardFetch, createStandardSearch, getEndOfDay, getSearchCriterias, getStartOfDay, } from '@axelor/aos-mobile-core';
|
|
19
|
+
const createControlEntryCriteria = (searchValue, isInspector, userId, date, selectedStatus) => {
|
|
20
|
+
const criteria = [getSearchCriterias('quality_controlEntry', searchValue)];
|
|
21
|
+
if (isInspector && userId != null) {
|
|
22
|
+
criteria.push({
|
|
23
|
+
fieldName: 'inspector.id',
|
|
24
|
+
operator: '=',
|
|
25
|
+
value: userId,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
if (Array.isArray(selectedStatus) && selectedStatus.length > 0) {
|
|
29
|
+
const statusCriteria = selectedStatus.map(_status => ({
|
|
30
|
+
fieldName: 'statusSelect',
|
|
31
|
+
operator: '=',
|
|
32
|
+
value: _status.key,
|
|
33
|
+
}));
|
|
34
|
+
criteria.push({ operator: 'OR', criteria: statusCriteria });
|
|
35
|
+
}
|
|
36
|
+
if (date != null) {
|
|
37
|
+
criteria.push({
|
|
38
|
+
fieldName: 'entryDateTime',
|
|
39
|
+
operator: '>=',
|
|
40
|
+
value: getStartOfDay(date).toISOString(),
|
|
41
|
+
}, {
|
|
42
|
+
fieldName: 'entryDateTime',
|
|
43
|
+
operator: '<=',
|
|
44
|
+
value: getEndOfDay(date).toISOString(),
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return criteria;
|
|
48
|
+
};
|
|
49
|
+
export async function searchControlEntry({ searchValue = null, page = 0, isInspector = false, userId = null, date = null, selectedStatus = null, }) {
|
|
50
|
+
return createStandardSearch({
|
|
51
|
+
model: 'com.axelor.apps.quality.db.ControlEntry',
|
|
52
|
+
criteria: createControlEntryCriteria(searchValue, isInspector, userId, date, selectedStatus),
|
|
53
|
+
fieldKey: 'quality_controlEntry',
|
|
54
|
+
sortKey: 'quality_controlEntry',
|
|
55
|
+
page: page,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
export async function fetchControlEntryById({ controlEntryId }) {
|
|
59
|
+
return createStandardFetch({
|
|
60
|
+
model: 'com.axelor.apps.quality.db.ControlEntry',
|
|
61
|
+
id: controlEntryId,
|
|
62
|
+
fieldKey: 'quality_controlEntry',
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
export async function updateControlEntry({ controlEntry }) {
|
|
66
|
+
return axiosApiProvider.post({
|
|
67
|
+
url: '/ws/rest/com.axelor.apps.quality.db.ControlEntry/',
|
|
68
|
+
data: {
|
|
69
|
+
data: controlEntry,
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
export async function getProgressValues({ controlEntryId, characteristicId, sampleId, }) {
|
|
74
|
+
return axiosApiProvider.post({
|
|
75
|
+
url: 'ws/aos/controlentry/progressValues',
|
|
76
|
+
data: {
|
|
77
|
+
controlEntryId,
|
|
78
|
+
characteristicId,
|
|
79
|
+
sampleId,
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=control-entry-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-entry-api.js","sourceRoot":"","sources":["../../src/api/control-entry-api.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,WAAW,EACX,kBAAkB,EAClB,aAAa,GACd,MAAM,yBAAyB,CAAC;AAEjC,MAAM,0BAA0B,GAAG,CACjC,WAAW,EACX,WAAW,EACX,MAAM,EACN,IAAI,EACJ,cAAc,EACd,EAAE;IACF,MAAM,QAAQ,GAAG,CAAC,kBAAkB,CAAC,sBAAsB,EAAE,WAAW,CAAC,CAAC,CAAC;IAE3E,IAA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c,CACf;QACD,QAAQ,EAAE,sBAAsB;QAChC,OAAO,EAAE,sBAAsB;QAC/B,IAAI,EAAE,IAAI;KACX,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,EAAC,cAAc,EAAC;IAC1D,OAAO,mBAAmB,CAAC;QACzB,KAAK,EAAE,yCAAyC;QAChD,EAAE,EAAE,cAAc;QAClB,QAAQ,EAAE,sBAAsB;KACjC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,EAAC,YAAY,EAAC;IACrD,OAAO,gBAAgB,CAAC,IAAI,CAAC;QAC3B,GAAG,EAAE,mDAAmD;QACxD,IAAI,EAAE;YACJ,IAAI,EAAE,YAAY;SACnB;KACF,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,EACtC,cAAc,EACd,gBAAgB,EAChB,QAAQ,GACT;IACC,OAAO,gBAAgB,CAAC,IAAI,CAAC;QAC3B,GAAG,EAAE,oCAAoC;QACzC,IAAI,EAAE;YACJ,cAAc;YACd,gBAAgB;YAChB,QAAQ;SACT;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2024 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { createStandardSearch } from '@axelor/aos-mobile-core';
|
|
19
|
+
const createControlEntrySampleCriteria = controlEntryId => {
|
|
20
|
+
return [
|
|
21
|
+
{
|
|
22
|
+
fieldName: 'controlEntry.id',
|
|
23
|
+
operator: '=',
|
|
24
|
+
value: controlEntryId,
|
|
25
|
+
},
|
|
26
|
+
];
|
|
27
|
+
};
|
|
28
|
+
export async function searchControlEntrySample({ page = 0, controlEntryId }) {
|
|
29
|
+
return createStandardSearch({
|
|
30
|
+
model: 'com.axelor.apps.quality.db.ControlEntrySample',
|
|
31
|
+
criteria: createControlEntrySampleCriteria(controlEntryId),
|
|
32
|
+
fieldKey: 'quality_controlEntrySample',
|
|
33
|
+
sortKey: 'quality_controlEntrySample',
|
|
34
|
+
page: page,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=control-entry-sample-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-entry-sample-api.js","sourceRoot":"","sources":["../../src/api/control-entry-sample-api.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,oBAAoB,EAAC,MAAM,yBAAyB,CAAC;AAE7D,MAAM,gCAAgC,GAAG,cAAc,CAAC,EAAE;IACxD,OAAO;QACL;YACE,SAAS,EAAE,iBAAiB;YAC5B,QAAQ,EAAE,GAAG;YACb,KAAK,EAAE,cAAc;SACtB;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,EAAC,IAAI,GAAG,CAAC,EAAE,cAAc,EAAC;IACvE,OAAO,oBAAoB,CAAC;QAC1B,KAAK,EAAE,+CAA+C;QACtD,QAAQ,EAAE,gCAAgC,CAAC,cAAc,CAAC;QAC1D,QAAQ,EAAE,4BAA4B;QACtC,OAAO,EAAE,4BAA4B;QACrC,IAAI,EAAE,IAAI;KACX,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function searchControlEntrySampleLine({ page, controlEntrySampleId, }: {
|
|
2
|
+
page?: number;
|
|
3
|
+
controlEntrySampleId: any;
|
|
4
|
+
}): Promise<any>;
|
|
5
|
+
export function searchControlEntrySampleLineOfControlEntry({ controlEntryId, }: {
|
|
6
|
+
controlEntryId: any;
|
|
7
|
+
}): Promise<any>;
|
|
8
|
+
export function fetchControlEntrySampleLine({ id }: {
|
|
9
|
+
id: any;
|
|
10
|
+
}): Promise<any>;
|
|
11
|
+
export function checkComformity({ object }: {
|
|
12
|
+
object: any;
|
|
13
|
+
}): Promise<any>;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2024 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { createStandardSearch, createStandardFetch, axiosApiProvider, } from '@axelor/aos-mobile-core';
|
|
19
|
+
import { ControlEntry } from '../types';
|
|
20
|
+
const createControlEntrySampleLineCriteria = controlEntrySampleId => {
|
|
21
|
+
return [
|
|
22
|
+
{
|
|
23
|
+
fieldName: 'controlEntrySample.id',
|
|
24
|
+
operator: '=',
|
|
25
|
+
value: controlEntrySampleId,
|
|
26
|
+
},
|
|
27
|
+
];
|
|
28
|
+
};
|
|
29
|
+
export async function searchControlEntrySampleLine({ page = 0, controlEntrySampleId, }) {
|
|
30
|
+
return createStandardSearch({
|
|
31
|
+
model: 'com.axelor.apps.quality.db.ControlEntryPlanLine',
|
|
32
|
+
criteria: createControlEntrySampleLineCriteria(controlEntrySampleId),
|
|
33
|
+
fieldKey: 'quality_controlEntrySampleLine',
|
|
34
|
+
sortKey: 'quality_controlEntrySampleLine',
|
|
35
|
+
page: page,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
const createSampleLineOfControlEntryCriteria = controlEntryId => {
|
|
39
|
+
return [
|
|
40
|
+
{
|
|
41
|
+
fieldName: 'controlEntrySample.controlEntry.id',
|
|
42
|
+
operator: '=',
|
|
43
|
+
value: controlEntryId,
|
|
44
|
+
},
|
|
45
|
+
];
|
|
46
|
+
};
|
|
47
|
+
export async function searchControlEntrySampleLineOfControlEntry({ controlEntryId, }) {
|
|
48
|
+
return createStandardSearch({
|
|
49
|
+
model: 'com.axelor.apps.quality.db.ControlEntryPlanLine',
|
|
50
|
+
criteria: createSampleLineOfControlEntryCriteria(controlEntryId),
|
|
51
|
+
fieldKey: 'quality_controlEntrySampleLine',
|
|
52
|
+
sortKey: 'quality_controlEntrySampleLine',
|
|
53
|
+
numberElementsByPage: null,
|
|
54
|
+
page: 0,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
export async function fetchControlEntrySampleLine({ id }) {
|
|
58
|
+
return createStandardFetch({
|
|
59
|
+
model: 'com.axelor.apps.quality.db.ControlEntryPlanLine',
|
|
60
|
+
id,
|
|
61
|
+
fieldKey: 'quality_controlEntrySampleLine',
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
export async function checkComformity({ object }) {
|
|
65
|
+
return axiosApiProvider
|
|
66
|
+
.post({
|
|
67
|
+
url: 'ws/action',
|
|
68
|
+
data: {
|
|
69
|
+
action: 'action-quality-control-entry-line-method-control-conformity',
|
|
70
|
+
data: {
|
|
71
|
+
context: {
|
|
72
|
+
...object,
|
|
73
|
+
_model: 'com.axelor.apps.quality.db.ControlEntryPlanLine',
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
model: 'com.axelor.apps.quality.db.ControlEntryPlanLine',
|
|
77
|
+
},
|
|
78
|
+
})
|
|
79
|
+
.then(() => createStandardFetch({
|
|
80
|
+
model: 'com.axelor.apps.quality.db.ControlEntryPlanLine',
|
|
81
|
+
id: object.id,
|
|
82
|
+
fieldKey: 'quality_controlEntrySampleLine',
|
|
83
|
+
}))
|
|
84
|
+
.then(({ data: { data } }) => {
|
|
85
|
+
if (data?.[0] != null) {
|
|
86
|
+
return data[0].resultSelect;
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
return ControlEntry.sampleResult.NotControlled;
|
|
90
|
+
}
|
|
91
|
+
})
|
|
92
|
+
.catch(() => {
|
|
93
|
+
return ControlEntry.sampleResult.NotControlled;
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=control-entry-sample-line-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-entry-sample-line-api.js","sourceRoot":"","sources":["../../src/api/control-entry-sample-line-api.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,YAAY,EAAC,MAAM,UAAU,CAAC;AAEtC,MAAM,oCAAoC,GAAG,oBAAoB,CAAC,EAAE;IAClE,OAAO;QACL;YACE,SAAS,EAAE,uBAAuB;YAClC,QAAQ,EAAE,GAAG;YACb,KAAK,EAAE,oBAAoB;SAC5B;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAAC,EACjD,IAAI,GAAG,CAAC,EAC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,KAAK,EAAE,iDAAiD;QACxD,EAAE,EAAE,MAAM,CAAC,EAAE;QACb,QAAQ,EAAE,gCAAgC;KAC3C,CAAC,CACH;SACA,IAAI,CAAC,CAAC,EAAC,IAAI,EAAE,EAAC,IAAI,EAAC,EAAC,EAAE,EAAE;QACvB,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE;YACrB,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC;SAC7B;aAAM;YACL,OAAO,YAAY,CAAC,YAAY,CAAC,aAAa,CAAC;SAChD;IACH,CAAC,CAAC;SACD,KAAK,CAAC,GAAG,EAAE;QACV,OAAO,YAAY,CAAC,YAAY,CAAC,aAAa,CAAC;IACjD,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2024 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { createStandardFetch } from '@axelor/aos-mobile-core';
|
|
19
|
+
export async function fetchControlPlanById({ id }) {
|
|
20
|
+
return createStandardFetch({
|
|
21
|
+
model: 'com.axelor.apps.quality.db.ControlPlan',
|
|
22
|
+
id,
|
|
23
|
+
fieldKey: 'quality_controlPlan',
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=control-plan-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-plan-api.js","sourceRoot":"","sources":["../../src/api/control-plan-api.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,mBAAmB,EAAC,MAAM,yBAAyB,CAAC;AAE5D,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,EAAC,EAAE,EAAC;IAC7C,OAAO,mBAAmB,CAAC;QACzB,KAAK,EAAE,wCAAwC;QAC/C,EAAE;QACF,QAAQ,EAAE,qBAAqB;KAChC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { fetchControlEntryById as fetchControlEntryByIdApi, searchControlEntry as searchControlEntryApi, updateControlEntry as updateControlEntryApi, getProgressValues as getProgressValuesApi, } from './control-entry-api';
|
|
2
|
+
export { searchControlEntrySample as searchControlEntrySampleApi } from './control-entry-sample-api';
|
|
3
|
+
export { checkComformity, fetchControlEntrySampleLine as fetchControlEntrySampleLineApi, searchControlEntrySampleLine as searchControlEntrySampleLineApi, searchControlEntrySampleLineOfControlEntry as searchControlEntrySampleLineOfControlEntryApi, } from './control-entry-sample-line-api';
|
|
4
|
+
export { fetchControlPlanById as fetchControlPlanByIdApi } from './control-plan-api';
|
package/lib/api/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2024 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
export { fetchControlEntryById as fetchControlEntryByIdApi, searchControlEntry as searchControlEntryApi, updateControlEntry as updateControlEntryApi, getProgressValues as getProgressValuesApi, } from './control-entry-api';
|
|
19
|
+
export { searchControlEntrySample as searchControlEntrySampleApi } from './control-entry-sample-api';
|
|
20
|
+
export { checkComformity, fetchControlEntrySampleLine as fetchControlEntrySampleLineApi, searchControlEntrySampleLine as searchControlEntrySampleLineApi, searchControlEntrySampleLineOfControlEntry as searchControlEntrySampleLineOfControlEntryApi, } from './control-entry-sample-line-api';
|
|
21
|
+
export { fetchControlPlanById as fetchControlPlanByIdApi } from './control-plan-api';
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,qBAAqB,IAAI,wBAAwB,EACjD,kBAAkB,IAAI,qBAAqB,EAC3C,kBAAkB,IAAI,qBAAqB,EAC3C,iBAAiB,IAAI,oBAAoB,GAC1C,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAC,wBAAwB,IAAI,2BAA2B,EAAC,MAAM,4BAA4B,CAAC;AACnG,OAAO,EACL,eAAe,EACf,2BAA2B,IAAI,8BAA8B,EAC7D,4BAA4B,IAAI,+BAA+B,EAC/D,0CAA0C,IAAI,6CAA6C,GAC5F,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAC,oBAAoB,IAAI,uBAAuB,EAAC,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface ControlEntryCardProps {
|
|
2
|
+
style?: any;
|
|
3
|
+
onPress?: () => void;
|
|
4
|
+
sampleCount?: number;
|
|
5
|
+
entryDateTime?: string;
|
|
6
|
+
statusSelect?: number;
|
|
7
|
+
name?: string;
|
|
8
|
+
controlEntryId?: number;
|
|
9
|
+
}
|
|
10
|
+
declare const ControlEntryCard: ({ style, onPress, sampleCount, entryDateTime, statusSelect, name, controlEntryId, }: ControlEntryCardProps) => JSX.Element;
|
|
11
|
+
export default ControlEntryCard;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2024 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
19
|
+
import { StyleSheet, TouchableOpacity, View } from 'react-native';
|
|
20
|
+
import { Card, ProgressBar, Text, useThemeColor } from '@axelor/aos-mobile-ui';
|
|
21
|
+
import { useTranslator, DateDisplay } from '@axelor/aos-mobile-core';
|
|
22
|
+
import { ControlEntry } from '../../../types';
|
|
23
|
+
import { searchControlEntrySampleApi } from '../../../api';
|
|
24
|
+
const ControlEntryCard = ({ style, onPress, sampleCount, entryDateTime, statusSelect, name, controlEntryId, }) => {
|
|
25
|
+
const Colors = useThemeColor();
|
|
26
|
+
const I18n = useTranslator();
|
|
27
|
+
const isMounted = useRef(true);
|
|
28
|
+
const [numberSampleFilled, setNumberSampleFilled] = useState(0);
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
isMounted.current = true;
|
|
31
|
+
searchControlEntrySampleApi({ controlEntryId: controlEntryId })
|
|
32
|
+
.then(response => {
|
|
33
|
+
if (isMounted.current) {
|
|
34
|
+
if (Array.isArray(response?.data?.data)) {
|
|
35
|
+
const controlEntrySampleList = response.data.data;
|
|
36
|
+
const total = controlEntrySampleList.length;
|
|
37
|
+
const notControlled = controlEntrySampleList.filter(sample => sample.resultSelect === ControlEntry.sampleResult.NotControlled).length;
|
|
38
|
+
setNumberSampleFilled(100 - (notControlled / total) * 100);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
setNumberSampleFilled(0);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
.catch(() => {
|
|
46
|
+
if (isMounted.current) {
|
|
47
|
+
setNumberSampleFilled(0);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
return () => {
|
|
51
|
+
isMounted.current = false;
|
|
52
|
+
};
|
|
53
|
+
}, [controlEntryId]);
|
|
54
|
+
const borderStyle = useMemo(() => {
|
|
55
|
+
return getStyles(ControlEntry.getStatusColor(statusSelect, Colors)?.background)?.border;
|
|
56
|
+
}, [Colors, statusSelect]);
|
|
57
|
+
return (<TouchableOpacity onPress={onPress} activeOpacity={0.9}>
|
|
58
|
+
<Card style={[styles.container, borderStyle, style]}>
|
|
59
|
+
<View style={styles.childrenContainer}>
|
|
60
|
+
<Text writingType="title">{name}</Text>
|
|
61
|
+
<DateDisplay date={entryDateTime}/>
|
|
62
|
+
</View>
|
|
63
|
+
<View style={styles.childrenContainer}>
|
|
64
|
+
<Text>{`${I18n.t('Quality_SampleCount')} : ${sampleCount}`}</Text>
|
|
65
|
+
<ProgressBar style={styles.progressBar} value={numberSampleFilled} showPercent={false} height={15} styleTxt={styles.textProgressBar}/>
|
|
66
|
+
</View>
|
|
67
|
+
</Card>
|
|
68
|
+
</TouchableOpacity>);
|
|
69
|
+
};
|
|
70
|
+
const getStyles = (color) => StyleSheet.create({
|
|
71
|
+
border: {
|
|
72
|
+
borderLeftWidth: 7,
|
|
73
|
+
borderLeftColor: color,
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
const styles = StyleSheet.create({
|
|
77
|
+
container: {
|
|
78
|
+
marginHorizontal: 12,
|
|
79
|
+
marginVertical: 4,
|
|
80
|
+
paddingHorizontal: 15,
|
|
81
|
+
paddingRight: 15,
|
|
82
|
+
paddingVertical: 10,
|
|
83
|
+
},
|
|
84
|
+
childrenContainer: {
|
|
85
|
+
flexDirection: 'row',
|
|
86
|
+
alignItems: 'center',
|
|
87
|
+
marginVertical: 5,
|
|
88
|
+
justifyContent: 'space-between',
|
|
89
|
+
},
|
|
90
|
+
progressBar: {
|
|
91
|
+
borderRadius: 20,
|
|
92
|
+
width: '40%',
|
|
93
|
+
},
|
|
94
|
+
textProgressBar: {
|
|
95
|
+
display: 'none',
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
export default ControlEntryCard;
|
|
99
|
+
//# sourceMappingURL=ControlEntryCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ControlEntryCard.js","sourceRoot":"","sources":["../../../../src/components/atoms/ControlEntryCard/ControlEntryCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAClE,OAAO,EAAC,UAAU,EAAE,gBAAgB,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAChE,OAAO,EAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,aAAa,EAAC,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAC,aAAa,EAAE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B,WAAW,CAAC,CAAC,KAAK,CAAC,CACnB,MAAM,CAAC,CAAC,EAAE,CAAC,CACX,QAAQ,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,EAErC;QAAA,EAAE,IAAI,CACR;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,gBAAgB,CAAC,CACpB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,KAAa,EAAE,EAAE,CAClC,UAAU,CAAC,MAAM,CAAC;IAChB,MAAM,EAAE;QACN,eAAe,EAAE,CAAC;QAClB,eAAe,EAAE,KAAK;KACvB;CACF,CAAC,CAAC;AAEL,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,gBAAgB,EAAE,EAAE;QACpB,cAAc,EAAE,CAAC;QACjB,iBAAiB,EAAE,EAAE;QACrB,YAAY,EAAE,EAAE;QAChB,eAAe,EAAE,EAAE;KACpB;IACD,iBAAiB,EAAE;QACjB,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,CAAC;QACjB,cAAc,EAAE,eAAe;KAChC;IACD,WAAW,EAAE;QACX,YAAY,EAAE,EAAE;QAChB,KAAK,EAAE,KAAK;KACb;IACD,eAAe,EAAE;QACf,OAAO,EAAE,MAAM;KAChB;CACF,CAAC,CAAC;AAEH,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2024 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import React from 'react';
|
|
19
|
+
import { StyleSheet, View } from 'react-native';
|
|
20
|
+
import { DateDisplay, useSelector, useTranslator } from '@axelor/aos-mobile-core';
|
|
21
|
+
import { Badge, Text, useThemeColor } from '@axelor/aos-mobile-ui';
|
|
22
|
+
import { ControlEntry } from '../../../types';
|
|
23
|
+
const ControlEntryHeader = ({}) => {
|
|
24
|
+
const I18n = useTranslator();
|
|
25
|
+
const Colors = useThemeColor();
|
|
26
|
+
const { controlEntry } = useSelector((state) => state.controlEntry);
|
|
27
|
+
return (<View>
|
|
28
|
+
<View style={styles.row}>
|
|
29
|
+
<Text writingType="title">{controlEntry.name}</Text>
|
|
30
|
+
<Badge color={ControlEntry.getStatusColor(controlEntry.statusSelect, Colors)} title={ControlEntry.getStatus(controlEntry.statusSelect, I18n)}/>
|
|
31
|
+
</View>
|
|
32
|
+
<View style={styles.row}>
|
|
33
|
+
<Text>{`${I18n.t('Quality_SampleCount')} : ${controlEntry.sampleCount}`}</Text>
|
|
34
|
+
<DateDisplay date={controlEntry.entryDateTime}/>
|
|
35
|
+
</View>
|
|
36
|
+
<Text>{`${I18n.t('Quality_ControlPlan')} : ${controlEntry.controlPlan?.name}`}</Text>
|
|
37
|
+
</View>);
|
|
38
|
+
};
|
|
39
|
+
const styles = StyleSheet.create({
|
|
40
|
+
row: {
|
|
41
|
+
justifyContent: 'space-between',
|
|
42
|
+
flexDirection: 'row',
|
|
43
|
+
alignItems: 'center',
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
export default ControlEntryHeader;
|
|
47
|
+
//# sourceMappingURL=ControlEntryHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version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AAC,qBAAqB,CAAC,MACrC,YAAY,CAAC,WACf,EAAE,CAAC,EAAE,IAAI,CACT;QAAA,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,aAAa,CAAC,EAChD;MAAA,EAAE,IAAI,CACN;MAAA,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,qBAAqB,CAAC,MACrC,YAAY,CAAC,WAAW,EAAE,IAC5B,EAAE,CAAC,EAAE,IAAI,CACX;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,GAAG,EAAE;QACH,cAAc,EAAE,eAAe;QAC/B,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,QAAQ;KACrB;CACF,CAAC,CAAC;AAEH,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface ControlEntrySampleCardProps {
|
|
2
|
+
style?: any;
|
|
3
|
+
controlEntrySampleId: number;
|
|
4
|
+
resultSelect: number;
|
|
5
|
+
samplefullName: string;
|
|
6
|
+
}
|
|
7
|
+
declare const ControlEntrySampleCard: ({ style, controlEntrySampleId, resultSelect, samplefullName, }: ControlEntrySampleCardProps) => JSX.Element;
|
|
8
|
+
export default ControlEntrySampleCard;
|