Skip to content

Commit

Permalink
Merge branch 'master' into Release
Browse files Browse the repository at this point in the history
  • Loading branch information
cdjreekie authored Dec 16, 2021
2 parents 8d41bf7 + ad5eb4e commit c650881
Show file tree
Hide file tree
Showing 10 changed files with 659 additions and 26 deletions.
1 change: 1 addition & 0 deletions migrations/1631621029553-update_publishers_uses5safes.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ async function up() {
async function down() {}

module.exports = { up, down };

6 changes: 3 additions & 3 deletions src/config/account.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getUserByUserId } from '../resources/user/user.repository';
import ga4ghUtils from '../resources/utilities/ga4gh.utils';
import { to } from 'await-to-js';
import _ from 'lodash';
import { isNil } from 'lodash';

const store = new Map();
const logins = new Map();
Expand Down Expand Up @@ -29,8 +29,8 @@ class Account {
sub: this.accountId, // it is essential to always return a sub claim
};

let [, user] = await to(getUserByUserId(parseInt(this.accountId)));
if (!_.isNil(user)) {
let [err, user] = await to(getUserByUserId(parseInt(this.accountId)));
if (!isNil(user)) {
if (claimsToSend.includes('profile')) {
claim.firstname = user.firstname;
claim.lastname = user.lastname;
Expand Down
8 changes: 1 addition & 7 deletions src/config/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,7 @@ export const clients = [
//response_types: ['code id_token'],
redirect_uris: process.env.MDWRedirectURI.split(',') || [''],
id_token_signed_response_alg: 'HS256',
post_logout_redirect_uris: [
'https://hdr.auth.metadata.works/logout',
'https://hdr.auth.metadata.works/auth/logout',
'https://hdruk-preprod-auth.metadata.works/auth/logout',
'http://localhost:8080/logout',
'http://localhost:8080/auth/logout',
],
post_logout_redirect_uris: ['https://hdruk-auth.metadata.works/auth/logout'],
},
{
//BC Platforms
Expand Down
2 changes: 1 addition & 1 deletion src/config/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const connectToDatabase = async () => {
autoIndex: false, // Don't build indexes
poolSize: 10, // Maintain up to 10 socket connections
// If not connected, return errors immediately rather than waiting for reconnect
bufferMaxEntries: 0
bufferMaxEntries: 0,
});

console.log('MongoDB connected...');
Expand Down
12 changes: 6 additions & 6 deletions src/resources/dataset/dataset.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const datasetSchema = new Schema(
phenotypes: [],
},
datasetv2: {},
isLatestVersion: Boolean
isLatestVersion: Boolean,
},
{
timestamps: true,
Expand Down Expand Up @@ -115,15 +115,15 @@ datasetSchema.virtual('submittedDataAccessRequests', {
});

// Pre hook query middleware
datasetSchema.pre('find', function() {
this.where({type: 'dataset'});
datasetSchema.pre('find', function () {
this.where({ type: 'dataset' });
});

datasetSchema.pre('findOne', function() {
this.where({type: 'dataset'});
datasetSchema.pre('findOne', function () {
this.where({ type: 'dataset' });
});

// Load entity class
datasetSchema.loadClass(DatasetClass);

export const Dataset = model('Dataset', datasetSchema, 'tools');
export const Dataset = model('Dataset', datasetSchema, 'tools');
15 changes: 9 additions & 6 deletions src/resources/dataset/datasetonboarding.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,11 +269,7 @@ module.exports = {
} else {
Data.findByIdAndUpdate(
{ _id: id },
{
structuralMetadata,
percentageCompleted,
'timestamps.updated': Date.now(),
},
{ structuralMetadata, percentageCompleted: data.percentageCompleted, 'timestamps.updated': Date.now() },
{ new: true }
).catch(err => {
console.error(err);
Expand Down Expand Up @@ -853,7 +849,7 @@ module.exports = {
return res.status(500).json({ success: false, message: 'Bulk upload of metadata failed', error: err.message });
}
},

//POST api/v1/dataset-onboarding/duplicate/:id
duplicateDataset: async (req, res) => {
try {
Expand Down Expand Up @@ -897,3 +893,10 @@ module.exports = {
}
},
};

/* Sentry.addBreadcrumb({
category: 'Bulk Upload',
message: 'Unable to get metadata quality value ' + err.message,
level: Sentry.Severity.Error,
});
Sentry.captureException(err); */
2 changes: 1 addition & 1 deletion src/resources/dataset/v1/dataset.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { v4 as uuidv4 } from 'uuid';
import { filtersService } from '../../filters/dependency';
import { PublisherModel } from '../../publisher/publisher.model';
import { metadataCatalogues, validateCatalogueParams } from '../dataset.util';
import { isEmpty } from 'lodash';
import { has, isEmpty } from 'lodash';

let metadataQualityList = [],
phenotypesList = [],
Expand Down
Loading

0 comments on commit c650881

Please sign in to comment.