Skip to content

Commit

Permalink
fix: project org UI issues (#1230)
Browse files Browse the repository at this point in the history
* fix editProject: formUpdate file extension spelling corrected to xlsx

* fix header: activeTab selection based on url pathname

* refactor primaryAppBar: unnecessary commented code remove

* feat assetModules: tuneIcon add

* feat shadcnDropdown: shadcn dropdown add

* fix select: zIndex add to selectContent

* fix submissionsFilter: UI enhancement

* fix submissionTable: logic add to handle Point & object to display dynamic table

* feat submissionsTable: buttons add

* fix modal: modal props type add

* fix taskService: josmService comment update

* feat projectSubmissions: uploadToJosm api integration & modalOpen on josmError

* fix dropdown: dropdownMenu UI fix

* feat submissionTable: download as csv & json dropdown add on download option

* fix taskService: axios get replace fetch for convertXMLToJOSM service
  • Loading branch information
NSUWAL123 authored Feb 20, 2024
1 parent 9f00b9b commit 62eaed8
Show file tree
Hide file tree
Showing 10 changed files with 554 additions and 117 deletions.
2 changes: 2 additions & 0 deletions src/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
"@mui/system": "^5.14.12",
"@radix-ui/react-checkbox": "^1.0.4",
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-dropdown-menu": "^2.0.6",
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-progress": "^1.0.3",
"@radix-ui/react-select": "^1.2.2",
"@radix-ui/react-switch": "^1.0.3",
Expand Down
138 changes: 138 additions & 0 deletions src/frontend/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 9 additions & 7 deletions src/frontend/src/api/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,12 @@ export const ConvertXMLToJOSM: Function = (url: string, projectBbox) => {
const getConvertXMLToJOSM = async (url) => {
try {
// checkJOSMOpen - To check if JOSM Editor is Open Or Not.
await CoreModules.axios.get(`http://127.0.0.1:8111/version?jsonp=checkJOSM`);
//importToJosmEditor - To open JOSM Editor and add XML of Project Submission To JOSM.
CoreModules.axios.get(
await fetch(`http://127.0.0.1:8111/version?jsonp=checkJOSM`);
//importToJosmEditor - To open JOSM Editor and add base layer To JOSM.
fetch(
`http://127.0.0.1:8111/imagery?title=osm&type=tms&url=https://tile.openstreetmap.org/%7Bzoom%7D/%7Bx%7D/%7By%7D.png`,
);
await CoreModules.axios.get(`http://127.0.0.1:8111/import?url=${url}`);
await fetch(`http://127.0.0.1:8111/import?url=${url}`);
// `http://127.0.0.1:8111/load_and_zoom?left=80.0580&right=88.2015&top=27.9268&bottom=26.3470`;

const loadAndZoomParams = {
Expand All @@ -202,9 +202,11 @@ export const ConvertXMLToJOSM: Function = (url: string, projectBbox) => {
new_layer: 'true',
layer_name: 'OSM Data',
};
await CoreModules.axios.get(`http://127.0.0.1:8111/zoom`, {
params: loadAndZoomParams,
});
const queryString = Object.keys(loadAndZoomParams)
.map((key) => key + '=' + loadAndZoomParams[key])
.join('&');

await fetch(`http://127.0.0.1:8111/zoom?${queryString}`);
} catch (error: any) {
dispatch(CoreModules.TaskActions.SetJosmEditorError('JOSM Error'));
// alert(error.response.data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ const FormUpdateTab = ({ projectId }) => {
<div className="fmtm-flex fmtm-flex-col fmtm-gap-10">
<UploadArea
title="Upload Form"
label="Please upload .xls, .slxs, .xml file"
label="Please upload .xls, .xlsx, .xml file"
multiple={false}
data={uploadForm || []}
filterKey="url"
onUploadFile={(updatedFiles) => {
setUploadForm(updatedFiles);
}}
acceptedInput=".xls, .slxs, .xml"
acceptedInput=".xls, .xlsx, .xml"
/>
<div className="fmtm-flex fmtm-justify-center">
<Button onClick={onSave} btnText="UPDATE" btnType="primary" className="fmtm-rounded-md" />
Expand Down
Loading

0 comments on commit 62eaed8

Please sign in to comment.