Skip to content

Commit

Permalink
chore: fixed lint
Browse files Browse the repository at this point in the history
  • Loading branch information
claustres committed Sep 20, 2023
1 parent 613111c commit ee440ed
Show file tree
Hide file tree
Showing 18 changed files with 36 additions and 43 deletions.
2 changes: 0 additions & 2 deletions api/src/hooks/hooks.events.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import _ from 'lodash'
import makeDebug from 'debug'
import commonHooks from 'feathers-hooks-common'
import { getOrganisationAvatarUrl, sendPushNotifications } from '../utils.js'
const { populate } = commonHooks
const debug = makeDebug('crisis:events:hooks')

export async function sendEventPushNotifications (hook) {
if (hook.type !== 'after') {
Expand Down
1 change: 0 additions & 1 deletion api/src/hooks/hooks.quotas.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,3 @@ export const checkAlertsQuotas = coreHooks.countLimit({
return getItemsQuota(hook, 'alerts', org)
}
})

4 changes: 0 additions & 4 deletions api/src/hooks/hooks.storage.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import _ from 'lodash'
import path from 'path'
import makeDebug from 'debug'
import { getOrganisationAvatarUrl, sendPushNotifications } from '../utils.js'

const debug = makeDebug('crisis:storage:hooks')

export async function sendMediaPushNotifications (hook) {
if (hook.type !== 'after') {
throw new Error('The \'sendMediaPushNotifications\' hook should only be used as a \'after\' hook.')
Expand Down
10 changes: 6 additions & 4 deletions src/boot/kdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,12 @@ export default async ({ app }) => {
})

// Install listener to log push notifications
if (navigator.serviceWorker) navigator.serviceWorker.onmessage = (event) => {
const data = event.data
if (data && data.type === 'push') {
logger.info(`New notification received: ${_.get(data, 'notification.title')}`)
if (navigator.serviceWorker) {
navigator.serviceWorker.onmessage = (event) => {
const data = event.data
if (data && data.type === 'push') {
logger.info(`New notification received: ${_.get(data, 'notification.title')}`)
}
}
}

Expand Down
1 change: 0 additions & 1 deletion src/components/ArchivedEventCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@
<script>
import _ from 'lodash'
import { mixins as kdkCoreMixins, utils as kdkCoreUtils } from '@kalisio/kdk/core.client'
import { mixins as kdkMapMixins } from '@kalisio/kdk/map.client.map'
import { useAlerts } from '../composables'
import mixins from '../mixins'
Expand Down
1 change: 0 additions & 1 deletion src/components/EventCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@
<script>
import _ from 'lodash'
import { mixins as kCoreMixins, utils as kCoreUtils, Storage } from '@kalisio/kdk/core.client'
import { mixins as kMapMixins } from '@kalisio/kdk/map.client.map'
import { useAlerts } from '../composables'
import mixins from '../mixins'
Expand Down
2 changes: 1 addition & 1 deletion src/components/EventEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export default {
// Not yet loaded ?
if (!this.schema) return
// When selecting organisation as participant avoid selecting external ones
const organisationService = _.find(_.get(this.schema.properties, 'participants.services', []), { service: 'organisations'} )
const organisationService = _.find(_.get(this.schema.properties, 'participants.services', []), { service: 'organisations' })
if (organisationService) {
const organisationQuery = _.get(organisationService, 'baseQuery', {})
organisationQuery._id = this.contextId
Expand Down
2 changes: 1 addition & 1 deletion src/components/EventTemplateEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export default {
// Not yet loaded ?
if (!this.schema) return
// When selecting organisation as participant avoid selecting external ones
const organisationService = _.find(_.get(this.schema.properties, 'participants.services', []), { service: 'organisations'} )
const organisationService = _.find(_.get(this.schema.properties, 'participants.services', []), { service: 'organisations' })
if (organisationService) {
const organisationQuery = _.get(organisationService, 'baseQuery', {})
organisationQuery._id = this.contextId
Expand Down
8 changes: 4 additions & 4 deletions src/components/EventsActivity.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
:list-strategy="'smart'">
<template v-slot:empty-section>
<div class="absolute-center">
<KStamp
icon="las la-exclamation-circle"
icon-size="3rem"
:text="$t('KGrid.EMPTY_GRID')"
<KStamp
icon="las la-exclamation-circle"
icon-size="3rem"
:text="$t('KGrid.EMPTY_GRID')"
/>
</div>
</template>
Expand Down
6 changes: 3 additions & 3 deletions src/components/OrganisationCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
-->
<template v-slot:card-avatar>
<KAvatar
:subject="item"
:contextId="item._id"
size="4rem"
:subject="item"
:contextId="item._id"
size="4rem"
/>
</template>
<!--
Expand Down
14 changes: 7 additions & 7 deletions src/components/PlanMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@
</div>
</div>
<div class="q-pa-xs">
<KTextArea
:text="plan.description"
<KTextArea
:text="plan.description"
class="light-paragraph q-pa-sm"
/>
<!-- Objectives section -->
<KCardSection :hide-header="true">
<template v-for="(objective, index) in plan.objectives" :key="objective.id">
<div class="row full-width items-center justify-between no-wrap">
<q-toggle
class="col-8"
v-model="objectiveFilters"
:val="objective.name"
:label="objective.name"
<q-toggle
class="col-8"
v-model="objectiveFilters"
:val="objective.name"
:label="objective.name"
/>
<div class="row items-center q-gutter-x-sm no-wrap q-pr-sm">
<KPanel id="objective-actions" :content="getObjectiveActions(objective)" :dense="true" />
Expand Down
2 changes: 1 addition & 1 deletion src/tours/side-nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ const home = [{
}
}]

module.exports = _.union(home, sideNav, accountProfil, account)
module.exports = _.union(home, sideNav, accountProfil, account)
6 changes: 3 additions & 3 deletions test/event-workflow.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ describe(`suite:${suite}`, () => {
title: 'Step 1',
stakeholder: 'participant',
description: 'Availability',
interactions: [ 'yes', 'no' ],
interactions: ['yes', 'no'],
end: ['no']
}, {
title: 'Step 2',
stakeholder: 'coordinator',
description: 'Engagement',
interactions: [ 'yes', 'no' ],
interactions: ['yes', 'no'],
end: ['no']
}]
}],
Expand Down Expand Up @@ -255,7 +255,7 @@ describe(`suite:${suite}`, () => {
const workflowTemplate = _.find(org.eventTemplates, { name: 'Workflow template' })
workflowTemplate.workflow.forEach(step => {
step.name = 'New ' + step.name
step.interactions = [ 'New yes', ' New no' ],
step.interactions = ['New yes', ' New no']
step.lastInteractionsLength = 2
step.end = ['New no']
})
Expand Down
4 changes: 2 additions & 2 deletions test/events.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,9 @@ export async function editEventTemplateWorkflow (page, organisation, template, d
const step = template.workflow[i]
await core.type(page, '#title-field', step.title, false, true)
if (step.description) await core.type(page, '#description-field', step.description, false, true)
// Remove last
// Remove last
for (let j = 0; j < step.lastInteractionsLength; j++) {
const xpath = `//div[@id="chip-0"]//i[contains(@role, "button")]`
const xpath = '//div[@id="chip-0"]//i[contains(@role, "button")]'
const elements = await page.$x(xpath)
if (elements.length > 0) {
elements[0].click()
Expand Down
2 changes: 1 addition & 1 deletion test/plans.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ export async function canCreatePlan (page, organisation, template) {
if (!exists) return exists
await core.clickAction(page, 'fab')
exists = await core.elementExists(page, `#create-${_.kebabCase(template.name)}`)
return exists
return exists
}

export async function canCreatePlanTemplate (page, organisation) {
Expand Down
10 changes: 5 additions & 5 deletions test/plans.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,17 @@ describe(`suite:${suite}`, () => {
permission: 'member'
}],
plans: [
{ name: 'Plan 1'},
{ name: 'Plan 2'},
{ name: 'Plan 3'},
{ name: 'Plan 4'}
{ name: 'Plan 1' },
{ name: 'Plan 2' },
{ name: 'Plan 3' },
{ name: 'Plan 4' }
],
eventTemplate: {
name: 'Event',
description: 'Event description',
permission: 'member',
expiryDuration: '90'
},
}
}

before(async function () {
Expand Down
2 changes: 1 addition & 1 deletion test/tags.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@ export async function removeTag (page, organisation, tag, wait = 1000) {
await goToTagsActivity(page, organisation)
await core.clickItemAction(page, tagComponent, tag.value, 'remove-item-header')
await core.click(page, '.q-dialog button:nth-child(2)', wait)
}
}
2 changes: 1 addition & 1 deletion test/tags.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ describe(`suite:${suite}`, () => {
expect(await members.memberActionExists(page, org, manager, 'add-tag')).beFalse()
expect(await members.memberActionExists(page, org, member, 'add-tag')).beFalse()
})

it('manager can create a tag', async () => {
const manager = _.find(org.members, { name: 'Manager' })
await core.logout(page)
Expand Down

0 comments on commit ee440ed

Please sign in to comment.