Feat/frontend linting (#9424)
* Change eslintrc config * Try esprint fix * Run linter fix * Set most of the typescript linting rules to warn, run with --fix * Fix some linting errors * Optimize imports * Build works again * Remove fixes that didn't fix anything * Make imports lint-conform again && disable trailing underscores as it is part of Angular and our convention * Remove wrong automated fix * Rename components with suffix "Component" for linting * Linting, refactor reorder-delta-builder to a more functional style * Update delta reorder specs * Add exceptions for "++" in loops and bracket expressions in arrow functions * Some linting fixes * Fix some more linting * Optimize imports Co-authored-by: Henriette Darge <h.darge@openproject.com>pull/9438/head
parent
89bd15516d
commit
3a877457ad
@ -0,0 +1,10 @@ |
|||||||
|
{ |
||||||
|
"paths": ["src/**/*.ts", "src/*.ts"], |
||||||
|
"ignored": [ |
||||||
|
"**/node_modules/**/*", |
||||||
|
"src/**/*.spec.ts", |
||||||
|
"src/test/*" |
||||||
|
], |
||||||
|
"port": 5004, |
||||||
|
"quiet": true |
||||||
|
} |
File diff suppressed because it is too large
Load Diff
@ -1,63 +1,64 @@ |
|||||||
import 'core-vendor/qrcode-min'; |
import 'core-vendor/qrcode-min'; |
||||||
|
|
||||||
declare var QRCode:any; |
declare let QRCode:any; |
||||||
|
|
||||||
jQuery(function ($) { |
jQuery(($) => { |
||||||
$('#submit_otp').submit(function() { |
$('#submit_otp').submit(() => { |
||||||
$('.ajax_form').find("input, radio").attr('disabled', 'disabled'); |
$('.ajax_form').find('input, radio').attr('disabled', 'disabled'); |
||||||
}); |
}); |
||||||
|
|
||||||
$('#toggle_resend_form').click(function(){ |
$('#toggle_resend_form').click(() => { |
||||||
$('#resend_otp_container').toggle(); |
$('#resend_otp_container').toggle(); |
||||||
return false; |
return false; |
||||||
}); |
}); |
||||||
|
|
||||||
$('.qr-code-element').each(function() { |
$('.qr-code-element').each(function () { |
||||||
var el = $(this); |
const el = $(this); |
||||||
new QRCode( |
new QRCode( |
||||||
el[0], |
el[0], |
||||||
{ |
{ |
||||||
text: el.data('value'), |
text: el.data('value'), |
||||||
width: 220, |
width: 220, |
||||||
height: 220 |
height: 220, |
||||||
} |
}, |
||||||
); |
); |
||||||
}); |
}); |
||||||
|
|
||||||
$('.ajax_form').submit(function() { |
$('.ajax_form').submit(function () { |
||||||
$('#submit_otp').find("input").attr('disabled', 'disabled'); |
$('#submit_otp').find('input').attr('disabled', 'disabled'); |
||||||
var form = $(this), |
const form = $(this); |
||||||
submit_button = form.find("input[type=submit]"); |
const submit_button = form.find('input[type=submit]'); |
||||||
$.ajax({ url: form.attr('action'), |
$.ajax({ |
||||||
|
url: form.attr('action'), |
||||||
type: 'post', |
type: 'post', |
||||||
data: form.serialize(), |
data: form.serialize(), |
||||||
beforeSend: function() { |
beforeSend() { |
||||||
submit_button.attr('disabled', 'disabled'); |
submit_button.attr('disabled', 'disabled'); |
||||||
submit_button.toggleClass('submitting'); |
submit_button.toggleClass('submitting'); |
||||||
$('.flash.notice').toggle(); |
$('.flash.notice').toggle(); |
||||||
}, |
}, |
||||||
complete: function(response) { |
complete(response) { |
||||||
submit_button.removeAttr('disabled'); |
submit_button.removeAttr('disabled'); |
||||||
$('#submit_otp').find("input").removeAttr('disabled'); |
$('#submit_otp').find('input').removeAttr('disabled'); |
||||||
$('.flash.notice a').html(response.responseText); |
$('.flash.notice a').html(response.responseText); |
||||||
$('form#resend_otp, #toggle_resend_form, .flash.notice').toggle(); |
$('form#resend_otp, #toggle_resend_form, .flash.notice').toggle(); |
||||||
submit_button.toggleClass('submitting'); |
submit_button.toggleClass('submitting'); |
||||||
} |
}, |
||||||
}); |
}); |
||||||
return false; |
return false; |
||||||
}); |
}); |
||||||
|
|
||||||
$('#print_2fa_backup_codes').click(function() { |
$('#print_2fa_backup_codes').click(() => { |
||||||
window.print(); |
window.print(); |
||||||
}); |
}); |
||||||
|
|
||||||
if ($('#download_2fa_backup_codes').length) { |
if ($('#download_2fa_backup_codes').length) { |
||||||
var text = ''; |
let text = ''; |
||||||
$('.two-factor-authentication--backup-codes li').each(function() { |
$('.two-factor-authentication--backup-codes li').each(function () { |
||||||
text += this.textContent + "\n"; |
text += `${this.textContent}\n`; |
||||||
}); |
}); |
||||||
var element = $('#download_2fa_backup_codes'); |
const element = $('#download_2fa_backup_codes'); |
||||||
element.attr('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text)); |
element.attr('href', `data:text/plain;charset=utf-8,${encodeURIComponent(text)}`); |
||||||
element.attr('download', 'backup-codes.txt'); |
element.attr('download', 'backup-codes.txt'); |
||||||
} |
} |
||||||
}); |
}); |
||||||
|
@ -1,21 +1,16 @@ |
|||||||
import { Injectable } from '@angular/core'; |
import { Injectable } from '@angular/core'; |
||||||
import { filterNilValue, Query } from '@datorama/akita'; |
import { filterNilValue, Query } from '@datorama/akita'; |
||||||
import { Observable, combineLatest } from 'rxjs'; |
import { CurrentUserState, CurrentUserStore } from './current-user.store'; |
||||||
import { map } from 'rxjs/operators'; |
|
||||||
import { |
|
||||||
CurrentUserStore, |
|
||||||
CurrentUserState, |
|
||||||
CurrentUser, |
|
||||||
} from './current-user.store'; |
|
||||||
import { CapabilityResource } from "core-app/features/hal/resources/capability-resource"; |
|
||||||
|
|
||||||
@Injectable() |
@Injectable() |
||||||
export class CurrentUserQuery extends Query<CurrentUserState> { |
export class CurrentUserQuery extends Query<CurrentUserState> { |
||||||
constructor(protected store: CurrentUserStore) { |
constructor(protected store:CurrentUserStore) { |
||||||
super(store); |
super(store); |
||||||
} |
} |
||||||
|
|
||||||
isLoggedIn$ = this.select(state => !!state.id); |
isLoggedIn$ = this.select((state) => !!state.id); |
||||||
|
|
||||||
user$ = this.select(({ id, name, mail }) => ({ id, name, mail })); |
user$ = this.select(({ id, name, mail }) => ({ id, name, mail })); |
||||||
|
|
||||||
capabilities$ = this.select('capabilities').pipe(filterNilValue()); |
capabilities$ = this.select('capabilities').pipe(filterNilValue()); |
||||||
} |
} |
||||||
|
@ -1,4 +1,4 @@ |
|||||||
import * as Sentry from "@sentry/angular"; |
import * as Sentry from '@sentry/angular'; |
||||||
import { Integrations } from "@sentry/tracing"; |
import { Integrations } from '@sentry/tracing'; |
||||||
|
|
||||||
export { Sentry, Integrations }; |
export { Sentry, Integrations }; |
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue