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'; |
||||
|
||||
declare var QRCode:any; |
||||
declare let QRCode:any; |
||||
|
||||
jQuery(function ($) { |
||||
$('#submit_otp').submit(function() { |
||||
$('.ajax_form').find("input, radio").attr('disabled', 'disabled'); |
||||
jQuery(($) => { |
||||
$('#submit_otp').submit(() => { |
||||
$('.ajax_form').find('input, radio').attr('disabled', 'disabled'); |
||||
}); |
||||
|
||||
$('#toggle_resend_form').click(function(){ |
||||
$('#toggle_resend_form').click(() => { |
||||
$('#resend_otp_container').toggle(); |
||||
return false; |
||||
}); |
||||
|
||||
$('.qr-code-element').each(function() { |
||||
var el = $(this); |
||||
$('.qr-code-element').each(function () { |
||||
const el = $(this); |
||||
new QRCode( |
||||
el[0], |
||||
{ |
||||
text: el.data('value'), |
||||
width: 220, |
||||
height: 220 |
||||
} |
||||
height: 220, |
||||
}, |
||||
); |
||||
}); |
||||
|
||||
$('.ajax_form').submit(function() { |
||||
$('#submit_otp').find("input").attr('disabled', 'disabled'); |
||||
var form = $(this), |
||||
submit_button = form.find("input[type=submit]"); |
||||
$.ajax({ url: form.attr('action'), |
||||
$('.ajax_form').submit(function () { |
||||
$('#submit_otp').find('input').attr('disabled', 'disabled'); |
||||
const form = $(this); |
||||
const submit_button = form.find('input[type=submit]'); |
||||
$.ajax({ |
||||
url: form.attr('action'), |
||||
type: 'post', |
||||
data: form.serialize(), |
||||
beforeSend: function() { |
||||
beforeSend() { |
||||
submit_button.attr('disabled', 'disabled'); |
||||
submit_button.toggleClass('submitting'); |
||||
$('.flash.notice').toggle(); |
||||
}, |
||||
complete: function(response) { |
||||
complete(response) { |
||||
submit_button.removeAttr('disabled'); |
||||
$('#submit_otp').find("input").removeAttr('disabled'); |
||||
$('#submit_otp').find('input').removeAttr('disabled'); |
||||
$('.flash.notice a').html(response.responseText); |
||||
$('form#resend_otp, #toggle_resend_form, .flash.notice').toggle(); |
||||
submit_button.toggleClass('submitting'); |
||||
} |
||||
}, |
||||
}); |
||||
return false; |
||||
}); |
||||
|
||||
$('#print_2fa_backup_codes').click(function() { |
||||
$('#print_2fa_backup_codes').click(() => { |
||||
window.print(); |
||||
}); |
||||
|
||||
if ($('#download_2fa_backup_codes').length) { |
||||
var text = ''; |
||||
$('.two-factor-authentication--backup-codes li').each(function() { |
||||
text += this.textContent + "\n"; |
||||
let text = ''; |
||||
$('.two-factor-authentication--backup-codes li').each(function () { |
||||
text += `${this.textContent}\n`; |
||||
}); |
||||
var element = $('#download_2fa_backup_codes'); |
||||
element.attr('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text)); |
||||
const element = $('#download_2fa_backup_codes'); |
||||
element.attr('href', `data:text/plain;charset=utf-8,${encodeURIComponent(text)}`); |
||||
element.attr('download', 'backup-codes.txt'); |
||||
} |
||||
}); |
||||
|
@ -1,21 +1,16 @@ |
||||
import { Injectable } from '@angular/core'; |
||||
import { filterNilValue, Query } from '@datorama/akita'; |
||||
import { Observable, combineLatest } from 'rxjs'; |
||||
import { map } from 'rxjs/operators'; |
||||
import { |
||||
CurrentUserStore, |
||||
CurrentUserState, |
||||
CurrentUser, |
||||
} from './current-user.store'; |
||||
import { CapabilityResource } from "core-app/features/hal/resources/capability-resource"; |
||||
import { CurrentUserState, CurrentUserStore } from './current-user.store'; |
||||
|
||||
@Injectable() |
||||
export class CurrentUserQuery extends Query<CurrentUserState> { |
||||
constructor(protected store: CurrentUserStore) { |
||||
constructor(protected store:CurrentUserStore) { |
||||
super(store); |
||||
} |
||||
|
||||
isLoggedIn$ = this.select(state => !!state.id); |
||||
isLoggedIn$ = this.select((state) => !!state.id); |
||||
|
||||
user$ = this.select(({ id, name, mail }) => ({ id, name, mail })); |
||||
|
||||
capabilities$ = this.select('capabilities').pipe(filterNilValue()); |
||||
} |
||||
|
@ -1,4 +1,4 @@ |
||||
import * as Sentry from "@sentry/angular"; |
||||
import { Integrations } from "@sentry/tracing"; |
||||
import * as Sentry from '@sentry/angular'; |
||||
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