Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
193f842
1165 - Make displayname text-searchable (#84)
bferguso Mar 1, 2026
f0e634f
Move re-projection functions to bcgov-arches-common (#89)
bferguso Mar 11, 2026
d0f8e90
Remove references to arches.VERSION - removed from arches core in lat…
bferguso Mar 13, 2026
457785c
Merge branch 'dev/2.0.x' into dev/2.0.x_merge_1.3.0_v8.1.x
bferguso Mar 13, 2026
070f62c
Update BC Sans and project.css (#94)
braydencstratusadv Mar 20, 2026
42cbf7f
Merge branch 'dev/2.0.x' into dev/2.0.x_merge_1.3.0_v8.1.x
bferguso Mar 20, 2026
e48acea
Merge branch 'dev/2.0.x_merge_1.3.0_v8.1.x' of https://github.com/bcg…
bferguso Mar 25, 2026
a71a1c6
Set 2.1.0 to beta release
bferguso Mar 25, 2026
78a8b79
Increment version to 2.1.0b1 (#104)
bferguso Mar 25, 2026
561302a
Merge branch 'main' into release_beta
bferguso Mar 25, 2026
6d60a3f
on merge: github release of version 2.1.0b1 (#106)
bferguso Mar 25, 2026
c6a50a5
Merge branch 'release/2.1.x' of https://github.com/bcgov/bcgov-arches…
bferguso Mar 25, 2026
56a7da6
Merge branch 'release/2.0.x' into release/2.1.x
bferguso Apr 2, 2026
e46afae
fixes and cards (#114)
P-Hansen Apr 3, 2026
ced6c20
Fix URL label attribute name (#115)
bferguso Apr 5, 2026
4e2c113
Resolving turf conflicts
bferguso Apr 5, 2026
092cdbd
Resolving ts errors
bferguso Apr 5, 2026
304e181
177 - Add schema to enforce non-null geometry (#116) (#117)
bferguso Apr 8, 2026
fd11547
card font fix (#119)
P-Hansen Apr 14, 2026
e528c18
Handle PUBLIC_URL missing context root for map source URLs (#123)
bferguso Apr 15, 2026
fbbd106
Increment version to 2.1.0b2 (#124)
bferguso Apr 15, 2026
e558d04
Bump and loosen component lab version requirements
bferguso Apr 20, 2026
d992259
Brf/cherrypick 2.0.x updates (#129)
bferguso Apr 26, 2026
6f206de
Phil/project card (#126)
bferguso Apr 27, 2026
d51b25b
Fix issue causing additional scrollbars (#132)
bferguso Apr 28, 2026
d721c5b
Fix file URL to include app prefix (#134)
bferguso May 5, 2026
9627286
Increment version to 2.1.0b3 (#136)
bferguso May 15, 2026
c33a405
UTM Coordinates to Site Map (#137)
seeker25 May 15, 2026
e050006
Fix styling Map Libre (#138)
seeker25 May 20, 2026
75e98d1
Increment version to 2.1.0b4 (#139)
bferguso May 20, 2026
363eacb
on merge: github release of version 2.1.0b5 (#144)
bferguso Jun 4, 2026
9238be2
1353 - Don't escape nodes that have HTML values. Allow template overr…
bferguso Jun 29, 2026
64c1daf
1259 - Increase font size, make titles not data bold (#151)
bferguso Jun 29, 2026
67471f5
message notification added (#158)
P-Hansen Jul 14, 2026
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
1 change: 1 addition & 0 deletions .github/actions/build-and-test-branch/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ runs:

- name: Check frontend formatting with prettier
run: |
npx prettier --version
npm run prettier:check
shell: bash

Expand Down
38 changes: 28 additions & 10 deletions bcgov_arches_common/functions/abstract_primary_descriptors.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@


class AbstractPrimaryDescriptors(CoreDescriptorsFunction):
_template = "<div class='bc-popup-entry'><div class='bc-popup-label'>%s</div><div class='bc-popup-value'>%s</div></div>"
_graph_slug = ""
_name_node_aliases = []
_card_node_aliases = []
_popup_node_aliases = []

_html_nodes = []

_datatype_factory = DataTypeFactory()

_nodes = {}
Expand All @@ -32,6 +35,15 @@ def initialize(self):
)
)

# Get nodes that have HTML representations
all_nodes = set(AbstractPrimaryDescriptors._nodes.values())
cnws = (
models.CardXNodeXWidget.objects.filter(node__in=all_nodes)
.filter(widget__name="rich-text-widget")
.all()
)
AbstractPrimaryDescriptors._html_nodes = [cnw.node.alias for cnw in cnws]

AbstractPrimaryDescriptors._initialized = True

def get_all_nodes(self):
Expand Down Expand Up @@ -72,12 +84,14 @@ def get_values_in_order(
AbstractPrimaryDescriptors._nodes[node_alias].name,
value,
config,
node_alias in AbstractPrimaryDescriptors._html_nodes,
)
display_values.append(
AbstractPrimaryDescriptors._format_value(
AbstractPrimaryDescriptors._nodes[node_alias].name,
value,
config,
node_alias in AbstractPrimaryDescriptors._html_nodes,
)
)
return connector.join(display_values)
Expand Down Expand Up @@ -139,18 +153,22 @@ def _get_value_from_node(node_alias, resourceinstanceid=None, data_tile=None):
)

@staticmethod
def _format_value(name, value, config):
if isinstance(value, list):
value = set([html.escape(str(v)) for v in value if v != ""])
def _format_value(name, value, config, is_html=False):
def escape_value(val):
if not val:
return val
return html.escape(str(val)) if not is_html else str(val)

if value is None:
return ""
elif isinstance(value, list):
value = set([escape_value(v) for v in value if v != ""])
if "" in value:
value.remove("")
value = ", ".join(sorted(value))
else:
value = escape_value(value)

if value is None:
return ""
elif config["show_name"]:
return (
"<div class='bc-popup-entry'><div class='bc-popup-label'>%s</div><div class='bc-popup-value'>%s</div></div>"
% (html.escape(name), html.escape(str(value)))
)
if config["show_name"]:
return AbstractPrimaryDescriptors._template % (html.escape(name), value)
return value
1 change: 0 additions & 1 deletion bcgov_arches_common/media/css/bc_index.css
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,6 @@ footer ul li a {
}

a:hover {
color: #fff;
text-decoration: underline;
}

Expand Down
57 changes: 39 additions & 18 deletions bcgov_arches_common/media/css/project.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,75 @@

@font-face {
font-family: BCSans;
font-weight: 100 300;
font-style: normal;
src: url('../fonts/BCSans/BCSans-Light.woff2') format('woff2'), /* Optimized for very modern browsers */
url('../fonts/BCSans/BCSans-Light.woff') format('woff'); /* Modern Browsers */
}

@font-face {
font-family: BCSans;
font-weight: 100 300;
font-style: italic;
src: url('../fonts/BCSans/BCSans-LightItalic.woff2') format('woff2'), /* Optimized for very modern browsers */
url('../fonts/BCSans/BCSans-LightItalic.woff') format('woff'); /* Modern Browsers */
}

@font-face {
font-family: BCSans;
font-weight: 400 599;
font-style: normal;
src: url('../fonts/BCSans/BCSans-Regular.woff2') format('woff2'), /* Optimized for very modern browsers */
url('../fonts/BCSans/BCSans-Regular.woff') format('woff'); /* Modern Browsers */
}

@font-face {
font-family: BCSans;
font-weight: 400 599;
font-style: italic;
src: url('../fonts/BCSans/BCSans-Italic.woff2') format('woff2'), /* Optimized for very modern browsers */
url('../fonts/BCSans/BCSans-Italic.woff') format('woff'); /* Modern Browsers */
}

@font-face {
font-family: BCSans;
font-weight: 700;
font-weight: 600 900;
font-style: normal;
src: url('../fonts/BCSans/BCSans-Bold.woff2') format('woff2'), /* Optimized for very modern browsers */
url('../fonts/BCSans/BCSans-Bold.woff') format('woff'); /* Modern Browsers */
}

@font-face {
font-family: BCSans;
font-weight: 600 900;
font-style: italic;
font-weight: 700;
src: url('../fonts/BCSans/BCSans-BoldItalic.woff2') format('woff2'), /* Optimized for very modern browsers */
url('../fonts/BCSans/BCSans-BoldItalic.woff') format('woff'); /* Modern Browsers */
}

#main-content
{
overflow: scroll;
.editor-report .resource-report-abstract-container .resource-component-abstract {
height: calc(100vh - 100px);
}

body, h1, h2, h3, h4, h5
{
font-family: BCSans, 'Open Sans', 'Noto Sans', Verdana, Arial, sans-serif !important;
}

/* Counteract nifty */
fieldset a {
text-decoration: none;
color: #337ab7;
outline: 0;
}

fieldset a:hover,a:focus {
text-decoration: none;
color: #000099;
outline: 0!important
}
/* End Counteract nifty */

.hover-feature-nav-right + .hover-feature-title {
width: 100%;
}
Expand Down Expand Up @@ -340,6 +372,7 @@ img.bc-details-image
flex-direction: row;
align-items: flex-start;
margin-bottom: 1px;
font-size: 1.3rem;
}

.bc-popup-label, .bc-popup-value
Expand All @@ -350,12 +383,12 @@ img.bc-details-image

.bc-popup-label
{
font-weight: 600;
min-width: 105px;
}

.bc-popup-value
{
font-weight: 800;
margin-left: 10px;
}

Expand Down Expand Up @@ -586,18 +619,6 @@ img.bc-details-image
clear: none !important;
}

/* For displaying long-form text blocks as full width of the page,
* some elements are within components and not easy to modify but do have
* an id that can be queried.
*/
dd[data-bind*="addressPart"],
dd[data-bind*="physical_description"],
dd[data-bind*="heritage_value"],
dd[data-bind*="defining_elements"] {
width: auto !important;
display: block !important;
}

.data-carousel {
max-width: 100vw !important;
}
Expand Down
Binary file modified bcgov_arches_common/media/fonts/BCSans/BCSans-Bold.woff
Binary file not shown.
Binary file modified bcgov_arches_common/media/fonts/BCSans/BCSans-Bold.woff2
Binary file not shown.
Binary file modified bcgov_arches_common/media/fonts/BCSans/BCSans-BoldItalic.woff
Binary file not shown.
Binary file modified bcgov_arches_common/media/fonts/BCSans/BCSans-BoldItalic.woff2
Binary file not shown.
Binary file modified bcgov_arches_common/media/fonts/BCSans/BCSans-Italic.woff
Binary file not shown.
Binary file modified bcgov_arches_common/media/fonts/BCSans/BCSans-Italic.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified bcgov_arches_common/media/fonts/BCSans/BCSans-Regular.woff
Binary file not shown.
Binary file modified bcgov_arches_common/media/fonts/BCSans/BCSans-Regular.woff2
Binary file not shown.
175 changes: 175 additions & 0 deletions bcgov_arches_common/media/js/utils/map-projection-tools.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
import proj4 from "proj4";

// Common projected coordinate systems used in BC/Western Canada.
//
// Reference:
// BC FSP Electronic Submission Format, Data Types Overview
// - (www.for.gov.bc.ca/his/fsp/webhelp/FSP/Online_Tech_Specs/PDFs/FSP_ESF_2-6_Overview__Data_Types.pdf)
// Proj4 strings sourced from epsg.io.
//
// These are registered with proj4 so we can transform coordinates when a
// user uploads a bare .shp file without an accompanying .prj. When a .prj
// is provided it is passed directly to shpjs which handles reprojection
// automatically.
const PROJECTIONS = {
WGS84: "EPSG:4326",
BC_ALBERS: "EPSG:3005",
NAD83_UTM_7N: "EPSG:26907",
NAD83_UTM_8N: "EPSG:26908",
NAD83_UTM_9N: "EPSG:26909",
NAD83_UTM_10N: "EPSG:26910",
NAD83_UTM_11N: "EPSG:26911",
WGS84_UTM_7N: "EPSG:32607",
WGS84_UTM_8N: "EPSG:32608",
WGS84_UTM_9N: "EPSG:32609",
WGS84_UTM_10N: "EPSG:32610",
WGS84_UTM_11N: "EPSG:32611",
};

proj4.defs(
PROJECTIONS.BC_ALBERS,
"+proj=aea +lat_1=50 +lat_2=58.5 +lat_0=45 +lon_0=-126 +x_0=1000000 +y_0=0 +datum=NAD83 +units=m +no_defs",
);
proj4.defs(
PROJECTIONS.NAD83_UTM_7N,
"+proj=utm +zone=7 +datum=NAD83 +units=m +no_defs",
);
proj4.defs(
PROJECTIONS.NAD83_UTM_8N,
"+proj=utm +zone=8 +datum=NAD83 +units=m +no_defs",
);
proj4.defs(
PROJECTIONS.NAD83_UTM_9N,
"+proj=utm +zone=9 +datum=NAD83 +units=m +no_defs",
);
proj4.defs(
PROJECTIONS.NAD83_UTM_10N,
"+proj=utm +zone=10 +datum=NAD83 +units=m +no_defs",
);
proj4.defs(
PROJECTIONS.NAD83_UTM_11N,
"+proj=utm +zone=11 +datum=NAD83 +units=m +no_defs",
);
proj4.defs(
PROJECTIONS.WGS84_UTM_7N,
"+proj=utm +zone=7 +datum=WGS84 +units=m +no_defs",
);
proj4.defs(
PROJECTIONS.WGS84_UTM_8N,
"+proj=utm +zone=8 +datum=WGS84 +units=m +no_defs",
);
proj4.defs(
PROJECTIONS.WGS84_UTM_9N,
"+proj=utm +zone=9 +datum=WGS84 +units=m +no_defs",
);
proj4.defs(
PROJECTIONS.WGS84_UTM_10N,
"+proj=utm +zone=10 +datum=WGS84 +units=m +no_defs",
);
proj4.defs(
PROJECTIONS.WGS84_UTM_11N,
"+proj=utm +zone=11 +datum=WGS84 +units=m +no_defs",
);

// Check whether any coordinates in a FeatureCollection fall outside valid
// WGS84 lng/lat bounds, which indicates the data is still in a projected
// coordinate system and needs reprojection before Mapbox can display it.
const needsReprojection = function (geoJSON) {
var checked = 0;
var outOfBounds = 0;
var walkCoords = function (coords) {
if (typeof coords[0] === "number") {
checked++;
if (
coords[0] < -180 ||
coords[0] > 180 ||
coords[1] < -90 ||
coords[1] > 90
) {
outOfBounds++;
}
return;
}
for (var i = 0; i < coords.length; i++) {
walkCoords(coords[i]);
}
};
if (geoJSON && geoJSON.features) {
for (var i = 0; i < geoJSON.features.length; i++) {
var geom = geoJSON.features[i].geometry;
if (geom && geom.coordinates) {
walkCoords(geom.coordinates);
}
}
}
return checked > 0 && outOfBounds / checked > 0.5;
};

// Transform all coordinates in a FeatureCollection in-place from sourceCRS
// to WGS84. It is used as a fallback when shpjs could not reproject (i.e., no
// .prj was available).
const reprojectGeoJSON = function (geoJSON, sourceCRS) {
var transformCoords = function (coords) {
if (typeof coords[0] === "number") {
var transformed = proj4(sourceCRS, PROJECTIONS.WGS84, [
coords[0],
coords[1],
]);
coords[0] = transformed[0];
coords[1] = transformed[1];
return;
}
for (var i = 0; i < coords.length; i++) {
transformCoords(coords[i]);
}
};
if (geoJSON && geoJSON.features) {
for (var i = 0; i < geoJSON.features.length; i++) {
var geom = geoJSON.features[i].geometry;
if (geom && geom.coordinates) {
transformCoords(geom.coordinates);
}
}
}
return geoJSON;
};

// Attempt to guess the source projection from coordinate ranges when no .prj
// file is available. This is specific to BC/Western Canada — BC Albers
// (EPSG:3005) coordinates have large x values around 1,000,000 and y values
// under ~1,200,000, while UTM coordinates have y values in the 5–7 million
// range. It defaults to EPSG:3005 (BC Albers) as it is the most common
// projection used by the BC government.
const guessProjectionFromCoords = function (geoJSON) {
var sample = null;
if (geoJSON && geoJSON.features && geoJSON.features.length > 0) {
var geom = geoJSON.features[0].geometry;
if (geom && geom.coordinates) {
var coords = geom.coordinates;
while (Array.isArray(coords[0])) {
coords = coords[0];
}
sample = coords;
}
}
if (!sample) return PROJECTIONS.BC_ALBERS;
var x = sample[0];
var y = sample[1];
if (x > 200000 && x < 1900000 && y > 0 && y < 1200000) {
return PROJECTIONS.BC_ALBERS;
}
if (x > 100000 && x < 900000 && y > 5000000 && y < 7000000) {
if (x < 500000) {
return PROJECTIONS.NAD83_UTM_10N;
}
return PROJECTIONS.NAD83_UTM_9N;
}
return PROJECTIONS.BC_ALBERS;
};

export default {
PROJECTIONS,
needsReprojection,
reprojectGeoJSON,
guessProjectionFromCoords,
};
Empty file.
Loading