From 7f0381b6b9191ce929ab79f9bedcce871c6ad441 Mon Sep 17 00:00:00 2001 From: Abhishekfm Date: Fri, 29 May 2026 18:07:06 +0530 Subject: [PATCH 1/9] Update AI Models navigation and publish functionality --- .../aimodels/edit/[id]/publish/page.tsx | 30 +++++++---- .../[entitySlug]/aimodels/page.tsx | 52 +++++++++++-------- 2 files changed, 50 insertions(+), 32 deletions(-) diff --git a/app/[locale]/dashboard/[entityType]/[entitySlug]/aimodels/edit/[id]/publish/page.tsx b/app/[locale]/dashboard/[entityType]/[entitySlug]/aimodels/edit/[id]/publish/page.tsx index 4e147fe6..0ccff274 100644 --- a/app/[locale]/dashboard/[entityType]/[entitySlug]/aimodels/edit/[id]/publish/page.tsx +++ b/app/[locale]/dashboard/[entityType]/[entitySlug]/aimodels/edit/[id]/publish/page.tsx @@ -197,27 +197,37 @@ export default function PublishPage() { setStatus('saving'); mutate( { - status: 'ACTIVE', - isPublic: true, - isActive: true, + status: isPublished ? 'REGISTERED' : 'ACTIVE', + isPublic: isPublished ? false : true, + isActive: isPublished ? false : true, }, { onSuccess: () => { - toast('Model published successfully', { - id: PUBLISH_SUCCESS_TOAST_ID, - }); + toast( + isPublished + ? 'Model unpublished successfully' + : 'Model published successfully', + { + id: PUBLISH_SUCCESS_TOAST_ID, + } + ); setStatus('saved'); refetch(); router.push( - `/dashboard/${params.entityType}/${params.entitySlug}/aimodels?tab=active` + `/dashboard/${params.entityType}/${params.entitySlug}/aimodels?tab=${isPublished ? 'draft' : 'published'}` ); }, onError: (error: any) => { const errorMessage = typeof error?.message === 'string' && error.message.trim() ? error.message.trim() - : 'Unable to publish model right now. Please try again.'; - toast(`Error: ${errorMessage}`, { id: PUBLISH_ERROR_TOAST_ID }); + : isPublished + ? 'Unable to unpublish model right now. Please try again.' + : 'Unable to publish model right now. Please try again.'; + toast( + isPublished ? `Error: ${errorMessage}` : `Error: ${errorMessage}`, + { id: PUBLISH_ERROR_TOAST_ID } + ); setStatus('unsaved'); }, } @@ -531,7 +541,7 @@ export default function PublishPage() { disabled={isPublishDisabled} loading={updateLoading} > - Publish + {isPublished ? 'Unpublish' : 'Publish'} )} diff --git a/app/[locale]/dashboard/[entityType]/[entitySlug]/aimodels/page.tsx b/app/[locale]/dashboard/[entityType]/[entitySlug]/aimodels/page.tsx index ab081821..0a3eeb23 100644 --- a/app/[locale]/dashboard/[entityType]/[entitySlug]/aimodels/page.tsx +++ b/app/[locale]/dashboard/[entityType]/[entitySlug]/aimodels/page.tsx @@ -70,20 +70,20 @@ export default function AIModelsPage({ let navigationOptions = [ { - label: 'Registered', - url: `registered`, - selected: navigationTab === 'registered', + label: 'Draft', + url: `draft`, + selected: navigationTab === 'draft', }, { - label: 'Active', - url: `active`, - selected: navigationTab === 'active', - }, - { - label: 'Approved', - url: `approved`, - selected: navigationTab === 'approved', + label: 'Published', + url: `published`, + selected: navigationTab === 'published', }, + // { + // label: 'Approved', + // url: `approved`, + // selected: navigationTab === 'approved', + // }, ]; const AllAIModels: { data: any; isLoading: boolean; refetch: any } = useQuery( @@ -97,11 +97,11 @@ export default function AIModelsPage({ { filters: { status: - navigationTab === 'active' + navigationTab === 'published' ? 'ACTIVE' - : navigationTab === 'approved' - ? 'APPROVED' - : 'REGISTERED', + : navigationTab === 'draft' + ? 'REGISTERED' + : 'APPROVED', }, order: { updatedAt: 'DESC' }, } @@ -110,7 +110,7 @@ export default function AIModelsPage({ useEffect(() => { if (navigationTab === null || navigationTab === undefined) - setNavigationTab('registered'); + setNavigationTab('draft'); AllAIModels.refetch(); }, [AllAIModels, navigationTab, setNavigationTab]); @@ -130,11 +130,15 @@ export default function AIModelsPage({ ), { onSuccess: () => { - toast(`Deleted AI Model successfully`,{id: AIMODELS_ACTION_TOAST_ID}); + toast(`Deleted AI Model successfully`, { + id: AIMODELS_ACTION_TOAST_ID, + }); AllAIModels.refetch(); }, onError: (err: any) => { - toast('Error: ' + err.message.split(':')[0],{id: AIMODELS_ACTION_TOAST_ID}); + toast('Error: ' + err.message.split(':')[0], { + id: AIMODELS_ACTION_TOAST_ID, + }); }, } ); @@ -163,13 +167,17 @@ export default function AIModelsPage({ { onSuccess: (data: any) => { const newModelId = data.createAiModel.data.id; - toast(`Created AI Model successfully`,{id: AIMODELS_ACTION_TOAST_ID}); + toast(`Created AI Model successfully`, { + id: AIMODELS_ACTION_TOAST_ID, + }); router.push( `/dashboard/${entityType}/${entitySlug}/aimodels/edit/${newModelId}/details` ); }, onError: (err: any) => { - toast('Error: ' + err.message.split(':')[0],{id: AIMODELS_ACTION_TOAST_ID}); + toast('Error: ' + err.message.split(':')[0], { + id: AIMODELS_ACTION_TOAST_ID, + }); }, } ); @@ -186,7 +194,7 @@ export default function AIModelsPage({ {row.original.displayName} @@ -260,7 +268,7 @@ export default function AIModelsPage({ {AllAIModels.data?.aiModels.length > 0 ? ( From b3987071a772012518693876d60cc47f937a2e0e Mon Sep 17 00:00:00 2001 From: Saqib Date: Thu, 4 Jun 2026 15:20:05 +0530 Subject: [PATCH 2/9] trigger smoke tests on CivicDataSpace-test CI branch after dev deploy --- .github/workflows/deploy-Dataspace.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/deploy-Dataspace.yml b/.github/workflows/deploy-Dataspace.yml index f0775a8c..01124882 100644 --- a/.github/workflows/deploy-Dataspace.yml +++ b/.github/workflows/deploy-Dataspace.yml @@ -89,3 +89,10 @@ jobs: username: ${{ secrets.EC2_USERNAME }} key: ${{ secrets.EC2_PRIVATE_KEY }} script: rm -rf DataExchange/DataExFrontend/.next; rm -rf DataExchange/DataExFrontend/public; mv DataExchange/DataExFrontend/.next2 DataExchange/DataExFrontend/.next; mv DataExchange/DataExFrontend/public2 DataExchange/DataExFrontend/public; /home/ubuntu/.nvm/versions/node/v20.11.1/bin/pm2 restart dataspace + + smoke-tests: + needs: deploy + if: github.ref_name == 'dev' + uses: CivicDataLab/CivicDataSpace-test/.github/workflows/run-smoke.yml@CI + secrets: + HOME_URL_DEV: ${{ secrets.HOME_URL_DEV }} From 1512587cea4aa4f9674c03ea6ae8c194fafd016d Mon Sep 17 00:00:00 2001 From: Saqib Date: Thu, 4 Jun 2026 15:36:10 +0530 Subject: [PATCH 3/9] chore: trigger CI From 47b79d144ecdd6563e3297d692812a6387ddddc5 Mon Sep 17 00:00:00 2001 From: Saqib Date: Thu, 4 Jun 2026 16:58:16 +0530 Subject: [PATCH 4/9] pass provider smoke credentials to CivicDataSpace-test workflow --- .github/workflows/deploy-Dataspace.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-Dataspace.yml b/.github/workflows/deploy-Dataspace.yml index 01124882..16337cff 100644 --- a/.github/workflows/deploy-Dataspace.yml +++ b/.github/workflows/deploy-Dataspace.yml @@ -95,4 +95,8 @@ jobs: if: github.ref_name == 'dev' uses: CivicDataLab/CivicDataSpace-test/.github/workflows/run-smoke.yml@CI secrets: - HOME_URL_DEV: ${{ secrets.HOME_URL_DEV }} + HOME_URL_DEV: ${{ secrets.HOME_URL_DEV }} + TEST_EMAIL_1: ${{ secrets.TEST_EMAIL_1 }} + TEST_PASSWORD_1: ${{ secrets.TEST_PASSWORD_1 }} + TEST_EMAIL_2: ${{ secrets.TEST_EMAIL_2 }} + TEST_PASSWORD_2: ${{ secrets.TEST_PASSWORD_2 }} From 4c21da1e178f6ef4966270cc8c92957c56fef4a3 Mon Sep 17 00:00:00 2001 From: Saqib Date: Thu, 4 Jun 2026 17:43:22 +0530 Subject: [PATCH 5/9] chore: trigger CI From c73ca716d19a4c28688ee7f58d362ec65cf6213c Mon Sep 17 00:00:00 2001 From: Saqib Date: Thu, 4 Jun 2026 18:21:42 +0530 Subject: [PATCH 6/9] chore: trigger CI From e8fccaac4b1109acadc2e22cf4f7a55c67bb1aca Mon Sep 17 00:00:00 2001 From: Saqib Date: Fri, 5 Jun 2026 11:08:37 +0530 Subject: [PATCH 7/9] chore: trigger smoke test pipeline after CI green From 86607a7e2cf6a33cf69cdcebd84ec81b49b20fae Mon Sep 17 00:00:00 2001 From: Saqib Date: Fri, 5 Jun 2026 12:15:09 +0530 Subject: [PATCH 8/9] chore: trigger smoke pipeline From 892525031461e0d35b692afccb8cc951d7f82e48 Mon Sep 17 00:00:00 2001 From: Saqib Date: Fri, 5 Jun 2026 12:56:03 +0530 Subject: [PATCH 9/9] chore: trigger smoke pipeline