Skip to content

OBLS-932 Display customer delivery address on picking screens - #438

Open
olewandowski1 wants to merge 1 commit into
developfrom
OBLS-932
Open

OBLS-932 Display customer delivery address on picking screens#438
olewandowski1 wants to merge 1 commit into
developfrom
OBLS-932

Conversation

@olewandowski1

Copy link
Copy Markdown
Collaborator

https://openboxes.atlassian.net/browse/OBLS-932

Summary

  • Display the customer as a clickable row across non-discrete picking screens
  • Keep the customer row single-line and at its existing height
  • Open a customer-details dialog containing the delivery address from customer master data
  • Rename the destination label from its location type, such as “Depot,” to “Customer”
  • Add mobile typing for the Pick Task destinationAddress response
  • Leave discrete picking unchanged
image image

address?: DestinationAddress | null;
};

function compact(parts: Array<string | null | undefined>) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't you use arrow functions?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As with useState, no technical requirement behind it and there is no "team convention", so we just use both declarations.

Comment on lines +6 to +9
import { ProductDetails } from '../../components/ProductDetails';
import { HYPHEN } from '../../constants';
import { DestinationAddress } from '../../types/picking';
import styles from './customerDetailsStyles';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you guys have a ticket for fixing the imports? I mean using aliases here

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, as far as I'm aware. We talked about it several times, but no action items were created.

}

export function CustomerDetails({ name, address }: CustomerDetailsProps) {
const [visible, setVisible] = React.useState(false);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason for using useState called on a React object rather than importing the useState directly?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No functional reason here. Just used it like that because the picking files follow this pattern.

{label}: <Text style={[styles.chipText, styles.fontBold]}>{value ?? HYPHEN}</Text>
</Text>
</Chip>
function Item({ icon, label, value, secondaryValue, onPress, accessibilityLabel }: ProductDetailsItem) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what the purpose of that component is, but I would expect Item to be able to receive a child component and render it, so that the content can be a separate component and passed as a prop. But I may not be right in your case.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea, and I agree making it composable is the right path. Nevertheless, this ProductDetails.Item is used across multiple screens, so the refactor would broaden this ticket's scope. We can create a separate ticket for it and keep it outside OBLS-932.

<View style={styles.dialog}>
<View style={styles.header}>
<View style={styles.headerText}>
<Text style={styles.eyebrow}>CUSTOMER</Text>

@druchniewicz druchniewicz Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use here destinationLocationType from currentTask not to limit ourselves that it will always be Customer. I would use { destinationLocationType || 'Customer' }

<>
<ProductDetails.Item
icon="map-marker"
label="Customer"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use here destinationLocationType from currentTask not to limit ourselves that it will always be Customer. I would use { destinationLocationType || 'Customer' }

<Text style={styles.addressLine}>{addressLine1}</Text>
{address?.address2 ? <Text style={styles.addressLine}>{address.address2}</Text> : null}
{locality ? <Text style={styles.addressLine}>{locality}</Text> : null}
{address?.country ? <Text style={styles.addressLine}>{address.country}</Text> : null}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll ask Emilia if the country is really necessary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants