Skip to content

Commit

Permalink
Merge pull request #1351 from cityofaustin/patch_trauma_fields
Browse files Browse the repository at this point in the history
Patch missing near trauma fields and revoke Editor access to Changes tab
  • Loading branch information
roseeichelmann authored Jan 25, 2024
2 parents d3889d2 + 46d3296 commit 13fe029
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,8 @@ select_permissions:
- milepoint_2
- mpo_id
- nbr_of_lane
- near_trauma_center_distance
- near_trauma_center_id
- non_injry_cnt
- nonincap_injry_cnt
- obj_struck_id
Expand Down Expand Up @@ -701,6 +703,8 @@ select_permissions:
- milepoint_2
- mpo_id
- nbr_of_lane
- near_trauma_center_distance
- near_trauma_center_id
- non_injry_cnt
- nonincap_injry_cnt
- obj_struck_id
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE public.atd_txdot_crashes DROP COLUMN near_trauma_center_id;
ALTER TABLE public.atd_txdot_crashes DROP COLUMN near_trauma_center_distance;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- Add new trauma center fields from CRIS to the crashes table
alter table "public"."atd_txdot_crashes" add column "near_trauma_center_id" integer
null;
alter table "public"."atd_txdot_crashes" add column "near_trauma_center_distance" float8
null;
2 changes: 1 addition & 1 deletion atd-vze/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "atd-vz-data",
"version": "1.40.0",
"version": "1.40.2",
"homepage": "./",
"description": "ATD Vision Zero Editor",
"author": "ATD Data & Technology Services",
Expand Down
15 changes: 3 additions & 12 deletions atd-vze/src/_nav.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isAdmin, isItSupervisor, isEditor } from "./auth/authContext";
import { isAdmin, isItSupervisor } from "./auth/authContext";

// Accept roles arg to restrict nav links by role
export const navigation = roles => {
Expand Down Expand Up @@ -36,17 +36,13 @@ export const navigation = roles => {
],
};

// Editor nav itmes
const editorNavItems = [
// Admin nav items
const adminNavItems = [
{
name: "Changes",
url: "/changes",
icon: "icon-layers",
},
];

// Admin nav items
const adminNavItems = [
{
title: true,
name: "Admin",
Expand Down Expand Up @@ -92,12 +88,7 @@ export const navigation = roles => {
},
];

if (isEditor(roles)) {
editorNavItems.forEach(item => nav.items.splice(-1, 0, item));
}

if (isAdmin(roles) || isItSupervisor(roles)) {
editorNavItems.forEach(item => nav.items.splice(-1, 0, item));
adminNavItems.forEach(item => nav.items.splice(-1, 0, item));
}

Expand Down
6 changes: 3 additions & 3 deletions atd-vze/src/routes.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { isAdmin, isItSupervisor, isEditor } from "./auth/authContext";
import { isAdmin, isItSupervisor } from "./auth/authContext";

const Breadcrumbs = React.lazy(() => import("./views/Base/Breadcrumbs"));
const Cards = React.lazy(() => import("./views/Base/Cards"));
Expand Down Expand Up @@ -179,13 +179,13 @@ const routes = roles => [
name: "Demo UI Components",
component: Dev,
},
(isEditor(roles) || isAdmin(roles) || isItSupervisor(roles)) && {
(isAdmin(roles) || isItSupervisor(roles)) && {
path: "/changes",
exact: true,
name: "Crash Changes",
component: CrashesChanges,
},
(isEditor(roles) || isAdmin(roles) || isItSupervisor(roles)) && {
(isAdmin(roles) || isItSupervisor(roles)) && {
path: "/changes/:id",
exact: true,
name: "Crash Change",
Expand Down
2 changes: 1 addition & 1 deletion atd-vzv/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "atd-vzv",
"version": "1.40.1",
"version": "1.40.2",
"homepage": "/viewer",
"description": "ATD Vision Zero Viewer",
"author": "ATD Data & Technology Services",
Expand Down

0 comments on commit 13fe029

Please sign in to comment.