Skip to content
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
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,15 @@ clean-dev: clean
lint:
npm run lint
npm run stylelint
npm run format
composer run cs:check
composer run psalm

# lint fix js, css and php
lint-fix:
npm run lint:fix
npm run stylelint:fix
npm run format
composer run cs:fix

cs:
Expand Down
7 changes: 3 additions & 4 deletions src/Api/modules/activity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ const activity = {
object_type: 'poll',
object_id: pollId,
},
signal:
cancelTokenHandlerObject[
this.getActivities.name
].handleRequestCancellation().signal,
signal: cancelTokenHandlerObject[
this.getActivities.name
].handleRequestCancellation().signal,
})
return response
},
Expand Down
14 changes: 6 additions & 8 deletions src/Api/modules/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ const adminJobs = {
return httpInstance.request({
method: 'GET',
url: 'administration/jobs',
signal:
cancelTokenHandlerObject[
this.getJobsList.name
].handleRequestCancellation().signal,
signal: cancelTokenHandlerObject[
this.getJobsList.name
].handleRequestCancellation().signal,
})
},

Expand All @@ -27,10 +26,9 @@ const adminJobs = {
job: job.className,
},

signal:
cancelTokenHandlerObject[
this.runJob.name
].handleRequestCancellation().signal,
signal: cancelTokenHandlerObject[
this.runJob.name
].handleRequestCancellation().signal,
})
},
}
Expand Down
28 changes: 12 additions & 16 deletions src/Api/modules/appSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ const appSettings = {
method: 'GET',
url: 'settings/app',
params: { time: +new Date() },
signal:
cancelTokenHandlerObject[
this.getAppSettings.name
].handleRequestCancellation().signal,
signal: cancelTokenHandlerObject[
this.getAppSettings.name
].handleRequestCancellation().signal,
})
},

Expand All @@ -28,21 +27,19 @@ const appSettings = {
method: 'POST',
url: 'settings/app',
data: { appSettings },
signal:
cancelTokenHandlerObject[
this.writeAppSettings.name
].handleRequestCancellation().signal,
signal: cancelTokenHandlerObject[
this.writeAppSettings.name
].handleRequestCancellation().signal,
})
},

getGroups(query: string): Promise<AxiosResponse<{ groups: Group[] }>> {
return httpInstance.request({
method: 'GET',
url: `groups${query.trim() ? `/${query.trim()}` : ''}`,
signal:
cancelTokenHandlerObject[
this.getGroups.name
].handleRequestCancellation().signal,
signal: cancelTokenHandlerObject[
this.getGroups.name
].handleRequestCancellation().signal,
})
},

Expand All @@ -54,10 +51,9 @@ const appSettings = {
method: 'GET',
url: `search/users${query.trim() ? `/${query.trim()}` : ''}`,
params: { types: types.toString() },
signal:
cancelTokenHandlerObject[
this.getUsers.name
].handleRequestCancellation().signal,
signal: cancelTokenHandlerObject[
this.getUsers.name
].handleRequestCancellation().signal,
})
},
}
Expand Down
7 changes: 3 additions & 4 deletions src/Api/modules/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ const calendar = {
method: 'GET',
url: 'calendars',
params: { time: +new Date() },
signal:
cancelTokenHandlerObject[
this.getCalendars.name
].handleRequestCancellation().signal,
signal: cancelTokenHandlerObject[
this.getCalendars.name
].handleRequestCancellation().signal,
})
},
getEvents(
Expand Down
28 changes: 12 additions & 16 deletions src/Api/modules/comments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ const comments = {
method: 'GET',
url: `poll/${pollId}/comments`,
params: { time: +new Date() },
signal:
cancelTokenHandlerObject[
this.getComments.name
].handleRequestCancellation().signal,
signal: cancelTokenHandlerObject[
this.getComments.name
].handleRequestCancellation().signal,
})
},
addComment(
Expand All @@ -29,10 +28,9 @@ const comments = {
url: `poll/${pollId}/comment`,
data: { message, confidential },
params: { time: +new Date() },
signal:
cancelTokenHandlerObject[
this.addComment.name
].handleRequestCancellation().signal,
signal: cancelTokenHandlerObject[
this.addComment.name
].handleRequestCancellation().signal,
})
},

Expand All @@ -42,10 +40,9 @@ const comments = {
url: `comment/${commentId}`,
params: { time: +new Date() },

signal:
cancelTokenHandlerObject[
this.deleteComment.name
].handleRequestCancellation().signal,
signal: cancelTokenHandlerObject[
this.deleteComment.name
].handleRequestCancellation().signal,
})
},
restoreComment(commentId: number): Promise<AxiosResponse<{ comment: Comment }>> {
Expand All @@ -54,10 +51,9 @@ const comments = {
url: `comment/${commentId}/restore`,
params: { time: +new Date() },

signal:
cancelTokenHandlerObject[
this.restoreComment.name
].handleRequestCancellation().signal,
signal: cancelTokenHandlerObject[
this.restoreComment.name
].handleRequestCancellation().signal,
})
},
}
Expand Down
77 changes: 36 additions & 41 deletions src/Api/modules/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,22 @@ import { httpInstance, createCancelTokenHandler } from './HttpApi'
import type { DateTimeUnits } from '../../Types/dateTime'
import type { AxiosResponse } from '@nextcloud/axios'
import type { Vote } from '../../stores/votes.types'
import type { Option, OptionDto, Sequence, SimpleOption } from '../../stores/options.types'
import type {
Option,
OptionDto,
Sequence,
SimpleOption,
} from '../../stores/options.types'

const options = {
getOptions(pollId: number): Promise<AxiosResponse<{ options: OptionDto[] }>> {
return httpInstance.request({
method: 'GET',
url: `poll/${pollId}/options`,
params: { time: +new Date() },
signal:
cancelTokenHandlerObject[
this.getOptions.name
].handleRequestCancellation().signal,
signal: cancelTokenHandlerObject[
this.getOptions.name
].handleRequestCancellation().signal,
})
},

Expand All @@ -39,10 +43,9 @@ const options = {
url: `poll/${pollId}/option`,
// data: { ...option },
data: { option, sequence, voteYes },
signal:
cancelTokenHandlerObject[
this.addOption.name
].handleRequestCancellation().signal,
signal: cancelTokenHandlerObject[
this.addOption.name
].handleRequestCancellation().signal,
})
},

Expand All @@ -51,10 +54,9 @@ const options = {
method: 'PUT',
url: `option/${option.id}`,
data: { ...option },
signal:
cancelTokenHandlerObject[
this.updateOption.name
].handleRequestCancellation().signal,
signal: cancelTokenHandlerObject[
this.updateOption.name
].handleRequestCancellation().signal,
})
},

Expand All @@ -63,10 +65,9 @@ const options = {
method: 'DELETE',
url: `option/${optionId}`,
params: { time: +new Date() },
signal:
cancelTokenHandlerObject[
this.deleteOption.name
].handleRequestCancellation().signal,
signal: cancelTokenHandlerObject[
this.deleteOption.name
].handleRequestCancellation().signal,
})
},

Expand All @@ -76,10 +77,9 @@ const options = {
url: `option/${optionId}/restore`,
params: { time: +new Date() },

signal:
cancelTokenHandlerObject[
this.restoreOption.name
].handleRequestCancellation().signal,
signal: cancelTokenHandlerObject[
this.restoreOption.name
].handleRequestCancellation().signal,
})
},

Expand All @@ -101,21 +101,19 @@ const options = {
pollId,
text: optionsBatch,
},
signal:
cancelTokenHandlerObject[
this.addOptions.name
].handleRequestCancellation().signal,
signal: cancelTokenHandlerObject[
this.addOptions.name
].handleRequestCancellation().signal,
})
},

confirmOption(optionId: number): Promise<AxiosResponse<{ option: OptionDto }>> {
return httpInstance.request({
method: 'PUT',
url: `option/${optionId}/confirm`,
signal:
cancelTokenHandlerObject[
this.confirmOption.name
].handleRequestCancellation().signal,
signal: cancelTokenHandlerObject[
this.confirmOption.name
].handleRequestCancellation().signal,
})
},

Expand All @@ -130,10 +128,9 @@ const options = {
method: 'POST',
url: `poll/${pollId}/options/reorder`,
data: { options },
signal:
cancelTokenHandlerObject[
this.reorderOptions.name
].handleRequestCancellation().signal,
signal: cancelTokenHandlerObject[
this.reorderOptions.name
].handleRequestCancellation().signal,
})
},

Expand All @@ -147,10 +144,9 @@ const options = {
data: {
sequence,
},
signal:
cancelTokenHandlerObject[
this.addOptionsSequence.name
].handleRequestCancellation().signal,
signal: cancelTokenHandlerObject[
this.addOptionsSequence.name
].handleRequestCancellation().signal,
})
},

Expand All @@ -166,10 +162,9 @@ const options = {
step,
unit,
},
signal:
cancelTokenHandlerObject[
this.shiftOptions.name
].handleRequestCancellation().signal,
signal: cancelTokenHandlerObject[
this.shiftOptions.name
].handleRequestCancellation().signal,
})
},
}
Expand Down
28 changes: 12 additions & 16 deletions src/Api/modules/pollGroups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ const pollGroups = {
method: 'GET',
url: 'pollgroups',
params: { time: +new Date() },
signal:
cancelTokenHandlerObject[
this.getPollGroups.name
].handleRequestCancellation().signal,
signal: cancelTokenHandlerObject[
this.getPollGroups.name
].handleRequestCancellation().signal,
})
},

Expand Down Expand Up @@ -46,10 +45,9 @@ const pollGroups = {
method: verb,
url,
data,
signal:
cancelTokenHandlerObject[
this.addPollToGroup.name
].handleRequestCancellation().signal,
signal: cancelTokenHandlerObject[
this.addPollToGroup.name
].handleRequestCancellation().signal,
})
},

Expand All @@ -60,10 +58,9 @@ const pollGroups = {
return httpInstance.request({
method: 'DELETE',
url: `pollgroup/${pollGroupId}/poll/${pollId}`,
signal:
cancelTokenHandlerObject[
this.removePollFromGroup.name
].handleRequestCancellation().signal,
signal: cancelTokenHandlerObject[
this.removePollFromGroup.name
].handleRequestCancellation().signal,
})
},

Expand All @@ -81,10 +78,9 @@ const pollGroups = {
titleExt: payload.titleExt,
description: payload.description,
},
signal:
cancelTokenHandlerObject[
this.updatePollGroup.name
].handleRequestCancellation().signal,
signal: cancelTokenHandlerObject[
this.updatePollGroup.name
].handleRequestCancellation().signal,
})
},
}
Expand Down
Loading
Loading