Skip to content

Commit

Permalink
Merge pull request #1314 from sriranjan-s/Dev-2.0
Browse files Browse the repository at this point in the history
added frontend changesnfor build
  • Loading branch information
sriranjan-s authored Sep 1, 2024
2 parents 19a1e54 + 8fcdadb commit 9f2ed4a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 29 deletions.
2 changes: 1 addition & 1 deletion frontend/micro-ui/web/micro-ui-internals/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"build:dss": "cd packages/modules/dss && yarn build",
"buildD:mcollect": "cd packages/modules/mCollect && yarn build",
"buildD:receipts": "cd packages/modules/receipts && yarn build",
"buildD:tl": "cd packages/modules/tl && yarn build",
"build:tl": "cd packages/modules/tl && yarn build",
"buildD:ptr": "cd packages/modules/ptr && yarn build",
"buildD:hrms": "cd packages/modules/hrms && yarn build",
"build:obps": "cd packages/modules/obps && yarn build",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,4 @@

/**
* @author - Shivank Shukla - NIUA
* Addition of feature of fetching Latitude and Longitude from uploaded photo
- i have added a function (extractGeoLocation) to extract latitude and longitude from an uploaded image file.
- It takes the file object as input and returns a promise.
- Within the promise, EXIF.get() is called with the file object to extract EXIF data.
- Latitude and longitude are then retrieved from the EXIF data and converted to decimal format using the convertToDecimal function.
- If latitude and longitude are found, the promise is resolved with an object containing latitude and longitude.
Otherwise, if not found still it resolve the promise with latitude and longitude as NULL value.
- The convertToDecimal function converts GPS coordinates from degrees, minutes, and seconds format to decimal format.
- The getData function is modified to include the geolocation extraction logic.
- When files are uploaded (e?.length > 0), the function extractGeoLocation extracts geolocation if any
- If geolocation extraction is successful, it logs the latitude and longitude to the console.
- After extracting geolocation, the function continues with the existing logic to handle the uploaded files.
*/









import React, { useEffect, useMemo, useState } from "react";
import {
Expand Down Expand Up @@ -159,6 +133,22 @@ const SelectDocument = React.memo(function MyComponent({
const [latitude, setLatitude] = useState(null);
const [longitude, setLongitude] = useState(null);
////////////////////////////////////////////////////////////
/*
* Addition of feature of fetching Latitude and Longitude from uploaded photo
- i have added a function (extractGeoLocation) to extract latitude and longitude from an uploaded image file.
- It takes the file object as input and returns a promise.
- Within the promise, EXIF.get() is called with the file object to extract EXIF data.
- Latitude and longitude are then retrieved from the EXIF data and converted to decimal format using the convertToDecimal function.
- If latitude and longitude are found, the promise is resolved with an object containing latitude and longitude.
Otherwise, if not found still it resolve the promise with latitude and longitude as NULL value.
- The convertToDecimal function converts GPS coordinates from degrees, minutes, and seconds format to decimal format.
- The getData function is modified to include the geolocation extraction logic.
- When files are uploaded (e?.length > 0), the function extractGeoLocation extracts geolocation if any
- If geolocation extraction is successful, it logs the latitude and longitude to the console.
- After extracting geolocation, the function continues with the existing logic to handle the uploaded files.
*/
function extractGeoLocation(file) {
return new Promise((resolve) => {
EXIF.getData(file, function() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import { SubmitBar } from '@upyog/digit-ui-react-components';
import { useTranslation } from "react-i18next";
import { useParams } from "react-router-dom";




const CitizenConsent = ({ showTermsPopup, setShowTermsPopup, otpVerifiedTimestamp }) => {
Expand Down

0 comments on commit 9f2ed4a

Please sign in to comment.