@open-tender/utils 0.1.169 → 0.1.171

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.
@@ -27,11 +27,7 @@ const useOrderItem = (orderItem, favorite = null, allergenAlerts = [], cartCount
27
27
  const nonSizeGroups = groups.filter(i => !i.isSize);
28
28
  const currentOptions = (0, utils_1.getItemOptions)(Object.assign(Object.assign({}, orderItem), { groups: nonSizeGroups }));
29
29
  const hasSelections = currentOptions.length > 0;
30
- const desc = showDesc === 'HIDE'
31
- ? ''
32
- : showDesc === 'SHORT'
33
- ? shortDescription
34
- : description;
30
+ const desc = showDesc === 'SHORT' ? shortDescription : description;
35
31
  const optionNames = favorite
36
32
  ? groups
37
33
  .reduce((arr, group) => {
@@ -42,7 +38,7 @@ const useOrderItem = (orderItem, favorite = null, allergenAlerts = [], cartCount
42
38
  }, [])
43
39
  .join(', ')
44
40
  : null;
45
- const displayDesc = optionNames || desc;
41
+ const displayDesc = showDesc === 'HIDE' ? '' : optionNames || desc;
46
42
  return Object.assign(Object.assign({}, orderItem), { displayDesc,
47
43
  displayTags,
48
44
  displayAllergens,
@@ -30,7 +30,7 @@ const notificationChannelFields = [
30
30
  const useSignUpForm = (loading, error, signUp, callback, checkConfig, hidePassword = false, optionalFields, notificationChannels) => {
31
31
  const submitRef = (0, react_1.useRef)(null);
32
32
  const [data, setData] = (0, react_1.useState)(initState);
33
- const [comms, setComms] = (0, react_1.useState)(notificationChannels || []);
33
+ const [comms, setComms] = (0, react_1.useState)([]);
34
34
  const [errors, setErrors] = (0, react_1.useState)({});
35
35
  const [submitting, setSubmitting] = (0, react_1.useState)(false);
36
36
  const { displayed, required } = checkConfig || {};
@@ -24,11 +24,7 @@ export const useOrderItem = (orderItem, favorite = null, allergenAlerts = [], ca
24
24
  const nonSizeGroups = groups.filter(i => !i.isSize);
25
25
  const currentOptions = getItemOptions(Object.assign(Object.assign({}, orderItem), { groups: nonSizeGroups }));
26
26
  const hasSelections = currentOptions.length > 0;
27
- const desc = showDesc === 'HIDE'
28
- ? ''
29
- : showDesc === 'SHORT'
30
- ? shortDescription
31
- : description;
27
+ const desc = showDesc === 'SHORT' ? shortDescription : description;
32
28
  const optionNames = favorite
33
29
  ? groups
34
30
  .reduce((arr, group) => {
@@ -39,7 +35,7 @@ export const useOrderItem = (orderItem, favorite = null, allergenAlerts = [], ca
39
35
  }, [])
40
36
  .join(', ')
41
37
  : null;
42
- const displayDesc = optionNames || desc;
38
+ const displayDesc = showDesc === 'HIDE' ? '' : optionNames || desc;
43
39
  return Object.assign(Object.assign({}, orderItem), { displayDesc,
44
40
  displayTags,
45
41
  displayAllergens,
@@ -27,7 +27,7 @@ const notificationChannelFields = [
27
27
  export const useSignUpForm = (loading, error, signUp, callback, checkConfig, hidePassword = false, optionalFields, notificationChannels) => {
28
28
  const submitRef = useRef(null);
29
29
  const [data, setData] = useState(initState);
30
- const [comms, setComms] = useState(notificationChannels || []);
30
+ const [comms, setComms] = useState([]);
31
31
  const [errors, setErrors] = useState({});
32
32
  const [submitting, setSubmitting] = useState(false);
33
33
  const { displayed, required } = checkConfig || {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/utils",
3
- "version": "0.1.169",
3
+ "version": "0.1.171",
4
4
  "description": "A library of utils for use with Open Tender applications that utilize our cloud-based Order API.",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",