@axelor/aos-mobile-helpdesk 7.1.2 → 7.2.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/lib/api/customer-api.js +3 -0
- package/lib/api/customer-api.js.map +1 -1
- package/lib/api/index.d.ts +0 -1
- package/lib/api/index.js +0 -1
- package/lib/api/index.js.map +1 -1
- package/lib/components/molecules/DurationFormInput/DurationFormInput.d.ts +5 -3
- package/lib/components/molecules/DurationFormInput/DurationFormInput.js +5 -5
- package/lib/components/molecules/DurationFormInput/DurationFormInput.js.map +1 -1
- package/lib/components/molecules/ProgressFormInput/ProgressFormInput.d.ts +3 -2
- package/lib/components/molecules/ProgressFormInput/ProgressFormInput.js +2 -2
- package/lib/components/molecules/ProgressFormInput/ProgressFormInput.js.map +1 -1
- package/lib/components/molecules/TicketCard/TicketCard.js +48 -48
- package/lib/components/molecules/TicketCard/TicketCard.js.map +1 -1
- package/lib/components/templates/ContactPartnerSearchBar/ContactPartnerSearchBar.d.ts +5 -5
- package/lib/components/templates/ContactPartnerSearchBar/ContactPartnerSearchBar.js +32 -13
- package/lib/components/templates/ContactPartnerSearchBar/ContactPartnerSearchBar.js.map +1 -1
- package/lib/components/templates/CustomerSearchBar/CustomerSearchBar.d.ts +5 -5
- package/lib/components/templates/CustomerSearchBar/CustomerSearchBar.js +2 -2
- package/lib/components/templates/CustomerSearchBar/CustomerSearchBar.js.map +1 -1
- package/lib/components/templates/ProjectSearchBar/ProjectSearchBar.d.ts +5 -6
- package/lib/components/templates/ProjectSearchBar/ProjectSearchBar.js +2 -2
- package/lib/components/templates/ProjectSearchBar/ProjectSearchBar.js.map +1 -1
- package/lib/components/templates/TicketPriorityPicker/TicketPriorityPicker.d.ts +9 -0
- package/lib/components/templates/TicketPriorityPicker/TicketPriorityPicker.js +28 -0
- package/lib/components/templates/TicketPriorityPicker/TicketPriorityPicker.js.map +1 -0
- package/lib/components/templates/TicketStopwatch/TicketStopwatch.js +2 -2
- package/lib/components/templates/TicketStopwatch/TicketStopwatch.js.map +1 -1
- package/lib/components/templates/TicketTypeSearchBar/TicketTypeSearchBar.d.ts +5 -5
- package/lib/components/templates/TicketTypeSearchBar/TicketTypeSearchBar.js +2 -2
- package/lib/components/templates/TicketTypeSearchBar/TicketTypeSearchBar.js.map +1 -1
- package/lib/components/templates/TicketsStatusButton/TicketsStatusButton.js +3 -3
- package/lib/components/templates/TicketsStatusButton/TicketsStatusButton.js.map +1 -1
- package/lib/components/templates/index.d.ts +1 -1
- package/lib/components/templates/index.js +1 -1
- package/lib/components/templates/index.js.map +1 -1
- package/lib/features/asyncFunctions-index.d.ts +0 -1
- package/lib/features/asyncFunctions-index.js +0 -1
- package/lib/features/asyncFunctions-index.js.map +1 -1
- package/lib/features/customerSlice.d.ts +1 -1
- package/lib/features/customerSlice.js +2 -6
- package/lib/features/customerSlice.js.map +1 -1
- package/lib/features/index.d.ts +0 -1
- package/lib/features/index.js +0 -1
- package/lib/features/index.js.map +1 -1
- package/lib/i18n/en.json +0 -1
- package/lib/i18n/fr.json +0 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/models/forms.d.ts +2 -0
- package/lib/models/forms.js +133 -0
- package/lib/models/forms.js.map +1 -0
- package/lib/models/index.d.ts +1 -0
- package/lib/models/index.js +1 -0
- package/lib/models/index.js.map +1 -1
- package/lib/models/objectFields.js +0 -3
- package/lib/models/objectFields.js.map +1 -1
- package/lib/models/searchFields.js +0 -1
- package/lib/models/searchFields.js.map +1 -1
- package/lib/models/sortFields.js +0 -1
- package/lib/models/sortFields.js.map +1 -1
- package/lib/screens/TicketDetailsScreen.js +9 -7
- package/lib/screens/TicketDetailsScreen.js.map +1 -1
- package/lib/screens/TicketFormScreen.js +48 -82
- package/lib/screens/TicketFormScreen.js.map +1 -1
- package/package.json +3 -3
- package/lib/api/user-api.d.ts +0 -4
- package/lib/api/user-api.js +0 -31
- package/lib/api/user-api.js.map +0 -1
- package/lib/components/templates/UserSearchBar/UserSearchBar.d.ts +0 -14
- package/lib/components/templates/UserSearchBar/UserSearchBar.js +0 -33
- package/lib/components/templates/UserSearchBar/UserSearchBar.js.map +0 -1
- package/lib/features/userSlice.d.ts +0 -16
- package/lib/features/userSlice.js +0 -49
- package/lib/features/userSlice.js.map +0 -1
|
@@ -15,99 +15,65 @@
|
|
|
15
15
|
* You should have received a copy of the GNU Affero General Public License
|
|
16
16
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
|
-
import React, {
|
|
19
|
-
import {
|
|
20
|
-
import { Button, FormInput, KeyboardAvoidingScrollView, Picker, Screen, useThemeColor, FormHtmlInput, checkNullString, } from '@axelor/aos-mobile-ui';
|
|
21
|
-
import { useSelector, useDispatch, useTranslator, DateInput, } from '@axelor/aos-mobile-core';
|
|
18
|
+
import React, { useCallback, useMemo, useEffect } from 'react';
|
|
19
|
+
import { useSelector, useDispatch, FormView } from '@axelor/aos-mobile-core';
|
|
22
20
|
import { createTicket, updateTicket } from '../features/ticketSlice';
|
|
23
|
-
import {
|
|
24
|
-
import { Ticket } from '../types/';
|
|
25
|
-
const PROJECT_KEY = 'project';
|
|
26
|
-
const CUSTOMER_KEY = 'customerPartner';
|
|
27
|
-
const CONTACT_KEY = 'contactPartner';
|
|
28
|
-
const DEFAULT_TICKET_VALUE = { duration: 0 };
|
|
29
|
-
const isObjectMissingRequiredField = object => checkNullString(object?.subject);
|
|
21
|
+
import { getCustomerbyId } from '../features/customerSlice';
|
|
30
22
|
const TicketFormScreen = ({ navigation, route }) => {
|
|
31
23
|
const idTicket = route?.params?.idTicket;
|
|
32
|
-
const
|
|
33
|
-
const I18n = useTranslator();
|
|
34
|
-
const Colors = useThemeColor();
|
|
24
|
+
const _dispatch = useDispatch();
|
|
35
25
|
const { ticket } = useSelector(state => state.ticket);
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
});
|
|
26
|
+
const defaultValue = useMemo(() => {
|
|
27
|
+
const _default = {
|
|
28
|
+
duration: 0,
|
|
29
|
+
};
|
|
30
|
+
if (idTicket != null) {
|
|
31
|
+
return {
|
|
32
|
+
...ticket,
|
|
33
|
+
duration: ticket.duration || _default.duration,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
return _default;
|
|
37
|
+
}, [idTicket, ticket]);
|
|
38
|
+
const createTicketAPI = useCallback((_ticket, dispatch) => {
|
|
39
|
+
dispatch(createTicket({
|
|
40
|
+
ticket: _ticket,
|
|
41
|
+
}));
|
|
52
42
|
}, []);
|
|
53
|
-
const updateTicketAPI = useCallback(() => {
|
|
43
|
+
const updateTicketAPI = useCallback((_ticket, dispatch) => {
|
|
54
44
|
dispatch(updateTicket({
|
|
55
45
|
ticket: _ticket,
|
|
56
46
|
}));
|
|
57
47
|
navigation.navigate('TicketDetailsScreen', {
|
|
58
48
|
idTicket: _ticket.id,
|
|
59
49
|
});
|
|
60
|
-
}, [
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
</KeyboardAvoidingScrollView>
|
|
88
|
-
<View style={styles.button_container}>
|
|
89
|
-
<Button title={I18n.t('Base_Save')} onPress={idTicket != null ? updateTicketAPI : createTicketAPI} disabled={disabledButton} color={disabledButton ? Colors.secondaryColor : Colors.primaryColor}/>
|
|
90
|
-
</View>
|
|
91
|
-
</Screen>);
|
|
50
|
+
}, [navigation]);
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
_dispatch(getCustomerbyId(null));
|
|
53
|
+
}, [_dispatch]);
|
|
54
|
+
return (<FormView formKey="helpdesk_ticket" defaultValue={defaultValue} actions={[
|
|
55
|
+
{
|
|
56
|
+
key: 'create-ticket',
|
|
57
|
+
type: 'create',
|
|
58
|
+
needValidation: true,
|
|
59
|
+
needRequiredFields: true,
|
|
60
|
+
hideIf: () => idTicket != null,
|
|
61
|
+
customAction: ({ dispatch, objectState, handleReset }) => {
|
|
62
|
+
createTicketAPI(objectState, dispatch);
|
|
63
|
+
handleReset();
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
key: 'update-ticket',
|
|
68
|
+
type: 'update',
|
|
69
|
+
needValidation: true,
|
|
70
|
+
needRequiredFields: true,
|
|
71
|
+
hideIf: () => idTicket == null,
|
|
72
|
+
customAction: ({ dispatch, objectState }) => {
|
|
73
|
+
updateTicketAPI(objectState, dispatch);
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
]}/>);
|
|
92
77
|
};
|
|
93
|
-
const styles = StyleSheet.create({
|
|
94
|
-
container: {
|
|
95
|
-
alignItems: 'center',
|
|
96
|
-
zIndex: 30,
|
|
97
|
-
},
|
|
98
|
-
scroll: {
|
|
99
|
-
height: null,
|
|
100
|
-
},
|
|
101
|
-
input: {
|
|
102
|
-
width: '90%',
|
|
103
|
-
},
|
|
104
|
-
button_container: {
|
|
105
|
-
marginVertical: '1%',
|
|
106
|
-
flexDirection: 'column',
|
|
107
|
-
justifyContent: 'center',
|
|
108
|
-
alignItems: 'center',
|
|
109
|
-
alignContent: 'center',
|
|
110
|
-
},
|
|
111
|
-
});
|
|
112
78
|
export default TicketFormScreen;
|
|
113
79
|
//# sourceMappingURL=TicketFormScreen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TicketFormScreen.js","sourceRoot":"","sources":["../../src/screens/TicketFormScreen.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,
|
|
1
|
+
{"version":3,"file":"TicketFormScreen.js","sourceRoot":"","sources":["../../src/screens/TicketFormScreen.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WAAW,EAAE,OAAO,EAAE,SAAS,EAAC,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAC,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAC,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAC,YAAY,EAAE,YAAY,EAAC,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAC,eAAe,EAAC,MAAM,2BAA2B,CAAC;AAE1D,MAAM,gBAAgB,GAAG,CAAC,EAAC,UAAU,EAAE,KAAK,EAAC,EAAE,EAAE;IAC/C,MAAM,QAAQ,GAAG,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC;IACzC,MAAM,SAAS,GAAG,WAAW,EAAE,CAAC;IAEhC,MAAM,EAAC,MAAM,EAAC,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAEpD,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,EAAE;QAChC,MAAM,QAAQ,GAAG;YACf,QAAQ,EAAE,CAAC;SACZ,CAAC;QAEF,IAAI,QAAQ,IAAI,IAAI,EAAE;YACpB,OAAO;gBACL,GAAG,MAAM;gBACT,QAAQ,EAAE,MAAM,CAAC,QAAQ,IAAI,QAAQ,CAAC,QAAQ;aAC/C,CAAC;SACH;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;IAEvB,MAAM,eAAe,GAAG,WAAW,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE;QACxD,QAAQ,CACN,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AW,EAAE,QAAQ,CAAC,CAAC;gBACzC,CAAC;aACF;SACF,CAAC,EACF,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axelor/aos-mobile-helpdesk",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.2.0",
|
|
4
4
|
"author": "Axelor",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"publishConfig": {
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"react-i18next": "^11.18.6"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@axelor/aos-mobile-core": "7.
|
|
32
|
-
"@axelor/aos-mobile-ui": "7.
|
|
31
|
+
"@axelor/aos-mobile-core": "7.2.0",
|
|
32
|
+
"@axelor/aos-mobile-ui": "7.2.0",
|
|
33
33
|
"@reduxjs/toolkit": "^1.8.5"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
package/lib/api/user-api.d.ts
DELETED
package/lib/api/user-api.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Axelor Business Solutions
|
|
3
|
-
*
|
|
4
|
-
* Copyright (C) 2023 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, getSearchCriterias, } from '@axelor/aos-mobile-core';
|
|
19
|
-
const createUserCriteria = searchValue => {
|
|
20
|
-
return [getSearchCriterias('helpdesk_user', searchValue)];
|
|
21
|
-
};
|
|
22
|
-
export async function searchUser({ searchValue, page = 0 }) {
|
|
23
|
-
return createStandardSearch({
|
|
24
|
-
model: 'com.axelor.auth.db.User',
|
|
25
|
-
criteria: createUserCriteria(searchValue),
|
|
26
|
-
fieldKey: 'helpdesk_user',
|
|
27
|
-
sortKey: 'helpdesk_user',
|
|
28
|
-
page: page,
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=user-api.js.map
|
package/lib/api/user-api.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"user-api.js","sourceRoot":"","sources":["../../src/api/user-api.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,kBAAkB,GAAG,WAAW,CAAC,EAAE;IACvC,OAAO,CAAC,kBAAkB,CAAC,eAAe,EAAE,WAAW,CAAC,CAAC,CAAC;AAC5D,CAAC,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,EAAC,WAAW,EAAE,IAAI,GAAG,CAAC,EAAC;IACtD,OAAO,oBAAoB,CAAC;QAC1B,KAAK,EAAE,yBAAyB;QAChC,QAAQ,EAAE,kBAAkB,CAAC,WAAW,CAAC;QACzC,QAAQ,EAAE,eAAe;QACzB,OAAO,EAAE,eAAe;QACxB,IAAI,EAAE,IAAI;KACX,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export default UserSearchBar;
|
|
2
|
-
declare function UserSearchBar({ placeholderKey, titleKey, defaultValue, onChange, showDetailsPopup, navigate, oneFilter, isFocus, style, showTitle, required, }: {
|
|
3
|
-
placeholderKey?: string;
|
|
4
|
-
titleKey?: string;
|
|
5
|
-
defaultValue?: any;
|
|
6
|
-
onChange?: () => void;
|
|
7
|
-
showDetailsPopup?: boolean;
|
|
8
|
-
navigate?: boolean;
|
|
9
|
-
oneFilter?: boolean;
|
|
10
|
-
isFocus?: boolean;
|
|
11
|
-
style: any;
|
|
12
|
-
showTitle?: boolean;
|
|
13
|
-
required?: boolean;
|
|
14
|
-
}): JSX.Element;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Axelor Business Solutions
|
|
3
|
-
*
|
|
4
|
-
* Copyright (C) 2023 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, { useCallback } from 'react';
|
|
19
|
-
import { useDispatch, useSelector, useTranslator } from '@axelor/aos-mobile-core';
|
|
20
|
-
import { AutoCompleteSearch } from '@axelor/aos-mobile-ui';
|
|
21
|
-
import { searchUser } from '../../../features/userSlice';
|
|
22
|
-
import { displayItemFullname } from '../../../utils/displayers';
|
|
23
|
-
const UserSearchBar = ({ placeholderKey = 'Helpdesk_User', titleKey = 'Helpdesk_User', defaultValue = null, onChange = () => { }, showDetailsPopup = true, navigate = false, oneFilter = false, isFocus = false, style, showTitle = true, required = false, }) => {
|
|
24
|
-
const I18n = useTranslator();
|
|
25
|
-
const dispatch = useDispatch();
|
|
26
|
-
const { userList, loadingUser, moreLoading, isListEnd } = useSelector(state => state.userList);
|
|
27
|
-
const searchUserTypeAPI = useCallback(({ page = 0, searchValue }) => {
|
|
28
|
-
dispatch(searchUser({ page, searchValue }));
|
|
29
|
-
}, [dispatch]);
|
|
30
|
-
return (<AutoCompleteSearch title={showTitle && I18n.t(titleKey)} objectList={userList} value={defaultValue} required={required} onChangeValue={onChange} fetchData={searchUserTypeAPI} displayValue={displayItemFullname} placeholder={I18n.t(placeholderKey)} showDetailsPopup={showDetailsPopup} loadingList={loadingUser} moreLoading={moreLoading} isListEnd={isListEnd} navigate={navigate} oneFilter={oneFilter} isFocus={isFocus} style={style}/>);
|
|
31
|
-
};
|
|
32
|
-
export default UserSearchBar;
|
|
33
|
-
//# sourceMappingURL=UserSearchBar.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UserSearchBar.js","sourceRoot":"","sources":["../../../../src/components/templates/UserSearchBar/UserSearchBar.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WAAW,EAAC,MAAM,OAAO,CAAC;AACzC,OAAO,EAAC,WAAW,EAAE,WAAW,EAAE,aAAa,EAAC,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAC,kBAAkB,EAAC,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAC,UAAU,EAAC,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAC,mBAAmB,EAAC,MAAM,2BAA2B,CAAC;AAE9D,MAAM,aAAa,GAAG,CAAC,EACrB,cAAc,GAAG,eAAe,EAChC,QAAQ,GAAG,eAAe,EAC1B,YAAY,GAAG,IAAI,EACnB,QAAQ,GAAG,GAAG,EAAE,GAAE,CAAC,EACnB,gBAAgB,GAAG,IAAI,EACvB,QAAQ,GAAG,KAAK,EAChB,SAAS,GAAG,KAAK,EACjB,OAAO,GAAG,KAAK,EACf,KAAK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CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export const searchUser: import("@reduxjs/toolkit").AsyncThunk<any, void, {
|
|
2
|
-
state?: unknown;
|
|
3
|
-
dispatch?: import("redux").Dispatch<import("redux").AnyAction>;
|
|
4
|
-
extra?: unknown;
|
|
5
|
-
rejectValue?: unknown;
|
|
6
|
-
serializedErrorType?: unknown;
|
|
7
|
-
pendingMeta?: unknown;
|
|
8
|
-
fulfilledMeta?: unknown;
|
|
9
|
-
rejectedMeta?: unknown;
|
|
10
|
-
}>;
|
|
11
|
-
export const userListReducer: import("redux").Reducer<{
|
|
12
|
-
loadingUser: boolean;
|
|
13
|
-
userList: any[];
|
|
14
|
-
moreLoading: boolean;
|
|
15
|
-
isListEnd: boolean;
|
|
16
|
-
}>;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Axelor Business Solutions
|
|
3
|
-
*
|
|
4
|
-
* Copyright (C) 2023 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 { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
19
|
-
import { generateInifiniteScrollCases, handlerApiCall, } from '@axelor/aos-mobile-core';
|
|
20
|
-
import { searchUser as _searchUser } from '../api/user-api';
|
|
21
|
-
export const searchUser = createAsyncThunk('user/searchUser', async function (data, { getState }) {
|
|
22
|
-
return handlerApiCall({
|
|
23
|
-
fetchFunction: _searchUser,
|
|
24
|
-
data,
|
|
25
|
-
action: 'Helpdesk_SliceAction_SearchUser',
|
|
26
|
-
getState,
|
|
27
|
-
responseOptions: { isArrayResponse: true },
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
const initialState = {
|
|
31
|
-
loadingUser: true,
|
|
32
|
-
userList: [],
|
|
33
|
-
moreLoading: false,
|
|
34
|
-
isListEnd: false,
|
|
35
|
-
};
|
|
36
|
-
const userSlice = createSlice({
|
|
37
|
-
name: 'user',
|
|
38
|
-
initialState,
|
|
39
|
-
extraReducers: builder => {
|
|
40
|
-
generateInifiniteScrollCases(builder, searchUser, {
|
|
41
|
-
loading: 'loadingUser',
|
|
42
|
-
moreLoading: 'moreLoading',
|
|
43
|
-
isListEnd: 'isListEnd',
|
|
44
|
-
list: 'userList',
|
|
45
|
-
});
|
|
46
|
-
},
|
|
47
|
-
});
|
|
48
|
-
export const userListReducer = userSlice.reducer;
|
|
49
|
-
//# sourceMappingURL=userSlice.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"userSlice.js","sourceRoot":"","sources":["../../src/features/userSlice.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EACL,4BAA4B,EAC5B,cAAc,GACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,UAAU,IAAI,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAE1D,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CACxC,iBAAiB,EACjB,KAAK,WAAW,IAAI,EAAE,EAAC,QAAQ,EAAC;IAC9B,OAAO,cAAc,CAAC;QACpB,aAAa,EAAE,WAAW;QAC1B,IAAI;QACJ,MAAM,EAAE,iCAAiC;QACzC,QAAQ;QACR,eAAe,EAAE,EAAC,eAAe,EAAE,IAAI,EAAC;KACzC,CAAC,CAAC;AACL,CAAC,CACF,CAAC;AAEF,MAAM,YAAY,GAAG;IACnB,WAAW,EAAE,IAAI;IACjB,QAAQ,EAAE,EAAE;IACZ,WAAW,EAAE,KAAK;IAClB,SAAS,EAAE,KAAK;CACjB,CAAC;AAEF,MAAM,SAAS,GAAG,WAAW,CAAC;IAC5B,IAAI,EAAE,MAAM;IACZ,YAAY;IACZ,aAAa,EAAE,OAAO,CAAC,EAAE;QACvB,4BAA4B,CAAC,OAAO,EAAE,UAAU,EAAE;YAChD,OAAO,EAAE,aAAa;YACtB,WAAW,EAAE,aAAa;YAC1B,SAAS,EAAE,WAAW;YACtB,IAAI,EAAE,UAAU;SACjB,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,SAAS,CAAC,OAAO,CAAC"}
|