Skip to content

Company Project Visibility - #1657

Merged
seeker25 merged 86 commits into
release/2.0.xfrom
ts/feat/1656_company_project_visbility
Aug 11, 2026
Merged

Company Project Visibility#1657
seeker25 merged 86 commits into
release/2.0.xfrom
ts/feat/1656_company_project_visbility

Conversation

@seeker25

@seeker25 seeker25 commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

#1656

Internal dashboard takes you to the requirement clicked on
Add in company field for draft filing / permit application
Workflow Draft graph rework
Rewrite Workflow Draft Services to use arches-querysets
Remove add modules for staff (needs discussion)
Company project visibility (users can see all projects for their company)
Make external dashboard 2 tabs -> Filings and Drafts, and then add a checkbox that works for either that would expand the list to the ones the company owns
Small filing summary CSS tweaks
Unit test refactor a bit

Relies on:
bcgov/arches-zod-validation#5

seeker25 added 30 commits July 29, 2026 13:50
Submission/Messages button correct level - Process Requirement level
Breadcrumbs /bands for Edit / Complete Checklist
Split CompletedModules into folder
View Arches - Icon for arches core Search looking icon - View Arches icon = Internal Dashboard
Use dropdown list for actions - Edit Checklist put it in dots on Filing Summary
Wire in unread counts for Drafts on backend
Wire in external dashboard draft call, wasn't wired
Drafts filter for External dashboard
},
"id": "d814b48e-18f2-44ef-b8fa-3dba3244f24e",
"label": {
"en": "Owning Organization"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is in drafts as well

Comment on lines -212 to -229
def company_contributor_ids(self, username):
"""The viewer plus the active members of every org the viewer actively
belongs to today, excluding any flagged inactive."""
if not username:
return set()
my_contributor_id = self.username_contributor_id(username)
if not my_contributor_id:
return set()

org_node = self.node_id(
GraphSlugs.CONTRIBUTOR, ContributorAliases.ASSOCIATED_ORGANIZATION
)
start_node = self.node_id(GraphSlugs.CONTRIBUTOR, ContributorAliases.START_DATE)
end_node = self.node_id(GraphSlugs.CONTRIBUTOR, ContributorAliases.END_DATE)
membership_ng = self._node_info(
GraphSlugs.CONTRIBUTOR, ContributorAliases.ASSOCIATED_ORGANIZATION
)[1]
today = timezone.now().date().isoformat()

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved to organization id or deleted

Comment on lines +28 to 37
DRAFTS_CREATED_BY_ME = "DRAFTS_CREATED_BY_ME", "My drafts"
DRAFTS_BY_ASSOCIATED_ORGANIZATIONS = (
"DRAFTS_BY_ASSOCIATED_ORGANIZATIONS",
"Drafts of associated organizations",
)
FILINGS_CREATED_BY_ME = "FILINGS_CREATED_BY_ME", "My filings"
FILINGS_BY_ASSOCIATED_ORGANIZATIONS = (
"FILINGS_BY_ASSOCIATED_ORGANIZATIONS",
"Filings of associated organizations",
)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new types toggled by external dash checkbox + filings + draft tab

@@ -1,30 +1,27 @@
"""Draft storage as resources of the standalone 'drafts' graph, one JSON blob

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rewritten service

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the user persisted in the edit_log is always admin, not the user that saves it. Are you seeing this locally too? Debugging the create/set_data functions, the user parameter is coming in as me (userid 5) but the value in the edit log is 1.

Comment on lines +77 to +82
await Promise.all([
fetchDraftCards(),
fetchCompanyDraftCards(),
fetchMyProjects(),
fetchCompanyProjects(),
]);

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we grab these all at once, on the internal dashboard we just grab when we switch to the tab

I think that's ok

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might get heavy depending on how big a company is.

@seeker25

seeker25 commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator Author

I'm kind of thinking we might want to move the frontend unit tests files into a test directory

Comment on lines -154 to -156
ApiPermitApplicationDestroyData,
ApiPermitApplicationDestroyResponse,
ApiPermitApplicationDestroyResponses,

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete removal

Comment on lines -189 to -191
ApiPermitApplicationUpdateData,
ApiPermitApplicationUpdateResponse,
ApiPermitApplicationUpdateResponses,

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PUT removal, we might need this back in when we edit

verbs by http_method_names.
"""

http_method_names = ["get", "head", "options"]

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

follows generate.json now

Comment thread bcap/views/generate.json
"permit_application": [
"GET",
"PUT",
"PATCH",

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

possibly put PUT back in when editing, I don't think we'll need delete for now?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Covered by other unit tests, also there are 400+ unit tests for cross model advanced search alone.

We can add the TestCase class and they will be picked up by the Django unit test runner and take only 0.7s to execute on my machine - should we add those? it will almost double the unit test count

Comment thread pyproject.toml
"arches-querysets @ git+https://github.com/bcgov/arches-querysets@performance_fix_geojson",
"arches-workflow-stepper @ git+https://github.com/bferguso/arches-workflow-stepper@main",
"arches-zod-validation @ git+https://github.com/bcgov/arches-zod-validation@expose_resource_alias_function",
"arches-zod-validation @ git+https://github.com/bcgov/arches-zod-validation@generate_http_method_names",

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dependency

Comment thread vitest.setup.mts
Comment on lines +11 to +45
const urls: Record<string, unknown> = {
api_process_requirements: (id: string) =>
`/bcap/api/process_requirement/${id}`,
api_resource: (graphSlug: string, id: string) =>
`/bcap/api/resource/${graphSlug}/${id}`,
api_resource_blank: (graphSlug: string) =>
`/bcap/api/resource/${graphSlug}/blank`,
api_site_related_resources: (graphSlug: string, id: string) =>
`/bcap/api/arch_site_related_resources/${graphSlug}/${id}`,
api_workflow_draft: (graphSlug: string) =>
`/bcap/api/workflow_draft/${graphSlug}`,
api_workflow_draft_all: '/bcap/api/workflow_draft',
assignable_contributors: '/bcap/api/contributors/assignable',
assignable_groups: '/bcap/api/assignable_groups',
bcap_message_detail: (messageId: string) =>
`/bcap/api/bcap_message/${messageId}`,
bcap_message_resource_threads: (resourceId: string) =>
`/bcap/api/bcap_message/resource/${resourceId}/threads`,
bcap_message_thread_messages: (threadId: string) =>
`/bcap/api/bcap_message/thread/${threadId}`,
dashboard: '/bcap/api/dashboard',
dashboard_external: '/bcap/api/dashboard/external',
module_requirement: (
permitId: string,
moduleTileId: string,
requirementId: string,
) =>
`/bcap/api/permit_application/${permitId}/module/${moduleTileId}/requirement/${requirementId}`,
permit_application_create: '/bcap/api/permit_application',
plugin: (slug: string) => `/plugins/${slug}`,
registration_link: '/bcap/api/registration_link',
seed_process_requirements: (permitId: string, permitType: string) =>
`/bcap/api/permit_application/${permitId}/process_requirement/${permitType}`,
unlinked_contributors: '/bcap/api/unlinked_contributors',
};

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all these in here all at once saves alot of repetition

@P-Hansen P-Hansen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

another monster PR, lgtm

@seeker25

seeker25 commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator Author

I'm wondering if more of the routes should have been removed by codegen, but that's something we can fix in the next PR

@seeker25
seeker25 requested a review from bferguso August 10, 2026 18:07
seeker25 and others added 12 commits August 10, 2026 14:37
* Interim commit

* Interim commit

* Add unit tests, delete all cnw rows

* Align controlled list uris with https://localhost/bcap prefix
Add migration to give Submitter group access to external dashboard

* Fix Publication.json formatting

* Fix skos file

* Fix black format

* Fix resource instance node search strings
* Add unit test for graph searchString validity. Fix Publication and Document Submission resouce models

* Fix resource model format

* lint

* fix bcap message

---------

Co-authored-by: Travis Semple <travis8814@gmail.com>
@seeker25
seeker25 merged commit f585ec9 into release/2.0.x Aug 11, 2026
9 checks passed
@seeker25
seeker25 deleted the ts/feat/1656_company_project_visbility branch August 11, 2026 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants