Skip to content

Commit

Permalink
Add complianceAndEnforcement boolean field to RecentActivity model.
Browse files Browse the repository at this point in the history
  • Loading branch information
tolkamps1 committed Jan 31, 2024
1 parent b026dde commit e730c6d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 deletions.
6 changes: 4 additions & 2 deletions api/controllers/recentActivity.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ var getSanitizedFields = function (fields) {
'active',
'project',
'content',
'headline'
'headline',
'complianceAndEnforcement'
], f) !== -1);
});
};
Expand All @@ -40,7 +41,8 @@ exports.publicGet = async function (args, res) {
'active',
'project',
'content',
'headline'];
'headline',
'complianceAndEnforcement'];
var query = {};
var sort = {
dateAdded: -1
Expand Down
30 changes: 16 additions & 14 deletions api/helpers/models/recentActivity.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
module.exports = require ('../models')('RecentActivity', {
dateUpdated : { type: Date, default: Date.now() },
dateAdded : { type: Date, default: Date.now() },
_addedBy : { type: String, default: null },
_updatedBy : { type: String, default: null },
dateUpdated : { type: Date, default: Date.now() },
dateAdded : { type: Date, default: Date.now() },
_addedBy : { type: String, default: null },
_updatedBy : { type: String, default: null },

pinned : { type: Boolean, default: false },
documentUrl : { type: String, default: null },
contentUrl : { type: String, default: null },
type : { type: String, default: null },
notificationName : { type: String, default: null },
pcp : { type: 'ObjectId', ref: 'CommentPeriod', default: null, index: true },
active : { type: Boolean, default: false },
project : { type: 'ObjectId', ref: 'Project', default: null, index: true },
content : { type: String, default: null },
headline : { type: String, default: null },
complianceAndEnforcement : { type: Boolean, default: false },

pinned : { type: Boolean, default: false },
documentUrl : { type: String, default: null },
contentUrl : { type: String, default: null },
type : { type: String, default: null },
notificationName : { type: String, default: null },
pcp : { type: 'ObjectId', ref: 'CommentPeriod', default: null, index: true },
active : { type: Boolean, default: false },
project : { type: 'ObjectId', ref: 'Project', default: null, index: true },
content : { type: String, default: null },
headline : { type: String, default: null },

// Permissions
read : [{ type: String, trim: true, default: 'sysadmin' }],
Expand Down
1 change: 1 addition & 0 deletions api/test/factories/recent_activity_factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ factory.define(factoryName, RecentActivity, buildOptions => {
, content : faker.lorem.paragraph()
, notificationName : faker.lorem.word()
, headline : factory_helper.getRandomExistingListElementName(headlineTypes)
, complianceAndEnforcement : faker.random.boolean()

// Permissions
, read : faker.random.arrayElement(["public", "sysadmin"])
Expand Down

0 comments on commit e730c6d

Please sign in to comment.