Skip to content

Commit

Permalink
fix display of some audit messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
pwalsh committed Feb 28, 2022
1 parent e87c6f8 commit 6116f9e
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
SHELL := /bin/bash
USER := govflow
NAME := govflow
VERSION := 0.0.34-alpha
VERSION := 0.0.35-alpha
COMPOSE := docker-compose -f docker-compose/docker-compose.yml --compatibility
REPOSITORY := $(USER)/$(NAME)
DOCKER_HOST := ghcr.io
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@govflow/govflow",
"version": "0.0.34-alpha",
"version": "0.0.35-alpha",
"description": "An open, modular work order and workflow management system for local governments and resident satisfaction.",
"homepage": "https://github.com/govflow/govflow",
"main": "./index.js",
Expand Down
2 changes: 1 addition & 1 deletion src/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { storageRouter } from './storage';
const coreRoutes = Router();

coreRoutes.get('/', wrapHandler(async (req: Request, res: Response) => {
res.status(200).send({ data: { name: 'govflow', version: '0.0.34-alpha' } });
res.status(200).send({ data: { name: 'govflow', version: '0.0.35-alpha' } });
}))
coreRoutes.use('/services', serviceRouter);
coreRoutes.use('/service-requests', serviceRequestRouter);
Expand Down
9 changes: 8 additions & 1 deletion src/core/service-requests/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,17 @@ import { ServiceRequestInstance, ServiceRequestModel, StaffUserAttributes } from

export function makeAuditMessage(user: StaffUserAttributes | undefined, fieldName: string, oldValue:string, newValue:string): string {
let displayName = 'System';
let message: string;
if (user) {
displayName = user.displayName;
}
return `${displayName} changed this request ${fieldName} from ${oldValue} to ${newValue}`;
if (fieldName == 'status') {
message = `${displayName} changed this request's ${fieldName} from ${oldValue} to ${newValue}.`
} else {
// TODO: we need to introduce queries to have display data that makes sense.
message = `${displayName} changed this request's ${fieldName}.`
}
return message;
}

export function makePublicIdString(year: number, month: number, counter: number): string {
Expand Down
2 changes: 1 addition & 1 deletion src/registry/service-identifiers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ export const serviceIds = {
export const appIds = {
AppSettings: Symbol('AppSettings'),
Models: Symbol('Models'),
Repositories: Symbol('Repositorieas'),
Repositories: Symbol('Repositories'),
};
2 changes: 1 addition & 1 deletion test/test-endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('Hit all API endpoints', function () {
it('should GET Root API information', async function () {
const res = await chai.request(app).get('/');
chai.assert.equal(res.status, 200);
chai.assert.equal(res.text, JSON.stringify({ data: { name: 'govflow', version: '0.0.34-alpha' } }));
chai.assert.equal(res.text, JSON.stringify({ data: { name: 'govflow', version: '0.0.35-alpha' } }));
});

it('should GET staff users for jurisdiction', async function () {
Expand Down

0 comments on commit 6116f9e

Please sign in to comment.