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

feat: Linting changes #560

Merged
merged 1 commit into from
May 9, 2024
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
5 changes: 4 additions & 1 deletion apps/api/src/app/activity/activity.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ import { isDateString } from '@shared/helpers/common.helper';
@UseGuards(JwtAuthGuard)
@ApiSecurity(ACCESS_KEY_NAME)
export class ActivityController {
constructor(private uploadSummary: UploadSummary, private uploadHistory: UploadHistory) {}
constructor(
private uploadSummary: UploadSummary,
private uploadHistory: UploadHistory
) {}

@Get(':projectId/summary')
@ApiOperation({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ export class RequestForgotPassword {
private MAX_ATTEMPTS_IN_A_DAY = 15;
private RATE_LIMIT_IN_SECONDS = 60;
private RATE_LIMIT_IN_HOURS = 24;
constructor(private emailService: EmailService, private userRepository: UserRepository) {}
constructor(
private emailService: EmailService,
private userRepository: UserRepository
) {}

async execute(command: RequestForgotPasswordCommand) {
const user = await this.userRepository.findByEmail(command.email);
Expand Down
6 changes: 5 additions & 1 deletion apps/api/src/app/column/column.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ import { UpdateColumnCommand } from './commands/update-column.command';
@UseGuards(JwtAuthGuard)
@ApiSecurity(ACCESS_KEY_NAME)
export class ColumnController {
constructor(private addColumn: AddColumn, private updateColumn: UpdateColumn, private deleteColumn: DeleteColumn) {}
constructor(
private addColumn: AddColumn,
private updateColumn: UpdateColumn,
private deleteColumn: DeleteColumn
) {}

@Post(':templateId')
@ApiOperation({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import { PaginationResult } from '@impler/shared';

@Injectable()
export class GetImports {
constructor(private templateRepository: TemplateRepository, private commonRepository: CommonRepository) {}
constructor(
private templateRepository: TemplateRepository,
private commonRepository: CommonRepository
) {}

async execute({
_projectId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { TemplateListResponseDto } from 'app/project/dtos/template-list-response

@Injectable()
export class GetTemplates {
constructor(private templateRepository: TemplateRepository, private commonRepository: CommonRepository) {}
constructor(
private templateRepository: TemplateRepository,
private commonRepository: CommonRepository
) {}

async execute(_projectId: string): Promise<TemplateListResponseDto[]> {
const templates = await this.templateRepository.aggregate([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { DalService, UploadRepository } from '@impler/dal';

@Injectable()
export class DeleteRecord {
constructor(private dalService: DalService, private uploadRepository: UploadRepository) {}
constructor(
private dalService: DalService,
private uploadRepository: UploadRepository
) {}

async execute(_uploadId: string, index: number, isValid?: boolean) {
await this.dalService.deleteRecord(_uploadId, index);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import { TemplateEntity, UploadEntity, UploadRepository } from '@impler/dal';

@Injectable()
export class StartProcess {
constructor(private uploadRepository: UploadRepository, private queueService: QueueService) {}
constructor(
private uploadRepository: UploadRepository,
private queueService: QueueService
) {}

async execute(_uploadId: string): Promise<UploadEntity> {
let upload = await this.uploadRepository.getUploadWithTemplate(_uploadId, ['destination']);
Expand Down
5 changes: 4 additions & 1 deletion apps/api/src/app/shared/framework/auth.gaurd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ export class APIKeyGuard implements CanActivate {

@Injectable()
export class JwtAuthGuard extends AuthGuard('jwt') {
constructor(@Inject(forwardRef(() => AuthService)) private authService: AuthService, private jwtService: JwtService) {
constructor(
@Inject(forwardRef(() => AuthService)) private authService: AuthService,
private jwtService: JwtService
) {
super();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import { DownloadSampleCommand } from './download-sample.command';

@Injectable()
export class DownloadSample {
constructor(private columnsRepository: ColumnRepository, private excelFileService: ExcelFileService) {}
constructor(
private columnsRepository: ColumnRepository,
private excelFileService: ExcelFileService
) {}

async execute(_templateId: string, data: DownloadSampleCommand): Promise<Buffer> {
const columns = await this.columnsRepository.find(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { UploadRepository } from '@impler/dal';
import { StorageService } from '@impler/shared/dist/services/storage';
import { Injectable } from '@nestjs/common';

@Injectable()
export class GetUploadProcessInformation {
constructor(private uploadRepository: UploadRepository, private storageService: StorageService) {}
constructor(private uploadRepository: UploadRepository) {}

async execute(uploadId: string) {
return await this.uploadRepository.getUploadProcessInformation(uploadId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { UploadStatusEnum } from '@impler/shared';

@Injectable()
export class TerminateUpload {
constructor(private uploadRepository: UploadRepository, private dalService: DalService) {}
constructor(
private uploadRepository: UploadRepository,
private dalService: DalService
) {}

async execute(_uploadId: string) {
const upload = await this.uploadRepository.findOneAndUpdate(
Expand Down
10 changes: 6 additions & 4 deletions apps/web/hooks/useImportDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ export function useImportDetails({ templateId }: useImportDetailProps) {
{
onSuccess: (data) => {
modals.close(MODAL_KEYS.IMPORT_UPDATE);
queryClient.setQueryData<ITemplate[]>([API_KEYS.TEMPLATES_LIST, profileInfo!._projectId], (oldData) =>
oldData?.map((item) => (item._id === data._id ? data : item))
queryClient.setQueryData<ITemplate[]>(
[API_KEYS.TEMPLATES_LIST, profileInfo!._projectId],
(oldData) => oldData?.map((item) => (item._id === data._id ? data : item))
);
queryClient.setQueryData<ITemplate>([API_KEYS.TEMPLATE_DETAILS, templateId], data);
notify(NOTIFICATION_KEYS.IMPORT_UPDATED);
Expand All @@ -57,8 +58,9 @@ export function useImportDetails({ templateId }: useImportDetailProps) {
() => commonApi<ITemplate>(API_KEYS.TEMPLATE_DELETE as any, { parameters: [templateId] }),
{
onSuccess: () => {
queryClient.setQueryData<ITemplate[]>([API_KEYS.TEMPLATES_LIST, profileInfo!._projectId], (oldData) =>
oldData?.filter((item) => item._id !== templateId)
queryClient.setQueryData<ITemplate[]>(
[API_KEYS.TEMPLATES_LIST, profileInfo!._projectId],
(oldData) => oldData?.filter((item) => item._id !== templateId)
);
queryClient.removeQueries([API_KEYS.TEMPLATE_DETAILS, templateId]);
notify(NOTIFICATION_KEYS.IMPORT_DELETED);
Expand Down
5 changes: 4 additions & 1 deletion libs/dal/src/repositories/base-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import { Document, FilterQuery, Model, QueryOptions, Types, UpdateQuery } from '
export class BaseRepository<T> {
public _model: Model<any & Document>;

constructor(protected MongooseModel: Model<any & Document>, protected entity: ClassConstructor<T>) {
constructor(
protected MongooseModel: Model<any & Document>,
protected entity: ClassConstructor<T>
) {
this._model = MongooseModel;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/hooks/useImpler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export function useImpler({
return vv.toString(16);
});
}

const showWidget = async ({ colorScheme, data, schema, output }: ShowWidgetProps) => {
if (window.impler && isImplerInitiated) {
const payload: IShowPayload = {
Expand Down
Loading