Skip to content

[Due for payment 2025-05-28] [Multi-tags] Admin - Downloading Tags #61758

Closed

Description

@yuwenmemon

Tracking GH: https://github.com/Expensify/Expensify/issues/418655

Design Doc: https://docs.google.com/document/d/1_p8qZXVKG-s32i9GKqVjCLEcEREBUEgYcxk3KYHXMVg/edit?tab=t.0


From the Design Doc:

Admin: Downloading Tags

First, we will not hide the threeDotsMenuItems for multi-level tags, we need to set shouldShowThreeDotsButton={true} for all cases (currently we hide it when tags are multi-level).

  1. Call new downloadMultiLeveltagsCSV function for multi-level tags

We are not going to support download for Multi-Level Dependent Tags, we need to update the condition for showing the download CSV option along with that we need to create a new Util which will call ExportMultiLevelTagsCSV API endpoint for multi-level tags: \

// We hide the option to download tags in case of dependent tags
if (hasVisibleTags && !hasDependentTags) {
  menuItems.push({
    icon: Expensicons.Download,
    text: translate("spreadsheet.downloadCSV"),
    onSelected: () => {
      if (isOffline) {
        Modal.close(() => setIsOfflineModalVisible(true));
        return;
      }
      Modal.close(() => {
	// Here we will check if the policy has multilevel tags
	// And will call the appropriate API command
        if (policy?.isUsingMultiLevelTags) {
          Tag.downloadMultiLeveltagsCSV(policyID, () => {
            setIsDownloadFailureModalVisible(true);
          });
          return;
        }
        Tag.downloadTagsCSV(policyID, () => {
          setIsDownloadFailureModalVisible(true);
        });
      });
    },
  });
}
  1. Create new util to download multi-level independent tags

The downloadMultiLeveltagsCSV steps util will be similar to downloadTagsCSV only difference is we will call ExportMultiLevelTagsCSV endpoint in this case:
The Util downloadMultiLeveltagsCSV endpoint will be as follows: \

function downloadMultiLeveltagsCSV(
  policyID: string,
  onDownloadFailed: () => void
) {
  const finalParameters = enhanceParameters(
    WRITE_COMMANDS.EXPORT_MULTI_LEVEL_TAGS_CSV,
    {
      policyID,
    }
  );
  const fileName = "MultiLevelTags.csv";

  const formData = new FormData();
  Object.entries(finalParameters).forEach(([key, value]) => {
    formData.append(key, String(value));
  });

  fileDownload(
    ApiUtils.getCommandURL({
      command: WRITE_COMMANDS.EXPORT_MULTI_LEVEL_TAGS_CSV,
    }),
    fileName,
    "",
    false,
    formData,
    CONST.NETWORK.METHOD.POST,
    onDownloadFailed
  );
}

The API command EXPORT_MULTI_LEVEL_TAGS_CSV will be implemented according to the backend changes here.

We will rename the command ExportTagsCSV to ExportSingleLevelTagsCSV (More details here)

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021922164703131803558
  • Upwork Job ID: 1922164703131803558
  • Last Price Increase: 2025-05-13
  • Automatic offers:
    • allgandalf | Reviewer | 107454938
Issue OwnerCurrent Issue Owner: @
Issue OwnerCurrent Issue Owner: @joekaufmanexpensify

Activity

  1. melvin-bot commented on May 9, 2025

    @melvin-bot

    Triggered auto assignment to @joekaufmanexpensify (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.

  2. allgandalf commented on May 12, 2025

    @allgandalf
    Contributor

    Will start to work on it this week

  3. joekaufmanexpensify commented on May 12, 2025

    @joekaufmanexpensify
    Contributor

    Great, thank you!

  4. self-assigned this
    on May 13, 2025
  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on May 13, 2025
  6. changed the title [-][Multi-tags] Admin - Downloading Tags[/-] [+][$250] [Multi-tags] Admin - Downloading Tags[/+] on May 13, 2025
  7. melvin-bot commented on May 13, 2025

    @melvin-bot
  8. 23 remaining items

  9. melvin-bot commented on May 21, 2025

    @melvin-bot

    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:

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

    @mananjadhav
    Collaborator

    @yuwenmemon Can you assign this issue to me for the payout? I helped with the PR review.

  11. melvin-bot commented on May 26, 2025

    @melvin-bot

    📣 @allgandalf 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

    Offer link
    Upwork job

  12. mananjadhav commented on May 27, 2025

    @mananjadhav
    Collaborator

    @yuwenmemon @allgandalf can you confirm if the regression test is added for the issue during the project?

  13. mananjadhav commented on May 29, 2025

    @mananjadhav
    Collaborator

    @joekaufmanexpensify Quick bump on the payment summary?

  14. joekaufmanexpensify commented on May 31, 2025

    @joekaufmanexpensify
    Contributor

    I was OOO until May 30th. Will handle on Monday!

  15. joekaufmanexpensify commented on Jun 2, 2025

    @joekaufmanexpensify
    Contributor

    This issue was linked to a DB , however in the PR fix there it sounds like there was some confusion on the BE command name that should be used, so I don't think there should be a regression penalty here.

  16. joekaufmanexpensify commented on Jun 2, 2025

    @joekaufmanexpensify
    Contributor

    @allgandalf I assume you're being paid holistically for this project because I see you worked on the design doc. LMK if that is not correct. Assuming it is, only payment needed in this issue is:

  17. joekaufmanexpensify commented on Jun 2, 2025

    @joekaufmanexpensify
    Contributor

    Closing this for now, as we should be all set here!

  18. garrettmknight commented on Jun 3, 2025

    @garrettmknight
    Contributor

    $250 approved for @mananjadhav

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionDailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributorNewFeatureSomething to build that is a new item.

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions