DIGIT Docs
v0.2
  • DIGIT Knowledge Base
  • Local Governance
v0.2
  • Introducing HCM Console
  • Release Notes
    • v0.2: Release Notes
      • v0.2 Technical Release Summary
      • Service Build Updates
      • Master Data Management Service (MDMS) & Configuration Updates
    • v0.1: Release Notes
      • v0.1 Technical Release Summary
      • Service Build Updates
      • Master Data Management Service (MDMS) & Configuration Updates
      • Gate 2 Release Checklist
  • PRODUCT SPECIFICATION
    • User Manual
    • Product Requirement Document (PRD)
    • Functional Specifications
  • TECHNOLOGY
    • Architecture
      • High Level Design
      • Low Level Design
        • Project Factory (Campaign Manager)
      • Services
        • Project Factory
          • Campaign Manage APIs
          • Data Manage APIs
            • Target Upload
          • Boundary Campaign Setup
            • Boundary Generation
        • HCM Console Web
          • User Interface Design
          • Create New Campaign
            • Campaign Details
            • Delivery Details
            • Boundary Details
            • Resource Upload Details
            • Setup and Implementation of Campaign
            • Summary Screen
          • Change Campaign Dates
          • My Campaign
            • Action Column Integration
          • Boundary Bulk Upload
          • Campaign Timeline
  • SETUP
    • Installation
    • Configuration
    • Quality Assurance Testing
      • Automation - Run HCM Console Script
        • User
        • Target
        • Facility
      • Performance Testing
  • GENERAL
    • Product Roadmap
Powered by GitBook

All content on this page by eGov Foundation is licensed under a Creative Commons Attribution 4.0 International License.

On this page
  • New Campaign & Implementing Local Storage
  • Draft Campaign & Data Fetching
  • Stepper

Was this helpful?

Export as PDF
  1. TECHNOLOGY
  2. Architecture
  3. Services
  4. HCM Console Web
  5. Create New Campaign

Setup and Implementation of Campaign

PreviousResource Upload Details NextSummary Screen

Was this helpful?

The logic for the step-by-step screens, stepper functionality, storing data in localStorage, creating/updating campaigns, and restructuring API data back into localStorage is all managed within SetupCampaign.js.

All screens are present in the given configuration. Link:

In the configuration:

  • stepCount represents the step number. Multiple configuration objects can share the same stepCount.

  • skipAPICall: If this is set to true, the API call for the screen is skipped.

  • sessionData: Local storage data is passed in custom props, allowing for custom logic to be added to the screens as needed.

export const CampaignConfig = (totalFormData, dataParams) => {
  return [
    {
      form: [
        {
          stepCount: "1",
          key: "1",
          name: "HCM_CAMPAIGN_TYPE",
          body: [
            {
              isMandatory: false,
              key: "projectType",
              type: "component",
              skipAPICall: true,
              component: "CampaignSelection",
              withoutLabel: true,
              disable: false,
              customProps: {
                module: "HCM",
                sessionData: totalFormData,
              },
              populators: {
                name: "projectType",
              },
            },
          ],
        },
        ``````

In setup campaign, we have functions to perform specific logic.

  • loopAndReturn: This function takes the delivery rule conditions coming from API response and restructure the data in local storage format.

  • cycleDataRemap: This function takes the delivery rules data coming from API response and return array of object of start date and end date based on cycles.

  • reverseDeliveryRemap: This function take the deliveryConditions from API response and return the structure of delivery data.

  • groupByTypeRemap: This function create the local structure of boundaries.

  • updateUrlParams: This function is using to update the url.

New Campaign & Implementing Local Storage

  • In a new campaign, we update the total form when a user clicks on next after entering the data.

  • After updating the total form data, we store the data in localStorage.

  • We also call the API to draft the data in case a user wants to come back and resume the campaign.

  • Refer to the following link:

Draft Campaign & Data Fetching

  • When a user clicks on the draft campaign, he/she can fetch campaign data from the response.

  • After getting a response, one can restructure the data in screen format and store in the local storage.

  • After updating, the user is redirected to the last screen where additional details are stored in response.

  • Refer to the following link:

Stepper

  • Based on screens, a user can filter the configuration and show the the stepper based on the configuration.

  • Refer to the following link:

https://github.com/egovernments/DIGIT-Frontend/blob/campaign/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/SetupCampaign.js
https://github.com/egovernments/DIGIT-Frontend/blob/campaign/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/configs/CampaignConfig.js
https://github.com/egovernments/DIGIT-Frontend/blob/campaign/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/SetupCampaign.js#L545
https://github.com/egovernments/DIGIT-Frontend/blob/campaign/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/SetupCampaign.js#L327
https://github.com/egovernments/DIGIT-Frontend/blob/campaign/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/SetupCampaign.js#L1159