Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
beforeAll(() => {
// setupConsoleLogging();
jasmine.addMatchers( customMatchers );
logger = LogManager.getLogger( 'ui-grid-spec' );
});
import {bindable, inject, LogManager} from 'aurelia-framework';
import $ from 'jquery';
let logger = LogManager.getLogger('context-menu');
@inject(Element)
export class ContextMenu {
@bindable items;
@bindable header = 'Context Menu';
@bindable width = 128;
@bindable action;
@bindable filter = ()=>true;
@bindable isEnabled = ()=>true;
constructor(elem) {
this.elem = elem;
}
attached() {
this.root = $('div.context-menu', this.elem);
import {SessionContext} from '../../services/session-context';
import {EventNames, StorageKeys, EventManaged, KeyCodes} from '../../events/event-managed';
import {LocationHelper} from '../../util/location-helper';
import {StampFilter, ConditionFilter, Condition, CurrencyCode} from '../../util/common-models';
import {PredicateUtilities} from '../../util/object-utilities';
import {ImagePreviewEvents} from '../../resources/elements/image-preview/image-preview';
import {asCurrencyValueConverter} from '../../resources/value-converters/as-currency-formatted';
import {PdfGenerator} from '../../reports/pdf-generator';
import {ReportHelper} from '../../reports/report-helper';
import {Predicate, Operators, Parser} from 'odata-filter-parser';
import bootbox from 'bootbox';
import {DialogService} from 'aurelia-dialog';
import _ from 'lodash';
const logger = LogManager.getLogger('stamp-list');
function createStamp(wantList) {
return {
id: 0,
wantList: wantList,
countryRef: -1,
catalogueNumbers: [],
stampOwnerships: []
};
}
@inject(Element, EventAggregator, Router, Stamps, Countries, Preferences, asCurrencyValueConverter, I18N, DialogService, PdfGenerator, ReportHelper)
export class StampList extends EventManaged {
stamps = [];
editingStamp = undefined;
import {inject, LogManager, computedFrom, bindable} from 'aurelia-framework';
import {ApiClient} from 'lib/api-client';
const logger = LogManager.getLogger('shelves');
@inject(ApiClient)
export class Shelves {
sortings = [{name:'Name A-Z', key:'name'}, {name:'Name Z-A', key:'-name'},
{name:'Recent First', key: '-created'}, {name:'Oldest First', key: 'created'}]
@bindable filter;
constructor(client) {
this.client = client;
this.mine = true;
}
activate() {
this.updateLoader();
}
import {inject, LogManager, bindable, computedFrom} from 'aurelia-framework';
import {ApiClient} from 'lib/api-client';
import {Access} from 'lib/access';
import {Router} from 'aurelia-router';
import {Configure} from 'lib/config/index';
import {ConvertMany} from './abstract/convert-many';
import {WSClient} from 'lib/ws-client';
const logger = LogManager.getLogger('series');
@inject(ApiClient, Access, Router, Configure, WSClient)
export class Series extends ConvertMany{
sortings=[{name:'Series Index Asc.', key:'series_index'},
{name:'Series Index Desc.', key:'-series_index'},
{name:'Title A-Z', key:'title'},
{name:'Title Z-A',key:'-title'},
{name:'Recent First', key:'-created'},
{name:'Oldest First', key: 'created'}];
constructor(client, access, router, config, wsClient) {
super(access, config, wsClient);
this.client=client;
this.access=access;
this.router=router;
this.entity='series';
}
import {Access} from 'lib/access';
import {inject, LogManager, bindable} from 'aurelia-framework';
import {Router} from 'aurelia-router';
let logger=LogManager.getLogger('login');
@inject(Access, Router)
export class Login{
title = 'Login';
@bindable email='';
@bindable password='';
error=false;
constructor(access, router){
this.access = access;
this.router = router;
};
canActivate() {
if (this.access.authenticated) return false;
return this.access.refreshLogin()
import {
inject, LogManager
}
from 'aurelia-framework';
import {
ServiceBase
}
from 'kloudspeaker/service/service-base';
let logger = LogManager.getLogger('filesystem-service');
@
inject(ServiceBase)
export class FilesystemService {
constructor(service) {
logger.debug("Filesystem service");
this.service = service;
}
folderInfo(fid, hierarchy, data) {
return this.service.post('filesystem/' + (fid ? fid : "roots") + "/info/" + (hierarchy ? "?h=1" : ""), data);
}
itemInfo(id, data) {
//TODO rename details->info?
return this.service.post('filesystem/' + id+ "/details/", {data: data});
import {inject, LogManager, computedFrom} from 'aurelia-framework';
import {ApiClient} from 'lib/api-client';
import {WSClient} from 'lib/ws-client';
import {Router} from 'aurelia-router';
import {EventAggregator} from 'aurelia-event-aggregator';
import $ from 'jquery';
const logger = LogManager.getLogger('cover-edit');
@inject(Element, ApiClient, WSClient, Router, EventAggregator)
export class CoverEdit {
constructor(elem, client, wsClient, router, event) {
this.elem = elem;
this.client = client;
this.router = router;
this.wsClient = wsClient;
this.event = event;
}
canActivate(params) {
if (! params.id) return false;
return this.client.getOne('ebooks', params.id)
.then( b=> {
this.ebook=b;
import {AuthService} from 'aurelia-auth';
import {Authentication} from 'aurelia-auth/authentication'
import {inject, LogManager, BindingEngine} from 'aurelia-framework';
import {EventAggregator} from 'aurelia-event-aggregator';
import {Router} from 'aurelia-router';
import {HttpClient, json} from 'aurelia-fetch-client';
let logger=LogManager.getLogger('access');
const REFRESH_TOKEN = 'aurelia_refresh_token';
@inject(AuthService, Authentication, EventAggregator, Router, HttpClient, BindingEngine)
export class Access {
constructor(auth, authUtil, event, router, http, bindingEngine) {
this.auth=auth;
this.util=authUtil;
this.event=event;
this.router = router;
this.http = http;
logger.debug(`AuthUtil ${authUtil}`);
bindingEngine.propertyObserver(this, 'authenticated')
.subscribe((n,o) => this.authenticatedChanged(n,o));
}