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

Adds fields to Asset model as per asset registration v2 #3458

Merged
merged 44 commits into from
Sep 28, 2022

Conversation

rithviknishad
Copy link
Member

@rithviknishad rithviknishad commented Aug 22, 2022

Closes #3426
as part of #2212

In the Asset Create/Update and Asset Detail page:

  • Renamed "Phone No" as "Customer support No."
  • The following fields were added in the Asset Create/Update and Asset Detail page

1: Manufacturer: Short text field, optional
2: Warranty/AMC applicable till: Date, Optional
3: Last serviced on: Date- Optional
4: Notes: Long text field- optional

  • Field warranty_details removed from the Asset Create/Update and Asset Detail

Additional changes:

  • Implements hook: useVisibility

    Usage Example:

    const [isVisible, elementRef] = useVisibility(-200);
    
    useEffect(() => {
        // do something.
    }, [isVisible]);
    
    return (
        ...
        <Element ref={elementRef} />
        ...
    );
  • Implemented Tailwind component: TextInputFieldV2
    image

    Usage example:

    {/* Asset Name */}
    <div className="col-span-6 sm:col-span-4">
      <TextInputFieldV2
        id="asset-name"
        label="Asset Name"
        value={name}
        onValueChange={setName}
        error={state.errors.name}
        required
      />
    </div>
  • Updated Tailwind component: SelectMenu with new design
    Also fixed it's overflow issues.
    image

    Usage Example:

    {/* Asset Type */}
    <div className="col-span-6 sm:col-span-2">
      <label htmlFor="asset-type">Asset Type * </label>
      <div className="mt-2">
        <SelectMenuV
          options={[
            {
              title: "Select",
              description:
                "Select an Asset Type from the following",
              value: undefined,
            },
            {
              title: "Internal",
              description:
                "Asset is inside the facility premises.",
              value: "INTERNAL",
            },
            {
              title: "External",
              description:
                "Asset is outside the facility premises.",
              value: "EXTERNAL",
            },
          ]}
          selected={asset_type}
          onSelect={setAssetType}
        />
      </div>
      <ErrorHelperText error={state.errors.asset_type} />
    </div>
  • Implemented Tailwind component RadioInputsV2
    image

    Usage example:

    {/* Working Status */}
    <RadioInputsV2
      className="col-span-6"
      required
      label="Working Status"
      name="is_working"
      options={[
        { label: "Working", value: "true" },
        { label: "Not Working", value: "false" },
      ]}
      selected={is_working}
      onSelect={setIsWorking}
      error={state.errors.is_working}
    />
  • Implemented Tailwind Component SwitchV2
    image

    {/* Working Status */}
    <SwitchV2
      className="col-span-6"
      required
      name="is_working"
      label="Working Status"
      options={["true", "false"]}
      optionLabel={(option) => {
        return (
          {
            true: "Working",
            false: "Not Working",
          }[option] || "undefined"
        );
      }}
      optionClassName={(option) =>
        option === "false" &&
        "bg-error text-white border-error focus:ring-error"
      }
      value={is_working}
      onChange={setIsWorking}
      error={state.errors.is_working}
    />

@netlify
Copy link

netlify bot commented Aug 22, 2022

Deploy Preview for care-egov-staging ready!

Name Link
🔨 Latest commit 5d4c43a
🔍 Latest deploy log https://app.netlify.com/sites/care-egov-staging/deploys/6332dfed06817800081b62bf
😎 Deploy Preview https://deploy-preview-3458--care-egov-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@rithviknishad rithviknishad marked this pull request as ready for review August 23, 2022 13:26
@rithviknishad rithviknishad requested a review from a team August 23, 2022 13:26
@rithviknishad rithviknishad requested a review from a team as a code owner August 23, 2022 13:26
@rithviknishad rithviknishad added needs testing Major Code Change This Tag represent PR, which will be causing major Code change in the platform and removed work-in-progress labels Sep 23, 2022
@mathew-alex mathew-alex added the merge conflict pull requests with merge conflict label Sep 27, 2022
@mathew-alex
Copy link
Contributor

👋 Hi, @rithviknishad,
Conflicts have been detected against the base branch. Please rebase your branch against the base branch.


This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there.

@rithviknishad rithviknishad removed the merge conflict pull requests with merge conflict label Sep 27, 2022
@sonarcloud
Copy link

sonarcloud bot commented Sep 27, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.4% 0.4% Duplication

@nihal467
Copy link
Member

@rithviknishad In the weekly call, we discussed about the two scroller been coming out in the asset creation page, are you working on it now or will it be a another PR coming after this one is merged !

@nihal467 nihal467 added the question Further information is requested label Sep 28, 2022
@rithviknishad
Copy link
Member Author

@nihal467 I'll make it as another PR then, since this PR has lot's of changes, its getting merge conflicts pretty quickly.

@rithviknishad rithviknishad removed the question Further information is requested label Sep 28, 2022
@nihal467
Copy link
Member

@rithviknishad
image

i feel like the card is little bit towards down, shall we move a bit up, just an opinion, what do you think,

@nihal467
Copy link
Member

@rithviknishad @khavinshankar seem like a small alignment issue, we can work on another PR, this LGTM,

Copy link
Member

@khavinshankar khavinshankar left a comment

Choose a reason for hiding this comment

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

@rithviknishad the ui looks awesome, and if you have time do refactor classname using clsx which improves the readability, I'm merging this, so pick it up as a new pr

@khavinshankar khavinshankar merged commit 6359b76 into ohcnetwork:develop Sep 28, 2022
@rithviknishad rithviknishad mentioned this pull request Oct 10, 2022
41 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Major Code Change This Tag represent PR, which will be causing major Code change in the platform needs review tested urgent
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Asset registration enhancements
4 participants