@bjsdistribution/dms-client-return 0.1.45-prod → 0.1.46-prod

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.1.45-prod",
2
+ "version": "0.1.46-prod",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -35,9 +35,18 @@ export const optionsMenu = [
35
35
  ];
36
36
 
37
37
  export const PrintMenu = [
38
- { label: 'Proof of Delivery', value: 'proofofdelivery' },
39
- { label: 'Return Labels', value: 'returnlabels' },
40
- { label: 'Return Cover Notes', value: 'returncovernote' },
38
+ {
39
+ label: 'Proof of Delivery',
40
+ value: 'proofofdelivery',
41
+ },
42
+ {
43
+ label: 'Return Labels',
44
+ value: 'returnlabels',
45
+ },
46
+ {
47
+ label: 'Return Cover Notes',
48
+ value: 'returncovernote',
49
+ },
41
50
  ];
42
51
 
43
52
  export const orderResources = [
@@ -5,7 +5,6 @@ import { useOrderDetails } from '../../store';
5
5
  import { Dropdown, Space } from 'antd';
6
6
  import ArrowDownIcon from '../../../../assets/icons/ArrowDownIcon';
7
7
  import { getBaseEndpoint } from '@bjsdistribution/dms-component-library';
8
- type LabelKey = 'deliver' | 'collect' | 'return';
9
8
 
10
9
  function Print() {
11
10
  const [orderDetails] = useOrderDetails();
@@ -118,51 +117,31 @@ function Print() {
118
117
 
119
118
  const menuItems = {
120
119
  items: filteredOptions?.map((option: any) => {
121
- const disabled = isOptionDisabled(option.value);
120
+ // const disabled = isOptionDisabled(option.value);
122
121
 
123
122
  return {
124
123
  key: option.value,
125
- disabled,
126
124
  label: (
127
125
  <div
128
126
  onClick={e => {
129
127
  e.stopPropagation();
130
- if (!disabled) {
128
+ // if (!disabled) {
131
129
  handleSelectChange(option);
132
- }
133
- }}
134
- style={{
135
- color: disabled ? '#bfbfbf' : undefined,
136
- cursor: disabled ? 'not-allowed' : 'pointer',
130
+ // }
137
131
  }}
132
+ // style={{
133
+ // color: disabled ? '#bfbfbf' : undefined,
134
+ // cursor: disabled ? 'not-allowed' : 'pointer',
135
+ // }}
138
136
  >
139
137
  {option.label}
140
138
  </div>
141
139
  ),
140
+ // disabled,
142
141
  };
143
142
  }),
144
143
  };
145
144
 
146
- const optionToLabelKey: Record<string, LabelKey | undefined> = {
147
- proofofdelivery: 'deliver',
148
- returnlabels: 'return',
149
- returncovernote: 'collect',
150
- };
151
-
152
- const isOptionDisabled = (optionValue: string): boolean => {
153
- const labels = orderDetails?.labels;
154
-
155
- // If labels not loaded yet → disable all
156
- if (!labels) return true;
157
-
158
- const labelKey = optionToLabelKey[optionValue];
159
-
160
- // If option does not require a label → always enabled
161
- if (!labelKey) return false;
162
-
163
- return labels[labelKey] !== true;
164
- };
165
-
166
145
  return (
167
146
  <Container>
168
147
  <Dropdown menu={menuItems} trigger={['hover']}>