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

[#Wave-Control: Add NetSuite]: Settings Configuration in NewDot: Import - Add Custom Records/Lists #44942

Merged
merged 122 commits into from
Jul 9, 2024

Conversation

mananjadhav
Copy link
Collaborator

@mananjadhav mananjadhav commented Jul 7, 2024

Details

  1. Collect workspace with accounting enabled.
  2. NetSuite beta enabled for the user. You can return true in the canUseNetSuiteIntegration method.
  3. Setup the NetSuite connected workspace.
  4. It has pending translations.
  5. It also contains the refactor of custom lists from text input to picker in this PR.

Fixed Issues

$ #43437
PROPOSAL:

Tests

  • Verify that no errors appear in the JS console

Tests for List, View, Update, Remove

  1. Open the app with the pre-setup workspace.
  2. Go to Accounting from the LHS
  3. Verify that you're able to see Net Suite in the active connections along with the Oracle NetSuite logo.
  4. Click on the Import button.
  5. Verify that the list of options appear as per the linked design doc.
  6. Click on the Custom segments/records without any data.
  7. You should see an the empty screen with the folder icon, and the text as following:
image
  1. Now add a few records in Custom segments/records using the Add custom segments/records button.
  2. Come back to the NewDot to the Import screen.
  3. Click on the Custom segments/records with data now.
  4. Verify that you can see the list of segments. Each segment should have the title Custom segment/record and the segmentName that you added.
  5. Verify that you can see the description as the subtitle.
  6. Click on any one of the records, you see see the view screen with all the fields: Name, Internal ID, Script and Mapping
  7. Click on any one of the fields, and you should see the edit screen. For mapping you should see the dropdown with Tags and Report option. For the other fields it should be a text field.
  8. The form should throw an error if the field is empty.
  9. Update the value for these fields, and then click on Save.
  10. It should update the field value and take you back to the record view screen.
  11. Now to test delete, click on Remove and you should see a confirmation modal for remove.
  12. Clicking on Remove should redirect back to the list screen and the record removed.
  13. Repeat steps 6-19 for Custom lists in the import screen

Tests for List, View, Update, Remove

  1. Start from step 6 in the previous test steps.
  2. You should see the add workflow mentioned here in the design doc.
  3. Verify for each step the page title, field title, field name, data type, subtext if any, error message.
  4. Verify whether all the data you entered shows correct in the last confirmation step.
  5. Clicking on confirm button should take you back to the listing screen with the newly added record.
  6. Repeat the same steps for Custom list.

Offline tests

QA Steps

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
    • MacOS: Desktop
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I verified the translation was requested/reviewed in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
android-add-custom-lists.mov

Steps
https://github.com/Expensify/App/assets/3069065/acb70e66-4c3d-4952-8966-36b9190f31cf

Steps Completion

android-add-custom-segment-2
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
ios-add-custom-segments.mov
ios-add-custom-lists.mov
MacOS: Chrome / Safari
web-add-custom-segment-lists.mov
web-add-custom-segment-errors.mov
MacOS: Desktop
desktop-add-custom-segments-lists.mov

@mananjadhav
Copy link
Collaborator Author

Removed draft logic as discussed here.

@yuwenmemon yuwenmemon merged commit ae830d3 into Expensify:main Jul 9, 2024
14 checks passed
@yuwenmemon yuwenmemon removed the request for review from akinwale July 9, 2024 20:51
@OSBotify
Copy link
Contributor

🚀 Deployed to staging by https://github.com/yuwenmemon in version: 9.0.6-0 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 failure ❌
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by https://github.com/yuwenmemon in version: 9.0.6-0 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@OSBotify
Copy link
Contributor

🚀 Cherry-picked to staging by https://github.com/Julesssss in version: 9.0.6-1 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 failure ❌
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes.

@OSBotify
Copy link
Contributor

🚀 Cherry-picked to staging by https://github.com/Julesssss in version: 9.0.6-1 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes.

@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/thienlnam in version: 9.0.6-8 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/thienlnam in version: 9.0.7-8 🚀

platform result
🤖 android 🤖 failure ❌
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 failure ❌
🕸 web 🕸 success ✅


const [customSegmentType, setCustomSegmentType] = useState<ValueOf<typeof CONST.NETSUITE_CUSTOM_RECORD_TYPES> | undefined>();

const validate = useCallback(
Copy link
Contributor

Choose a reason for hiding this comment

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

Some validation was missing here which caused issue:

To solve the issue we added new error case and translations for the specific case, more details in the proposal.

Comment on lines +63 to +69
if (screenIndex === CONST.NETSUITE_CUSTOM_FIELD_SUBSTEP_INDEXES.CUSTOM_LISTS.CUSTOM_LIST_PICKER) {
Navigation.goBack(ROUTES.POLICY_ACCOUNTING_NETSUITE_IMPORT_CUSTOM_FIELD_MAPPING.getRoute(policyID, CONST.NETSUITE_CONFIG.IMPORT_CUSTOM_FIELDS.CUSTOM_LISTS));
return;
}
ref.current?.movePrevious();
prevScreen();
};
Copy link
Contributor

Choose a reason for hiding this comment

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

We are not clearing the form errors on going back which is causing issue #49266, we do need to clear errors because we are using the same Form by just changing the content of the sub-step.

stepNames={CONST.NETSUITE_CONFIG.NETSUITE_ADD_CUSTOM_SEGMENT_STEP_NAMES}
/>
</View>
<View style={[styles.flexGrow1, styles.mt3]}>
Copy link
Contributor

Choose a reason for hiding this comment

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

We should use styles.flex1 here instead of styles.flexGrow1 to allow form scrollable. More details here #50065 (comment)

@rayane-djouah
Copy link
Contributor

FYI, this caused the following issue: #49986
We need to save draft values of the form as well as the current state of the form (sub-steps)
More details can be found in this proposal: #49986 (comment)
Corresponding PR: #51109

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.

10 participants