Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion bcap/functions/bcap_site_descriptors.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@


class BCAPSiteDescriptors(AbstractPrimaryDescriptorsFunction):
_datatype_factory = DataTypeFactory()
_datatype_factory = None
# For Name part of descriptor
graph_slug = "archaeological_site"

Expand All @@ -68,6 +68,7 @@ class BCAPSiteDescriptors(AbstractPrimaryDescriptorsFunction):

# Initializes the static nodes and datatypes data
def initialize(self):
BCAPSiteDescriptors._datatype_factory = DataTypeFactory()
for alias in (
BCAPSiteDescriptors._name_nodes
+ BCAPSiteDescriptors._sig_event_nodes
Expand Down
3 changes: 2 additions & 1 deletion bcap/functions/process_requirement_descriptors.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@


class ProcessRequirementDescriptors(AbstractPrimaryDescriptorsFunction):
_datatype_factory = DataTypeFactory()
_datatype_factory = None
# For Name part of descriptor
graph_slug = "process_requirement"

Expand All @@ -69,6 +69,7 @@ class ProcessRequirementDescriptors(AbstractPrimaryDescriptorsFunction):

# Initializes the static nodes and datatypes data
def initialize(self):
ProcessRequirementDescriptors._datatype_factory = DataTypeFactory()
for alias in (
ProcessRequirementDescriptors._name_nodes
+ ProcessRequirementDescriptors._popup_nodes
Expand Down
4 changes: 4 additions & 0 deletions bcap/services/dashboard/base_dashboard_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class BaseDashboardService(BaseGraphService):
PA.FILING_TYPE,
PA.INDUSTRIAL_SECTOR,
PA.APPLICATION_PRIORITY_LEVEL,
PA.OWNING_ORGANIZATION,
PA.RELATED_PERMIT,
PA.MODULE_ID,
PA.MODULE_NAME,
Expand Down Expand Up @@ -83,6 +84,9 @@ def display(alias):
submission_type=display(self.PA.FILING_TYPE),
industrial_sector=display(self.PA.INDUSTRIAL_SECTOR),
priority_level=display(self.PA.APPLICATION_PRIORITY_LEVEL),
# A Contributor's descriptor is "last, first", so an organization
# (no first name) comes back with a trailing comma.
organization=display(self.PA.OWNING_ORGANIZATION).rstrip(", "),
Comment thread
seeker25 marked this conversation as resolved.
Outdated
related_permit_id=self._resource_id(
self._node_value(aliased, self.PA.RELATED_PERMIT)
),
Expand Down
11 changes: 11 additions & 0 deletions bcap/services/dashboard/dashboard_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ class InternalDashboardCard:
industrial_sector: str = described(
"Permit application's industrial sector (reference label).", ""
)
organization: str = described(
"Name of the organization the application is filed under (its stamped "
"owning_organization); empty when it was filed under none.",
"",
)
permit_id: str | None = described(
"Resourceinstanceid of the related HCA Permit; its drill-in GUID.", None
)
Expand Down Expand Up @@ -210,6 +215,11 @@ class ExternalDashboardCard:
industrial_sector: str = described(
"Permit application's industrial sector (reference label).", ""
)
organization: str = described(
"Name of the organization the application is filed under (its stamped "
"owning_organization); empty when it was filed under none.",
"",
)
permit_id: str | None = described(
"Resourceinstanceid of the related HCA Permit; its drill-in GUID.", None
)
Expand Down Expand Up @@ -269,6 +279,7 @@ class ApplicationCore:
submission_type: str = ""
industrial_sector: str = ""
priority_level: str = ""
organization: str = ""
related_permit_id: str | None = None


Expand Down
15 changes: 9 additions & 6 deletions bcap/services/dashboard/external_dashboard_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,7 @@ def _application_queryset(self):
GraphSlugs.PERMIT_APPLICATION,
nodes=self.nodes(
GraphSlugs.PERMIT_APPLICATION,
self.CARD_NODES
+ [
self.PA.APPLICATION_SUBMISSION_DATE,
self.PA.OWNING_ORGANIZATION,
],
self.CARD_NODES + [self.PA.APPLICATION_SUBMISSION_DATE],
),
as_representation=True,
)
Expand Down Expand Up @@ -114,6 +110,7 @@ def _application_card(self, permit, hca_permits, unread_messages=0):
application_number=core.application_number,
submission_type=core.submission_type,
industrial_sector=core.industrial_sector,
organization=core.organization,
permit_id=core.related_permit_id,
permit_number=hca.number,
urgency=0,
Expand Down Expand Up @@ -160,7 +157,12 @@ def _draft_parents(self, drafts):
permits = self._tiles(
GraphSlugs.PERMIT_APPLICATION,
ids,
[self.PA.PROJECT_NAME, self.PA.APPLICATION_ID, self.PA.FILING_TYPE],
[
self.PA.PROJECT_NAME,
self.PA.APPLICATION_ID,
self.PA.FILING_TYPE,
self.PA.OWNING_ORGANIZATION,
],
)
return {
str(permit.pk): self._application_core(permit.aliased_data)
Expand Down Expand Up @@ -195,5 +197,6 @@ def field(alias):
self.PA.APPLICATION_ID, parent.application_number
),
submission_type=identification(self.PA.FILING_TYPE, parent.submission_type),
organization=parent.organization,
unread_messages=unread_messages,
)
1 change: 1 addition & 0 deletions bcap/services/dashboard/internal_dashboard_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ def _card_to_json(self, permit, data: InternalDashboardData):
application_number=core.application_number,
submission_type=core.submission_type,
industrial_sector=core.industrial_sector,
organization=core.organization,
permit_id=core.related_permit_id,
permit_number=hca.number,
permit_holder=holder_names,
Expand Down
2 changes: 1 addition & 1 deletion bcap/src/bcap/apps/Permit/Modules/WorkflowStepper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const state = reactive({
submitting: false,
savingDraft: false,
confirmingExit: false,
devMode: true,
devMode: false,
Comment thread
seeker25 marked this conversation as resolved.
Outdated
isDataLoaded: false,
finalizedResourceData: null as PermitApplication | null,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ interface ProjectData {
body3?: string;
body4?: string;
body5?: string;
body6?: string;
footerDate: string;
footerName?: string;
class?: string;
Expand Down Expand Up @@ -70,6 +71,9 @@ const mapToDashboardCard = (rawItem: InternalDashboardCard): ProjectData => {
: undefined,
body4: `Officer: ${rawItem.project_officer || ''}`,
body5: buildModuleSummary(rawItem.module_progress),
body6: rawItem.organization
? `Organization: ${rawItem.organization}`
: undefined,

footerDate: rawItem.requirement_due_date || 'Not Started',
footerName: rawItem.ministry_assignee_name || 'Unassigned',
Expand All @@ -86,6 +90,7 @@ const sortOptions = [
{ label: 'Created Date', value: 'footerDate' },
{ label: 'Due Date', value: 'capDate' },
{ label: 'Permit Holder', value: 'body3' },
{ label: 'Organization', value: 'body6' },
{ label: 'Permit Number', value: 'body2' },
{ label: 'Priority', value: 'capPriority' },
{ label: 'Process', value: 'capLabel' },
Expand Down Expand Up @@ -177,6 +182,7 @@ const displayedProjects = computed(() => {
item.body3?.toLowerCase().includes(query) ||
item.body4?.toLowerCase().includes(query) ||
item.body5?.toLowerCase().includes(query) ||
item.body6?.toLowerCase().includes(query) ||
item.footerName?.toLowerCase().includes(query)
);
});
Expand Down Expand Up @@ -288,6 +294,7 @@ const onCardClick = (event: MouseEvent, item: ProjectData) => {
:body3="formatBodyLine(item.body3)"
:body4="item.body4"
:body5="formatBodyLine(item.body5)"
:body6="formatBodyLine(item.body6)"
Comment thread
seeker25 marked this conversation as resolved.
Outdated
:route="{ name: item.route }"
:search-query="state.currentSearch"
@click.capture.prevent="onCardClick($event, item)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,12 @@ const openResourceReport = (resourceId: string) => {
:body3="
buildModuleSummary(project.module_progress)
"
:body4="
labelled(
'Organization',
project.organization,
)
"
:footer-date="formatDate(project.created_date)"
:footer-name="project.created_by_name"
:urgency="project.urgency || 0"
Expand Down Expand Up @@ -374,6 +380,12 @@ const openResourceReport = (resourceId: string) => {
draft.module_progress,
)
"
:body4="
labelled(
'Organization',
draft.organization,
)
"
:urgency="draft.urgency || 0"
:unread-messages="
draft.unread_messages || 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,10 @@ describe('PermitDetails.vue', () => {
expect(fetchPermitDetails).toHaveBeenCalledWith('mock-permit-123');

expect(wrapper.find('.project-name').text()).toBe('Test Project Name');
// Application id, submission type and sector share one subtitle line.
expect(wrapper.find('.permit-meta').text()).toBe('APP-001 · Forestry');
expect(wrapper.find('.application-number').text()).toBe('APP-001');
expect(
wrapper.findAll('.meta-part').map((part) => part.text()),
).toEqual(['Forestry']);
});

it('has no submit action in the header band', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,51 +6,61 @@ const makeHeader = (overrides: Partial<PermitHeader> = {}): PermitHeader => ({
applicationNumber: 'APP-42',
submissionType: 'Permit Application - Standard',
sector: 'Mining',
organization: 'Acme Corp',
submittedDate: '2026-07-23',
...overrides,
});

const meta = (wrapper: ReturnType<typeof mount>) =>
wrapper.findAll('.meta-part').map((part) => part.text());

describe('PermitHeaderBand', () => {
it('renders the project name', () => {
it('titles the band with the project name and its file number', () => {
const wrapper = mount(PermitHeaderBand, {
props: { header: makeHeader() },
});
expect(wrapper.find('.project-name').text()).toBe('Riverside Dig');
expect(wrapper.find('.application-number').text()).toBe('APP-42');
});

it('joins the meta line with a middot', () => {
it('lists the organization, submission type, and sector', () => {
const wrapper = mount(PermitHeaderBand, {
props: { header: makeHeader() },
});
expect(wrapper.find('.permit-meta').text()).toContain(
'APP-42 · Permit Application - Standard · Mining',
);
expect(meta(wrapper)).toEqual([
'Acme Corp',
'Permit Application - Standard',
'Mining',
]);
expect(wrapper.find('.meta-flag').exists()).toBe(false);
});

it('drops empty parts from the meta line without stray middots', () => {
it('drops an empty part rather than leaving a stray separator', () => {
const wrapper = mount(PermitHeaderBand, {
props: { header: makeHeader({ submissionType: '' }) },
props: { header: makeHeader({ organization: '' }) },
});
const text = wrapper.find('.permit-meta').text();
// The empty submission type is dropped: one join middot, not two.
expect(text).toContain('APP-42 · Mining');
expect(text).not.toContain('· ·');
expect(wrapper.find('.meta-unset').exists()).toBe(false);
expect(meta(wrapper)).toEqual([
'Permit Application - Standard',
'Mining',
]);
});

it('shows the unset-sector note when no sector is given', () => {
it('flags a missing sector', () => {
const wrapper = mount(PermitHeaderBand, {
props: { header: makeHeader({ sector: '' }) },
});
expect(wrapper.find('.meta-unset').exists()).toBe(true);
expect(meta(wrapper)).toEqual([
'Acme Corp',
'Permit Application - Standard',
]);
expect(wrapper.find('.meta-flag').text()).toBe('Sector not specified');
});

it('renders the actions slot when not yet submitted', () => {
it('renders the actions slot', () => {
const wrapper = mount(PermitHeaderBand, {
props: { header: makeHeader({ submittedDate: null }) },
slots: { actions: '<button class="slotted">Submit</button>' },
});
expect(wrapper.find('.submitted-text').exists()).toBe(false);
expect(wrapper.find('.slotted').exists()).toBe(true);
});
});
Loading
Loading