Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps-dev): bump prettier from 2.1.2 to 2.2.0 #709

Merged
merged 2 commits into from
Nov 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
Expand Up @@ -234,7 +234,7 @@
"mongodb-memory-server-core": "^6.9.2",
"ngrok": "^3.3.0",
"optimize-css-assets-webpack-plugin": "^5.0.1",
"prettier": "^2.1.2",
"prettier": "^2.2.0",
"proxyquire": "^2.1.3",
"regenerator": "^0.14.4",
"rimraf": "^3.0.2",
Expand Down
27 changes: 14 additions & 13 deletions src/app/models/field/attachmentField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,20 @@ const createAttachmentFieldSchema = () => {
})

// Prevent attachments from being saved on a webhooked form.
AttachmentFieldSchema.pre<IAttachmentFieldSchema>('validate', function (
next,
) {
const { webhook, responseMode } = this.parent()

if (responseMode === ResponseMode.Encrypt && webhook?.url) {
return next(
Error('Attachments are not allowed when a form has a webhook url'),
)
}

return next()
})
AttachmentFieldSchema.pre<IAttachmentFieldSchema>(
'validate',
function (next) {
const { webhook, responseMode } = this.parent()

if (responseMode === ResponseMode.Encrypt && webhook?.url) {
return next(
Error('Attachments are not allowed when a form has a webhook url'),
)
}

return next()
},
)

return AttachmentFieldSchema
}
Expand Down
21 changes: 10 additions & 11 deletions src/app/models/user.server.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,16 @@ const compileUserModel = (db: Mongoose) => {
*
* See: https://masteringjs.io/tutorials/mongoose/e11000-duplicate-key.
*/
UserSchema.post<IUserSchema>('save', function (
err: any,
_doc: IUserSchema,
next: any,
) {
if (err.name === 'MongoError' && err.code === 11000) {
next(new Error('Account already exists with this email'))
} else {
next()
}
})
UserSchema.post<IUserSchema>(
'save',
function (err: any, _doc: IUserSchema, next: any) {
if (err.name === 'MongoError' && err.code === 11000) {
next(new Error('Account already exists with this email'))
} else {
next()
}
},
)

// Statics
/**
Expand Down
6 changes: 3 additions & 3 deletions src/app/services/sms/__tests__/sms.factory.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ describe('sms.factory', () => {
})

describe('sms feature enabled', () => {
const MOCK_ENABLED_SMS_FEATURE: Required<RegisteredFeature<
FeatureNames.Sms
>> = {
const MOCK_ENABLED_SMS_FEATURE: Required<
RegisteredFeature<FeatureNames.Sms>
> = {
isEnabled: true,
props: {
twilioAccountSid: 'ACrandomTwilioSid',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import { left, right } from 'fp-ts/lib/Either'
import { ProcessedSingleAnswerResponse } from 'src/app/modules/submission/submission.types'
import { ResponseValidator } from 'src/types/field/utils/validation'

type SectionValidatorConstructor = () => ResponseValidator<
ProcessedSingleAnswerResponse
>
type SectionValidatorConstructor = () => ResponseValidator<ProcessedSingleAnswerResponse>

/**
* A function that returns a validation function for a section field when called.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ function avatarDropdownController(

vm.isDropdownOpen = false

$scope.$watchGroup(['vm.isDropdownHover', 'vm.isDropdownFocused'], function (
newValues,
) {
vm.isDropdownOpen = newValues[0] || newValues[1]
})
$scope.$watchGroup(
['vm.isDropdownHover', 'vm.isDropdownFocused'],
function (newValues) {
vm.isDropdownOpen = newValues[0] || newValues[1]
},
)

vm.signOut = () => Auth.signOut()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const Response = require('./Response.class')

module.exports = class ArrayAnswerResponse extends Response {
module.exports = class ArrayAnswerResponse extends (
Response
) {
getAnswer() {
return this._data.answerArray.join(';')
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const Response = require('./Response.class')

module.exports = class SingleAnswerResponse extends Response {
module.exports = class SingleAnswerResponse extends (
Response
) {
getAnswer() {
return this._data.answer
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const Response = require('./Response.class')

module.exports = class TableResponse extends Response {
module.exports = class TableResponse extends (
Response
) {
getAnswer(colIndex) {
// Leave cell empty if number of rows is fewer than the index
if (colIndex >= this._data.answerArray.length) {
Expand Down