Skip to content

Commit

Permalink
Update manager workflows terminologies (#2026)
Browse files Browse the repository at this point in the history
* fix(selectForm): update terminology

* fix(dataExtract): update terminology

* fix(splitTasks): update text, remove additional-feature count section

* fix(dataExtract): add additional-feature count section

* fix(description): update description

* fix(uploadArea): update btn text, show reset if geojson is drawn

* fix(01-create-new-project): update test case based on changes
  • Loading branch information
NSUWAL123 authored Dec 25, 2024
1 parent 45a518d commit ece3b43
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 27 deletions.
2 changes: 1 addition & 1 deletion src/frontend/e2e/01-create-new-project.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ test.skip('create new project', async ({ browserName, page }) => {
const dataExtractRadio = await page.getByText('Fetch data from OSM');
await dataExtractRadio.click();
await expect(dataExtractRadio).toBeChecked();
await page.getByRole('button', { name: 'Generate Map Data' }).click();
await page.getByRole('button', { name: 'Fetch OSM Data' }).click();
await page.getByRole('button', { name: 'NEXT' }).click();

// 5. Split Tasks Step
Expand Down
10 changes: 8 additions & 2 deletions src/frontend/src/components/createnewproject/DataExtract.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ const DataExtract = ({
/>
{extractWays === 'osm_data_extract' && (
<Button
btnText="Generate Map Data"
btnText="Fetch OSM Data"
btnType="primary"
onClick={() => {
resetFile(setCustomDataExtractUpload);
Expand Down Expand Up @@ -324,6 +324,12 @@ const DataExtract = ({
/>
</>
)}
{additionalFeatureGeojson && (
<p className="fmtm-text-gray-500 fmtm-mt-1">
Total number of additional features:{' '}
<span className="fmtm-font-bold">{additionalFeatureGeojson?.features?.length || 0}</span>
</p>
)}
</div>
)}
</div>
Expand All @@ -340,7 +346,7 @@ const DataExtract = ({
btnType="primary"
type="submit"
className="fmtm-font-bold"
dataTip={`${!dataExtractGeojson ? 'Please Generate Map Data First.' : ''}`}
dataTip={`${!dataExtractGeojson ? 'Please Fetch OSM Data First.' : ''}`}
disabled={
!dataExtractGeojson || (extractWays === 'osm_data_extract' && !dataExtractGeojson) || isFgbFetching
? true
Expand Down
5 changes: 2 additions & 3 deletions src/frontend/src/components/createnewproject/Description.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,13 @@ const UploadArea = ({ hoveredSection }: hoveredSectionType) => {
ref={drawRef}
className={`${hoveredSection === 'uploadarea-draw' && 'fmtm-text-gray-800'} fmtm-duration-150`}
>
<p>You may also draw a freehand polygon on map interface.</p>{' '}
<p>Click on the reset button to redraw the AOI.</p>
<p>You can draw a freehand polygon on map interface.</p> <p>Click on the reset button to redraw the AOI.</p>
</div>
<div
ref={uploadRef}
className={`${hoveredSection === 'uploadarea-upload_file' && 'fmtm-text-gray-800'} fmtm-duration-150`}
>
<p>You can choose to upload the AOI. Note: The file upload only supports .geojson format. </p>
<p>You may also choose to upload the AOI. Note: The file upload only supports .geojson format. </p>
</div>
<span>The total area of the AOI is also calculated and displayed on the screen.</span>
<p
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ const SelectForm = ({ flag, geojsonFile, customFormFile, setCustomFormFile }) =>
onChange={changeFileHandler}
onResetFile={resetFile}
customFile={customFormFile}
btnText="Select a Form"
btnText="Upload XLSForm"
accept=".xls,.xlsx,.xml"
fileDescription="*The supported file formats are .xlsx, .xls, .xml"
errorMsg={errors.customFormUpload}
Expand Down
10 changes: 2 additions & 8 deletions src/frontend/src/components/createnewproject/SplitTasks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const SplitTasks = ({ flag, setGeojsonFile, customDataExtractUpload, additionalF
{
name: 'define_tasks',
value: task_split_type.CHOOSE_AREA_AS_TASK,
label: 'Choose area as task',
label: 'Use uploaded AOI as task areas',
disabled: false,
},
{
Expand Down Expand Up @@ -240,7 +240,7 @@ const SplitTasks = ({ flag, setGeojsonFile, customDataExtractUpload, additionalF
<div>
<RadioButton
value={splitTasksSelection || ''}
topic="Select an option to split the task"
topic="Select an option to split your project area"
options={taskSplitOptions}
direction="column"
onChangeData={(value) => {
Expand All @@ -267,12 +267,6 @@ const SplitTasks = ({ flag, setGeojsonFile, customDataExtractUpload, additionalF
Total number of features:{' '}
<span className="fmtm-font-bold">{dataExtractGeojson?.features?.length || 0}</span>
</p>
{additionalFeatureGeojson && (
<p className="fmtm-text-gray-500 fmtm-mt-1">
Total number of additional features:{' '}
<span className="fmtm-font-bold">{additionalFeatureGeojson?.features?.length || 0}</span>
</p>
)}
</div>
{splitTasksSelection === task_split_type.DIVIDE_ON_SQUARE && (
<>
Expand Down
21 changes: 9 additions & 12 deletions src/frontend/src/components/createnewproject/UploadArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -249,17 +249,14 @@ const UploadArea = ({ flag, geojsonFile, setGeojsonFile, setCustomDataExtractUpl
{uploadAreaSelection === 'draw' && (
<div>
<p className="fmtm-text-gray-700 fmtm-pt-5 fmtm-pb-5">Draw a polygon on the map to plot the area</p>
<Button
btnText="Reset"
btnType="secondary"
type="button"
onClick={() => resetFile()}
className=""
disabled={drawnGeojson ? false : true}
/>
<p className="fmtm-text-gray-700 fmtm-mt-5">
Total Area: <span className="fmtm-font-bold">{totalAreaSelection}</span>
</p>
{drawnGeojson && (
<>
<Button btnText="Reset" btnType="secondary" type="button" onClick={() => resetFile()} />
<p className="fmtm-text-gray-700 fmtm-mt-5">
Total Area: <span className="fmtm-font-bold">{totalAreaSelection}</span>
</p>
</>
)}
{errors.drawnGeojson && (
<div>
<p className="fmtm-form-error fmtm-text-red-600 fmtm-text-sm fmtm-py-1">{errors.drawnGeojson}</p>
Expand All @@ -278,7 +275,7 @@ const UploadArea = ({ flag, geojsonFile, setGeojsonFile, setCustomDataExtractUpl
onResetFile={resetFile}
accept=".geojson, .json"
fileDescription="*The supported file format is geojson file."
btnText="Upload a Geojson"
btnText="Upload"
errorMsg={errors.uploadedAreaFile}
/>
<p className="fmtm-text-gray-700">
Expand Down

0 comments on commit ece3b43

Please sign in to comment.