Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HOLD for payment 2024-07-10] [#Wave-Control: Add NetSuite] Settings Configuration in NewDot: Top-Level Subsidiary Selector #43435

Closed
yuwenmemon opened this issue Jun 10, 2024 · 19 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item. Weekly KSv2

Comments

@yuwenmemon
Copy link
Contributor

yuwenmemon commented Jun 10, 2024

Tracking Issue: https://github.com/Expensify/Expensify/issues/377671

Design Doc Section: https://docs.google.com/document/d/1WubNv_VAv78IxG4FKsi9aS0pWESfWvUYbqBAAy5b4bc/edit#heading=h.ursdzd4yhqi0


(High-Level Section)

Route

  • Route: /settings/workspaces/{policyID}/accounting/netsuite/subsidiary
  • PageComponent: NetSuiteSubsidiarySelector
  • Calls UpdateNetSuiteSubsidiary
    • subsidiaryName: name of the selected subsidiary from options.data.subsidiaryList array.
    • The pendingAction for the OfflineWithFeedback component will be policy.pendingFields.subsidiary

AD_4nXcY-wNB2ht40Cb61Cn42fRiPYRnM-dx6O8_P5Qvr00KKpFEnPQ2My0nMzymympXv3tKR1IXeS0G8H6X9hhW1pIR6KNWXBvtpe75f-DI_gg2aSVlYy-58GY2

We’ll have a NetSuiteSubsidiarySelectorPage, which will populate the list of subsidiaries from the data.subsidiaryList. The sample data shows the list of subsidiaries here.

The basic code for the page will look as follows:

function NetSuiteNetSuiteSubsidiarySelectorPage({policy}: WithPolicyConnectionsProps) {
    const policyID = policy?.id ?? '';

    const { subsidiary } = policy?.connections?.netsuite?.config ?? {};  
    const subsidiaryOptions = useMemo<SelectorType[]>(() => {
        const subsidiaryList = policy?.connections?.netsuite?.options?.data.subsidiaryList ?? {} ?? [];
        const isMatchFound = subsidiaryList?.some(({subsidiaryObj}) => subsidiaryObj === subsidiary); // toLowerCase() ?

        return (subsidiaryList ?? []).map(({id, name}, index) => ({
            value: name,
            text: name,
            keyForList: id,
            isSelected: isMatchFound ? subsidiary === id : index === 0,
        }));
    });

    const listHeaderComponent = useMemo( // Move this to another file as a standalone component.
        () => (
            <View style={[styles.pb2, styles.ph5]}>
                <Text style={[styles.pb5, styles.textNormal]}>{translate('workspace.netsuite.subsidiary.description')}</Text>
            </View>
        ),
        [translate, styles.pb2, styles.ph5, styles.pb5, styles.textNormal],
    );

    const initiallyFocusedOptionKey = useMemo(() => subsidiaryList?.find((subsidiary) => subsidiary.isSelected)?.keyForList, [subsidiaryOptions]);

    const updateSubsidiary = useCallback(
        ({value}: SelectorType) => {
            Connections.updateNetSuiteSubsidiary(policyID, CONST.POLICY.CONNECTIONS.NAME.NET_SUITE, CONST.NET_SUITE_CONFIG, {
                subsidiary: value,
                subsidiaryID: //
            });
            Navigation.goBack(ROUTES.POLICY_ACCOUNTING.getRoute(policyID));
        },
        [policyID],
    );

    return (
        <SelectionScreen
            policyID={policyID}
            accessVariants={[CONST.POLICY.ACCESS_VARIANTS.ADMIN, CONST.POLICY.ACCESS_VARIANTS.PAID]}
            featureName={CONST.POLICY.MORE_FEATURES.ARE_CONNECTIONS_ENABLED}
            displayName={NetSuiteNetSuiteSubsidiarySelectorPage.displayName}
            sections={[{data: subsidiaryOptions}]}
            listItem={RadioListItem}
            onSelectRow={updateSubsidiary}
            initiallyFocusedOptionKey={initiallyFocusedOptionKey}
            headerContent={listHeaderComponent}
            onBackButtonPress={() => Navigation.goBack(ROUTES.POLICY_ACCOUNTING.getRoute(policyID))}
            title="workspace.netsuite.subsidiary.title"
        />
    );
}

NetSuiteNetSuiteSubsidiarySelectorPage.displayName = 'NetSuiteNetSuiteSubsidiarySelectorPage';

export default withPolicyConnections(NetSuiteNetSuiteSubsidiarySelectorPage);
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01d62f33ad0e1e9fe6
  • Upwork Job ID: 1800281430610989476
  • Last Price Increase: 2024-06-10
Issue OwnerCurrent Issue Owner: @
Issue OwnerCurrent Issue Owner: @JmillsExpensify
@yuwenmemon yuwenmemon added External Added to denote the issue can be worked on by a contributor Weekly KSv2 NewFeature Something to build that is a new item. labels Jun 10, 2024
Copy link

melvin-bot bot commented Jun 10, 2024

Job added to Upwork: https://www.upwork.com/jobs/~01d62f33ad0e1e9fe6

@melvin-bot melvin-bot bot changed the title [#Wave-Control: Add NetSuite] Settings Configuration in NewDot: Top-Level Subsidiary Selector [$250] [#Wave-Control: Add NetSuite] Settings Configuration in NewDot: Top-Level Subsidiary Selector Jun 10, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 10, 2024
Copy link

melvin-bot bot commented Jun 10, 2024

Triggered auto assignment to @JmillsExpensify (NewFeature), see https://stackoverflowteams.com/c/expensify/questions/14418#:~:text=BugZero%20process%20steps%20for%20feature%20requests for more details. Please add this Feature request to a GH project, as outlined in the SO.

Copy link

melvin-bot bot commented Jun 10, 2024

Current assignee @mananjadhav is eligible for the External assigner, not assigning anyone new.

@yuwenmemon yuwenmemon removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 10, 2024
@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jun 10, 2024
@yuwenmemon yuwenmemon changed the title [$250] [#Wave-Control: Add NetSuite] Settings Configuration in NewDot: Top-Level Subsidiary Selector [#Wave-Control: Add NetSuite] Settings Configuration in NewDot: Top-Level Subsidiary Selector Jun 10, 2024
@yuwenmemon
Copy link
Contributor Author

Sample NetSuite connection data JSON:
sampleNetSuiteJSON.json

This would go under connections.netsuite in your policy object in Onyx, just like for quickbooksOnline

@mananjadhav
Copy link
Collaborator

Starting with this issue first. I'll have the first PR ready by weekend. Might be away on Friday.

@yuwenmemon
Copy link
Contributor Author

Great! I'll try to prioritize getting the subsidiary selection API out for you in a separate PR then.

@melvin-bot melvin-bot bot added the Overdue label Jun 17, 2024
Copy link

melvin-bot bot commented Jun 18, 2024

@JmillsExpensify, @mananjadhav, @yuwenmemon Eep! 4 days overdue now. Issues have feelings too...

@JmillsExpensify
Copy link

@mananjadhav has been sick but we'll be coming back to this one soon.

@mananjadhav
Copy link
Collaborator

mananjadhav commented Jun 19, 2024

@yuwenmemon I'll need:

  1. To confirm if the API is ready?
  2. Can you share the Netsuite Icon?
  3. Spanish translation for Subsidiary and Choose the subsidiary in NetSuite that you\'d like to import data from.
  4. Name of the beta behind which the Netsuite should be. Because during active development we don't want to show NetSuite right?

@mananjadhav
Copy link
Collaborator

Demo video of the list:

web-net-suite-subsidiary-one.mov

@yuwenmemon
Copy link
Contributor Author

To confirm if the API is ready?

The API to select a subsidiary is live as of an hour ago!

    } elseif ($command === 'UpdateNetSuiteSubsidiary') {
        NetSuite::updateSubsidiary($authToken, $policyID, $_REQUEST['subsidiary'] ?? '');

@yuwenmemon
Copy link
Contributor Author

Can you share the Netsuite Icon?

Asking this for you here: https://expensify.slack.com/archives/C06ML6X0W9L/p1718836882604659

@yuwenmemon
Copy link
Contributor Author

Spanish translation for Subsidiary and Choose the subsidiary in NetSuite that you'd like to import data from.

Asking this for you here: https://expensify.slack.com/archives/C21FRDWCV/p1718837580539369

@yuwenmemon
Copy link
Contributor Author

Name of the beta behind which the Netsuite should be. Because during active development we don't want to show NetSuite right?

Asked this for you here: https://expensify.slack.com/archives/C06ML6X0W9L/p1718837727812639

@yuwenmemon
Copy link
Contributor Author

Spanish:
Subsidiaria
Elige la subsidiaria de NetSuite de la que deseas importar datos

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 Weekly KSv2 labels Jun 20, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Jun 26, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Jun 30, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jul 2, 2024
@melvin-bot melvin-bot bot changed the title [#Wave-Control: Add NetSuite] Settings Configuration in NewDot: Top-Level Subsidiary Selector [HOLD for payment 2024-07-10] [#Wave-Control: Add NetSuite] Settings Configuration in NewDot: Top-Level Subsidiary Selector Jul 3, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 3, 2024
Copy link

melvin-bot bot commented Jul 3, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

Copy link

melvin-bot bot commented Jul 3, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.3-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-07-10. 🎊

For reference, here are some details about the assignees on this issue:

  • @mananjadhav requires payment through NewDot Manual Requests

Copy link

melvin-bot bot commented Jul 3, 2024

BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@mananjadhav] Please propose regression test steps to ensure the new feature will work correctly on production in further releases.
  • [@JmillsExpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon.

@mananjadhav
Copy link
Collaborator

Payout for this will be centrally paid, no further action here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item. Weekly KSv2
Projects
Archived in project
Development

No branches or pull requests

3 participants