From cc7df65342e59e7baa96416debd05b2eb88b75d5 Mon Sep 17 00:00:00 2001 From: spwoodcock Date: Sat, 2 Mar 2024 22:43:43 +0000 Subject: [PATCH] refactor: remove projects.xform_title completely, in favour of xform_category --- src/backend/app/central/central_crud.py | 2 +- src/backend/app/db/db_models.py | 2 - src/backend/app/projects/project_crud.py | 45 ++---------------- src/backend/app/projects/project_routes.py | 36 +++----------- src/backend/app/projects/project_schemas.py | 4 +- .../app/submissions/submission_crud.py | 47 ++++++++----------- .../app/submissions/submission_routes.py | 2 +- src/backend/app/tasks/task_deps.py | 3 +- src/backend/app/tasks/tasks_routes.py | 7 +-- .../migrations/001-remove-complete-count.sql | 5 ++ .../migrations/init/fmtm_base_schema.sql | 1 - .../revert/001-remove-complete-count.sql | 5 ++ src/backend/tests/conftest.py | 2 +- src/backend/tests/test_projects_routes.py | 15 ++---- src/frontend/src/api/Project.js | 2 +- .../createnewproject/SplitTasks.tsx | 4 +- .../createproject/createProjectModel.ts | 2 +- .../src/models/project/projectModel.ts | 2 +- .../src/store/types/ICreateProject.ts | 4 +- 19 files changed, 60 insertions(+), 130 deletions(-) diff --git a/src/backend/app/central/central_crud.py b/src/backend/app/central/central_crud.py index 7d625fe5b2..5b2e639774 100644 --- a/src/backend/app/central/central_crud.py +++ b/src/backend/app/central/central_crud.py @@ -389,7 +389,7 @@ async def update_and_publish_form( form_name_prefix (str): Prefix for the form name in ODK Central. odk_credentials (project_schemas.ODKCentralDecrypted): ODK Central creds. """ - odk_form_name = f"{form_name_prefix}_{task_id}" + odk_form_name = f"{form_name_prefix}_task_{task_id}" xform_data = await read_and_test_xform( xform_data, form_file_ext, diff --git a/src/backend/app/db/db_models.py b/src/backend/app/db/db_models.py index d67880e9ff..466fa2b917 100644 --- a/src/backend/app/db/db_models.py +++ b/src/backend/app/db/db_models.py @@ -582,8 +582,6 @@ def tasks_bad(self): .count() ) - # XForm title for ODK Central (this never changes once set) - xform_title = cast(str, Column(String)) # XForm category specified xform_category = cast(str, Column(String)) diff --git a/src/backend/app/projects/project_crud.py b/src/backend/app/projects/project_crud.py index cbd84ce49d..87c037ee12 100644 --- a/src/backend/app/projects/project_crud.py +++ b/src/backend/app/projects/project_crud.py @@ -269,7 +269,7 @@ async def create_project_with_project_info( "Creating project in FMTM database with vars: " f"project_user: {current_user.username} | " f"project_name: {project_metadata.project_info.name} | " - f"xform_category: {project_metadata.xform_title} | " + f"xform_category: {project_metadata.xform_category} | " f"hashtags: {project_metadata.hashtags} | " f"organisation_id: {project_metadata.organisation_id}" ) @@ -284,7 +284,6 @@ async def create_project_with_project_info( db_project = db_models.DbProject( author_id=current_user.id, odkid=odk_project_id, - xform_category=project_metadata.xform_title, **project_metadata.model_dump(exclude=["project_info", "outline_geojson"]), ) db.add(db_project) @@ -305,35 +304,6 @@ async def create_project_with_project_info( return await convert_to_app_project(db_project) -async def upload_xlsform( - db: Session, - xlsform: str, - name: str, - category: str, -): - """Upload a custom XLSForm from the user.""" - try: - forms = table( - "xlsforms", - column("title"), - column("xls"), - column("xml"), - column("id"), - column("category"), - ) - ins = insert(forms).values(title=name, xls=xlsform, category=category) - sql = ins.on_conflict_do_update( - constraint="xlsforms_title_key", - set_=dict(title=name, xls=xlsform, category=category), - ) - db.execute(sql) - db.commit() - return True - except Exception as e: - log.exception(e) - raise HTTPException(status_code=400, detail={"message": str(e)}) from e - - async def create_tasks_from_geojson( db: Session, project_id: int, @@ -1292,14 +1262,9 @@ def generate_project_files( read_xform_sync = async_to_sync(central_crud.read_and_test_xform) xform_data = read_xform_sync(xlsform, form_file_ext, return_form_data=True) - # Generate extra task info as dicts (to allow closing db connection) - task_form_name_dict = {} - for task_id in task_extract_dict.keys(): - project_name = project.project_name_prefix - category = project.xform_title - task_form_name_dict[task_id] = f"{project_name}_{category}_{task_id}" - - # Get ODK Project ID from database + # Get project name for XForm name + project_name = project.project_name_prefix + # Get ODK Project ID project_odk_id = project.odkid # Run with expensive task via threadpool @@ -1317,7 +1282,7 @@ def wrap_generate_task_files(task_id): project_odk_id, task_id, task_extract_dict[task_id], - task_form_name_dict[task_id], + f"{project_name}_task_{task_id}", xform_data, odk_credentials, ) diff --git a/src/backend/app/projects/project_routes.py b/src/backend/app/projects/project_routes.py index 2913e2c894..9fdc8b8cb2 100644 --- a/src/backend/app/projects/project_routes.py +++ b/src/backend/app/projects/project_routes.py @@ -46,7 +46,7 @@ from sqlalchemy.sql import text from app.auth.osm import AuthUser, login_required -from app.auth.roles import mapper, org_admin, project_admin, super_admin +from app.auth.roles import mapper, org_admin, project_admin from app.central import central_crud from app.db import database, db_models from app.db.postgis_utils import ( @@ -384,29 +384,6 @@ async def project_partial_update( return project -@router.post("/upload_xlsform") -async def upload_custom_xls( - upload: UploadFile = File(...), - category: str = Form(...), - db: Session = Depends(database.get_db), - current_user: db_models.DbUser = Depends(super_admin), -): - """Upload a custom XLSForm to the database. - - Args: - upload (UploadFile): the XLSForm file - category (str): the category of the XLSForm. - db (Session): the DB session, provided automatically. - current_user (DbUser): Check if user is super_admin - """ - content = await upload.read() # read file content - name = upload.filename.split(".")[0] # get name of file without extension - await project_crud.upload_xlsform(db, content, name, category) - - # FIXME: fix return value - return {"xform_title": f"{category}"} - - @router.post("/{project_id}/upload-task-boundaries") async def upload_project_task_boundaries( project_id: int, @@ -588,7 +565,7 @@ async def generate_files( project = org_user_dict.get("project") - xform_title = project.xform_title + xform_category = project.xform_category custom_xls_form = None file_ext = None if xls_form_upload: @@ -621,7 +598,7 @@ async def generate_files( db, project_id, BytesIO(custom_xls_form) if custom_xls_form else None, - xform_title, + xform_category, file_ext if xls_form_upload else ".xls", background_task_id, ) @@ -853,8 +830,7 @@ async def download_form( "Content-Type": "application/media", } if not project.form_xls: - project_category = project.xform_title - xlsform_path = f"{xlsforms_path}/{project_category}.xls" + xlsform_path = f"{xlsforms_path}/{project.xform_category}.xls" if os.path.exists(xlsform_path): return FileResponse(xlsform_path, filename="form.xls") else: @@ -901,13 +877,13 @@ async def update_project_form( with open(xlsform_path, "rb") as f: new_xform_data = BytesIO(f.read()) - # NOTE never update xform_title as this links to ODK Central + # Update form category in database project.xform_category = category # Commit changes to db db.commit() # The reference to the form via ODK Central API (minus task_id) - xform_name_prefix = f"{project.project_name_prefix}_{project.xform_title}" + xform_name_prefix = project.project_name_prefix # Get ODK Central credentials for project odk_creds = await project_deps.get_odk_credentials(db, project.id) diff --git a/src/backend/app/projects/project_schemas.py b/src/backend/app/projects/project_schemas.py index 77b150b12f..ce7cec6e91 100644 --- a/src/backend/app/projects/project_schemas.py +++ b/src/backend/app/projects/project_schemas.py @@ -136,7 +136,7 @@ class ProjectIn(BaseModel): """Upload new project.""" project_info: ProjectInfo - xform_title: str + xform_category: str organisation_id: Optional[int] = None hashtags: Optional[List[str]] = None task_split_type: Optional[TaskSplitType] = None @@ -313,7 +313,7 @@ class ProjectBase(BaseModel): project_info: ProjectInfo status: ProjectStatus # location_str: str - xform_title: Optional[str] = None + xform_category: Optional[str] = None hashtags: Optional[List[str]] = None organisation_id: Optional[int] = None diff --git a/src/backend/app/submissions/submission_crud.py b/src/backend/app/submissions/submission_crud.py index 52d390b90b..682ed019d7 100644 --- a/src/backend/app/submissions/submission_crud.py +++ b/src/backend/app/submissions/submission_crud.py @@ -62,7 +62,6 @@ def get_submission_of_project(db: Session, project_id: int, task_id: int = None) odkid = project_info.odkid project_name = project_info.project_name_prefix - xform_title = project_info.xform_title project_tasks = project_info.tasks if not ( @@ -87,9 +86,9 @@ def get_submission_of_project(db: Session, project_id: int, task_id: int = None) data = [] - for id in task_list: + for task_list_id in task_list: # XML Form Id is a combination or project_name, category and task_id - xform_name = f"{project_name}_{xform_title}_{id}" + xform_name = f"{project_name}_task_{task_list_id}" submission_list = xform.listSubmissions(odkid, xform_name) # data.append(submission_list) @@ -100,7 +99,7 @@ def get_submission_of_project(db: Session, project_id: int, task_id: int = None) else: # If task_id is provided, submission made to this particular task is returned. - xform_name = f"{project_name}_{xform_title}_{task_id}" + xform_name = f"{project_name}_task_{task_id}" submission_list = xform.listSubmissionBasicInfo(odkid, xform_name) for x in submission_list: x["submitted_by"] = xform_name @@ -143,8 +142,7 @@ def convert_to_osm(db: Session, project_id: int, task_id: int): odkid = project_info.odkid project_name = project_info.project_name_prefix - xform_title = project_info.xform_title - xform_name = f"{project_name}_{xform_title}_{task_id}" + xform_name = f"{project_name}_task_{task_id}" # ODK Credentials odk_sync = async_to_sync(project_deps.get_odk_credentials) @@ -153,7 +151,7 @@ def convert_to_osm(db: Session, project_id: int, task_id: int): xform = get_odk_form(odk_credentials) # Create a new ZIP file for the extracted files - final_zip_file_path = f"/tmp/{project_name}_{xform_title}_osm.zip" + final_zip_file_path = f"/tmp/{project_name}_osm.zip" # Remove the ZIP file if it already exists if os.path.exists(final_zip_file_path): @@ -218,7 +216,6 @@ async def gather_all_submission_csvs(db, project_id): odkid = project_info.odkid project_name = project_info.project_name_prefix - xform_title = project_info.xform_title project_tasks = project_info.tasks # ODK Credentials @@ -232,9 +229,9 @@ def download_submission_for_task(task_id): f"Thread {threading.current_thread().name} - " f"Downloading submission for Task ID {task_id}" ) - xform_name = f"{project_name}_{xform_title}_{task_id}" + xform_name = f"{project_name}_form_{task_id}" file = xform.getSubmissionMedia(odkid, xform_name) - file_path = f"{project_name}_{xform_title}_submission_{task_id}.zip" + file_path = f"{project_name}_submission_{task_id}.zip" with open(file_path, "wb") as f: f.write(file.content) return file_path @@ -295,7 +292,7 @@ def extract_files(zip_file_path): ) # Create a new ZIP file for the extracted files - final_zip_file_path = f"{project_name}_{xform_title}_submissions_final.zip" + final_zip_file_path = f"{project_name}_submissions_final.zip" with zipfile.ZipFile(final_zip_file_path, mode="w") as final_zip_file: for file_path in extracted_files: final_zip_file.write(file_path) @@ -429,8 +426,7 @@ def get_all_submissions_json(db: Session, project_id): get_task_id_list_sync = async_to_sync(tasks_crud.get_task_id_list) task_list = get_task_id_list_sync(db, project_id) xform_list = [ - f"{project_info.project_name_prefix}_{project_info.xform_title}_{task}" - for task in task_list + f"{project_info.project_name_prefix}_task_{task}" for task in task_list ] submissions = project.getAllSubmissions(project_info.odkid, xform_list) @@ -487,7 +483,6 @@ async def download_submission( odkid = project_info.odkid project_name = project_info.project_name_prefix - xform_title = project_info.xform_title project_tasks = project_info.tasks # ODK Credentials @@ -505,19 +500,17 @@ async def download_submission( task_list = [x.id for x in project_tasks] # # Create a new ZIP file for all submissions - # zip_file_path = f"{project_name}_{xform_title}_submissions.zip" + # zip_file_path = f"{project_name}_submissions.zip" files = [] for task_list_id in task_list: - xform_name = f"{project_name}_{xform_title}_{task_list_id}" + xform_name = f"{project_name}_task_{task_list_id}" # XML Form Id is a combination or project_name, category and task_id file = xform.getSubmissionMedia(odkid, xform_name) # Create a new output file for each submission - file_path = ( - f"{project_name}_{xform_title}_submission_{task_list_id}.zip" - ) + file_path = f"{project_name}_submission_{task_list_id}.zip" with open(file_path, "wb") as f: f.write(file.content) @@ -536,14 +529,14 @@ async def download_submission( ] # Add the extracted file paths to the list of extracted files # Create a new ZIP file for the extracted files - final_zip_file_path = f"{project_name}_{xform_title}_submissions_final.zip" + final_zip_file_path = f"{project_name}_submissions_final.zip" with zipfile.ZipFile(final_zip_file_path, mode="w") as final_zip_file: for file_path in extracted_files: final_zip_file.write(file_path) return FileResponse(final_zip_file_path) else: - xform_name = f"{project_name}_{xform_title}_{task_id}" + xform_name = f"{project_name}_task_{task_id}" file = xform.getSubmissionMedia(odkid, xform_name) with open(file_path, "wb") as f: f.write(file.content) @@ -559,7 +552,7 @@ async def download_submission( if task_id is None: task_list = [x.id for x in project_tasks] for task_list_id in task_list: - xform_name = f"{project_name}_{xform_title}_{task_list_id}" + xform_name = f"{project_name}_task_{task_list_id}" file = xform.getSubmissions(odkid, xform_name, None, False, True) if not file: json_data = None @@ -569,7 +562,7 @@ async def download_submission( if json_data_value: files.extend(json_data_value) else: - xform_name = f"{project_name}_{xform_title}_{task_id}" + xform_name = f"{project_name}_task_{task_id}" file = xform.getSubmissions(odkid, xform_name, None, False, True) json_data = json.loads(file) @@ -594,14 +587,13 @@ async def get_submission_points(db: Session, project_id: int, task_id: int = Non odkid = project_info.odkid project_name = project_info.project_name_prefix - xform_title = project_info.xform_title # ODK Credentials odk_credentials = await project_deps.get_odk_credentials(db, project_id) xform = get_odk_form(odk_credentials) if task_id: - xform_name = f"{project_name}_{xform_title}_{task_id}" + xform_name = f"{project_name}_task_{task_id}" # file_path = f"{project_id}_submissions.zip" response_file = xform.getSubmissionMedia(odkid, xform_name) @@ -647,7 +639,6 @@ async def get_submission_count_of_a_project(db: Session, project_id: int): odkid = project_info.odkid project_name = project_info.project_name_prefix - xform_title = project_info.xform_title project_tasks = project_info.tasks # ODK Credentials @@ -659,7 +650,7 @@ async def get_submission_count_of_a_project(db: Session, project_id: int): task_list = [x.id for x in project_tasks] for task_id in task_list: - xform_name = f"{project_name}_{xform_title}_{task_id}" + xform_name = f"{project_name}_task_{task_id}" file = xform.getSubmissions(odkid, xform_name, None, False, True) if not file: json_data = None @@ -823,7 +814,7 @@ async def get_submission_by_task( odk_credentials = await project_deps.get_odk_credentials(db, project.id) xform = get_odk_form(odk_credentials) - xform_name = f"{project.project_name_prefix}_{project.xform_title}_{task_id}" + xform_name = f"{project.project_name_prefix}_task_{task_id}" data = xform.listSubmissions(project.odkid, xform_name, filters) submissions = data.get("value", []) count = data.get("@odata.count", 0) diff --git a/src/backend/app/submissions/submission_routes.py b/src/backend/app/submissions/submission_routes.py index 087c38faa3..dcc69fdeed 100644 --- a/src/backend/app/submissions/submission_routes.py +++ b/src/backend/app/submissions/submission_routes.py @@ -361,7 +361,7 @@ async def get_submission_form_fields( task_list = await tasks_crud.get_task_id_list(db, project_id) odk_credentials = await project_deps.get_odk_credentials(db, project_id) odk_form = central_crud.get_odk_form(odk_credentials) - xform = f"{project.project_name_prefix}_{project.xform_title}_{task_list[0]}" + xform = f"{project.project_name_prefix}_task_{task_list[0]}" return odk_form.formFields(project.odkid, xform) diff --git a/src/backend/app/tasks/task_deps.py b/src/backend/app/tasks/task_deps.py index c539a8e8dc..b997f90264 100644 --- a/src/backend/app/tasks/task_deps.py +++ b/src/backend/app/tasks/task_deps.py @@ -46,6 +46,5 @@ async def get_xform_name( db_project = project project_name = db_project.project_name_prefix - xform_title = db_project.xform_title - form_name = f"{project_name}_{xform_title}_{task_id}" + form_name = f"{project_name}_task_{task_id}" return form_name diff --git a/src/backend/app/tasks/tasks_routes.py b/src/backend/app/tasks/tasks_routes.py index e686a9815e..830d18df10 100644 --- a/src/backend/app/tasks/tasks_routes.py +++ b/src/backend/app/tasks/tasks_routes.py @@ -173,13 +173,10 @@ async def task_features_count( feature_count_task_dict = {f"{record[0]}": record[1] for record in feature_counts} project_name_prefix = project.project_name_prefix - xform_title = project.xform_title for x in odk_details: - # Strip project name and form type from xmlFormId - task_id = f"{x['xmlFormId']}".strip(f"{project_name_prefix}_").strip( - f"_{xform_title}" - ) + # Strip everything except task id from xmlFormId + task_id = f"{x['xmlFormId']}".strip(f"{project_name_prefix}_").strip("_task") data.append( { diff --git a/src/backend/migrations/001-remove-complete-count.sql b/src/backend/migrations/001-remove-complete-count.sql index 1f6a2f083d..609cf7e5cd 100644 --- a/src/backend/migrations/001-remove-complete-count.sql +++ b/src/backend/migrations/001-remove-complete-count.sql @@ -1,5 +1,6 @@ -- ## Migration to: -- * Remove projects.extract_completed_count +-- * Remove projects.xform_title -- * Add projects.xform_category -- * Remove projects.xform_title foreign key constraint @@ -10,6 +11,10 @@ BEGIN; ALTER TABLE IF EXISTS public.projects DROP COLUMN IF EXISTS extract_completed_count; +-- Remove xform_title +ALTER TABLE IF EXISTS public.projects +DROP COLUMN IF EXISTS xform_title; + -- Add xform_category ALTER TABLE IF EXISTS public.projects ADD COLUMN IF NOT EXISTS xform_category character varying; diff --git a/src/backend/migrations/init/fmtm_base_schema.sql b/src/backend/migrations/init/fmtm_base_schema.sql index f43fac45d4..271f6c4129 100644 --- a/src/backend/migrations/init/fmtm_base_schema.sql +++ b/src/backend/migrations/init/fmtm_base_schema.sql @@ -343,7 +343,6 @@ CREATE TABLE public.projects ( last_updated timestamp without time zone, status public.projectstatus NOT NULL, total_tasks integer, - xform_title character varying, xform_category character varying, visibility public.projectvisibility NOT NULL DEFAULT 'PUBLIC', mapper_level public.mappinglevel NOT NULL, diff --git a/src/backend/migrations/revert/001-remove-complete-count.sql b/src/backend/migrations/revert/001-remove-complete-count.sql index 837446f67c..2c65b8df30 100644 --- a/src/backend/migrations/revert/001-remove-complete-count.sql +++ b/src/backend/migrations/revert/001-remove-complete-count.sql @@ -5,6 +5,11 @@ BEGIN; ALTER TABLE IF EXISTS public.projects ADD COLUMN IF NOT EXISTS extract_complete_count integer; +-- Add the 'xform_title' column if it doesn't exist + +ALTER TABLE IF EXISTS public.projects +ADD COLUMN IF NOT EXISTS xform_title character varying; + -- Remove the 'xform_category' column if it exists ALTER TABLE IF EXISTS public.projects DROP COLUMN IF EXISTS xform_category; diff --git a/src/backend/tests/conftest.py b/src/backend/tests/conftest.py index 72e008e558..415f1e0d48 100644 --- a/src/backend/tests/conftest.py +++ b/src/backend/tests/conftest.py @@ -130,7 +130,7 @@ async def project(db, admin_user, organisation): short_description="test", description="test", ), - xform_title="buildings", + xform_category="buildings", odk_central_url=os.getenv("ODK_CENTRAL_URL"), odk_central_user=os.getenv("ODK_CENTRAL_USER"), odk_central_password=os.getenv("ODK_CENTRAL_PASSWD"), diff --git a/src/backend/tests/test_projects_routes.py b/src/backend/tests/test_projects_routes.py index 40219fca10..ccc972dc90 100644 --- a/src/backend/tests/test_projects_routes.py +++ b/src/backend/tests/test_projects_routes.py @@ -60,7 +60,7 @@ async def test_create_project(client, admin_user, organisation): "short_description": "test", "description": "test", }, - "xform_title": "buildings", + "xform_category": "buildings", "hashtags": ["#FMTM"], "outline_geojson": { "coordinates": [ @@ -280,14 +280,9 @@ async def test_generate_project_files(db, client, project): xlsform_obj, xlsform_file.suffix.lower(), return_form_data=True ) - # Generate extra task info as dicts (to allow closing db connection) - task_form_name_dict = {} - for task_id in split_extract_dict.keys(): - project_name = project.project_name_prefix - category = project.xform_title - task_form_name_dict[task_id] = f"{project_name}_{category}_{task_id}" - - # Get ODK Project ID from database + # Get project name for XForm name + project_name = project.project_name_prefix + # Get ODK Project ID project_odk_id = project.odkid for task_id in split_extract_dict.keys(): @@ -302,7 +297,7 @@ async def test_generate_project_files(db, client, project): project_odk_id, task_id, split_extract_dict[task_id], - task_form_name_dict[task_id], + f"{project_name}_task_{task_id}", xform_data, odk_credentials, ) diff --git a/src/frontend/src/api/Project.js b/src/frontend/src/api/Project.js index 1e3e738617..c9b62d1279 100755 --- a/src/frontend/src/api/Project.js +++ b/src/frontend/src/api/Project.js @@ -39,7 +39,7 @@ export const ProjectById = (existingProjectList, projectId) => { total_tasks: projectResp.total_tasks, tasks_mapped: projectResp.tasks_mapped, tasks_validated: projectResp.tasks_validated, - xform_title: projectResp.xform_title, + xform_category: projectResp.xform_category, tasks_bad: projectResp.tasks_bad, data_extract_url: projectResp.data_extract_url, }), diff --git a/src/frontend/src/components/createnewproject/SplitTasks.tsx b/src/frontend/src/components/createnewproject/SplitTasks.tsx index f0389065ae..182dac93c6 100644 --- a/src/frontend/src/components/createnewproject/SplitTasks.tsx +++ b/src/frontend/src/components/createnewproject/SplitTasks.tsx @@ -102,8 +102,8 @@ const SplitTasks = ({ flag, geojsonFile, setGeojsonFile, customDataExtractUpload odk_central_url: projectDetails.odk_central_url, odk_central_user: projectDetails.odk_central_user, odk_central_password: projectDetails.odk_central_password, - // dont send xform_title if upload custom form is selected - xform_title: projectDetails.formCategorySelection, + // dont send xform_category if upload custom form is selected + xform_category: projectDetails.formCategorySelection, task_split_type: splitTasksSelection, form_ways: projectDetails.formWays, // "uploaded_form": projectDetails.uploaded_form, diff --git a/src/frontend/src/models/createproject/createProjectModel.ts b/src/frontend/src/models/createproject/createProjectModel.ts index 8035e0aa3b..0d027bd38b 100755 --- a/src/frontend/src/models/createproject/createProjectModel.ts +++ b/src/frontend/src/models/createproject/createProjectModel.ts @@ -11,7 +11,7 @@ export interface ProjectDetailsModel { per_task_instructions: string; }; status: number; - xform_title: string; + xform_category: string; location_str: string; outline_geojson: { type: string; diff --git a/src/frontend/src/models/project/projectModel.ts b/src/frontend/src/models/project/projectModel.ts index d161211104..622ad040d0 100644 --- a/src/frontend/src/models/project/projectModel.ts +++ b/src/frontend/src/models/project/projectModel.ts @@ -59,7 +59,7 @@ export type projectInfoType = { location_str: string; description: string; short_description: string; - xform_title: string; + xform_category: string; data_extract_url: string; num_contributors: any; tasks_bad: any; diff --git a/src/frontend/src/store/types/ICreateProject.ts b/src/frontend/src/store/types/ICreateProject.ts index 29439c5927..8de2ebb00c 100644 --- a/src/frontend/src/store/types/ICreateProject.ts +++ b/src/frontend/src/store/types/ICreateProject.ts @@ -85,7 +85,7 @@ type EditProjectResponseTypes = { status: number; outline_geojson: GeoJSONFeatureTypes; tasks: ProjectTaskTypes[]; - xform_title: string; + xform_category: string; hashtags: string[]; }; export type EditProjectDetailsTypes = { @@ -109,7 +109,7 @@ export type ProjectDetailsTypes = { short_description?: string; description?: string; task_split_type?: number; - xform_title?: string; + xform_category?: string; data_extract_options?: string; form_ways?: string; organisation_id?: number | null;