type
stringclasses 7
values | content
stringlengths 4
9.55k
| repo
stringlengths 7
96
| path
stringlengths 4
178
| language
stringclasses 1
value |
|---|---|---|---|---|
ArrowFunction
|
() => {
testObject.$getChildren('testNodeTreeProvider')
.then(elements => {
assert.deepEqual(elements.map(e => e.handle), ['0/0:c']);
done();
});
}
|
CRAZYCUPCAKES40/vscode
|
src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts
|
TypeScript
|
ArrowFunction
|
elements => {
assert.deepEqual(elements.map(e => e.handle), ['0/0:c']);
done();
}
|
CRAZYCUPCAKES40/vscode
|
src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts
|
TypeScript
|
ArrowFunction
|
() => {
tree = {
'c': {}
};
return testObject.$getChildren('testNodeTreeProvider')
.then(elements => {
assert.deepEqual(elements.map(e => e.handle), ['0/0:a', '0/0:b']);
});
}
|
CRAZYCUPCAKES40/vscode
|
src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts
|
TypeScript
|
ArrowFunction
|
elements => {
assert.deepEqual(elements.map(e => e.handle), ['0/0:a', '0/0:b']);
}
|
CRAZYCUPCAKES40/vscode
|
src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts
|
TypeScript
|
ArrowFunction
|
() => {
const treeView = testObject.registerTreeDataProvider('treeDataProvider', aNodeTreeDataProvider(), (fn) => fn);
return treeView.reveal({ key: 'a' })
.then(() => assert.fail('Reveal should throw an error as getParent is not implemented'), () => null);
}
|
CRAZYCUPCAKES40/vscode
|
src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts
|
TypeScript
|
ArrowFunction
|
() => assert.fail('Reveal should throw an error as getParent is not implemented')
|
CRAZYCUPCAKES40/vscode
|
src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts
|
TypeScript
|
ArrowFunction
|
() => {
const revealTarget = sinon.spy(target, '$reveal');
const treeView = testObject.registerTreeDataProvider('treeDataProvider', aCompleteNodeTreeDataProvider(), (fn) => fn);
return treeView.reveal({ key: 'a' })
.then(() => {
assert.ok(revealTarget.calledOnce);
assert.deepEqual('treeDataProvider', revealTarget.args[0][0]);
assert.deepEqual({ handle: '0/0:a', label: 'a', collapsibleState: TreeItemCollapsibleState.Collapsed }, removeUnsetKeys(revealTarget.args[0][1]));
assert.deepEqual([], revealTarget.args[0][2]);
assert.equal(void 0, revealTarget.args[0][3]);
});
}
|
CRAZYCUPCAKES40/vscode
|
src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts
|
TypeScript
|
ArrowFunction
|
() => {
assert.ok(revealTarget.calledOnce);
assert.deepEqual('treeDataProvider', revealTarget.args[0][0]);
assert.deepEqual({ handle: '0/0:a', label: 'a', collapsibleState: TreeItemCollapsibleState.Collapsed }, removeUnsetKeys(revealTarget.args[0][1]));
assert.deepEqual([], revealTarget.args[0][2]);
assert.equal(void 0, revealTarget.args[0][3]);
}
|
CRAZYCUPCAKES40/vscode
|
src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts
|
TypeScript
|
ArrowFunction
|
() => {
const revealTarget = sinon.spy(target, '$reveal');
const treeView = testObject.registerTreeDataProvider('treeDataProvider', aCompleteNodeTreeDataProvider(), (fn) => fn);
return treeView.reveal({ key: 'aa' })
.then(() => {
assert.ok(revealTarget.calledOnce);
assert.deepEqual('treeDataProvider', revealTarget.args[0][0]);
assert.deepEqual({ handle: '0/0:a/0:aa', label: 'aa', collapsibleState: TreeItemCollapsibleState.None, parentHandle: '0/0:a' }, removeUnsetKeys(revealTarget.args[0][1]));
assert.deepEqual([{ handle: '0/0:a', label: 'a', collapsibleState: TreeItemCollapsibleState.Collapsed }], (<Array<any>>revealTarget.args[0][2]).map(arg => removeUnsetKeys(arg)));
assert.equal(void 0, revealTarget.args[0][3]);
});
}
|
CRAZYCUPCAKES40/vscode
|
src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts
|
TypeScript
|
ArrowFunction
|
() => {
assert.ok(revealTarget.calledOnce);
assert.deepEqual('treeDataProvider', revealTarget.args[0][0]);
assert.deepEqual({ handle: '0/0:a/0:aa', label: 'aa', collapsibleState: TreeItemCollapsibleState.None, parentHandle: '0/0:a' }, removeUnsetKeys(revealTarget.args[0][1]));
assert.deepEqual([{ handle: '0/0:a', label: 'a', collapsibleState: TreeItemCollapsibleState.Collapsed }], (<Array<any>>revealTarget.args[0][2]).map(arg => removeUnsetKeys(arg)));
assert.equal(void 0, revealTarget.args[0][3]);
}
|
CRAZYCUPCAKES40/vscode
|
src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts
|
TypeScript
|
ArrowFunction
|
arg => removeUnsetKeys(arg)
|
CRAZYCUPCAKES40/vscode
|
src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts
|
TypeScript
|
ArrowFunction
|
() => {
tree = {
'b': {
'ba': {
'bac': {}
}
}
};
const revealTarget = sinon.spy(target, '$reveal');
const treeView = testObject.registerTreeDataProvider('treeDataProvider', aCompleteNodeTreeDataProvider(), (fn) => fn);
return treeView.reveal({ key: 'bac' }, { select: false })
.then(() => {
assert.ok(revealTarget.calledOnce);
assert.deepEqual('treeDataProvider', revealTarget.args[0][0]);
assert.deepEqual({ handle: '0/0:b/0:ba/0:bac', label: 'bac', collapsibleState: TreeItemCollapsibleState.None, parentHandle: '0/0:b/0:ba' }, removeUnsetKeys(revealTarget.args[0][1]));
assert.deepEqual([
{ handle: '0/0:b', label: 'b', collapsibleState: TreeItemCollapsibleState.Collapsed },
{ handle: '0/0:b/0:ba', label: 'ba', collapsibleState: TreeItemCollapsibleState.Collapsed, parentHandle: '0/0:b' }
], (<Array<any>>revealTarget.args[0][2]).map(arg => removeUnsetKeys(arg)));
assert.deepEqual({ select: false }, revealTarget.args[0][3]);
});
}
|
CRAZYCUPCAKES40/vscode
|
src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts
|
TypeScript
|
ArrowFunction
|
() => {
assert.ok(revealTarget.calledOnce);
assert.deepEqual('treeDataProvider', revealTarget.args[0][0]);
assert.deepEqual({ handle: '0/0:b/0:ba/0:bac', label: 'bac', collapsibleState: TreeItemCollapsibleState.None, parentHandle: '0/0:b/0:ba' }, removeUnsetKeys(revealTarget.args[0][1]));
assert.deepEqual([
{ handle: '0/0:b', label: 'b', collapsibleState: TreeItemCollapsibleState.Collapsed },
{ handle: '0/0:b/0:ba', label: 'ba', collapsibleState: TreeItemCollapsibleState.Collapsed, parentHandle: '0/0:b' }
], (<Array<any>>revealTarget.args[0][2]).map(arg => removeUnsetKeys(arg)));
assert.deepEqual({ select: false }, revealTarget.args[0][3]);
}
|
CRAZYCUPCAKES40/vscode
|
src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts
|
TypeScript
|
ArrowFunction
|
(element: { key: string }): { key: string }[] => {
return getChildren(element ? element.key : undefined).map(key => getNode(key));
}
|
CRAZYCUPCAKES40/vscode
|
src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts
|
TypeScript
|
ArrowFunction
|
key => getNode(key)
|
CRAZYCUPCAKES40/vscode
|
src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts
|
TypeScript
|
ArrowFunction
|
(element: { key: string }): TreeItem => {
return getTreeItem(element.key);
}
|
CRAZYCUPCAKES40/vscode
|
src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts
|
TypeScript
|
ArrowFunction
|
({ key }: { key: string }): { key: string } => {
const parentKey = key.substring(0, key.length - 1);
return parentKey ? new Key(parentKey) : void 0;
}
|
CRAZYCUPCAKES40/vscode
|
src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts
|
TypeScript
|
ArrowFunction
|
(element: { key: string }): TreeItem => {
const treeItem = getTreeItem(element.key);
treeItem.id = element.key;
return treeItem;
}
|
CRAZYCUPCAKES40/vscode
|
src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts
|
TypeScript
|
ClassDeclaration
|
class RecordingShape extends mock<MainThreadTreeViewsShape>() {
onRefresh = new Emitter<{ [treeItemHandle: string]: ITreeItem }>();
$registerTreeViewDataProvider(treeViewId: string): void {
}
$refresh(viewId: string, itemsToRefresh?: { [treeItemHandle: string]: ITreeItem }): void {
this.onRefresh.fire(itemsToRefresh);
}
$reveal(): TPromise<void> {
return null;
}
}
|
CRAZYCUPCAKES40/vscode
|
src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts
|
TypeScript
|
ClassDeclaration
|
class Key {
constructor(readonly key: string) { }
}
|
CRAZYCUPCAKES40/vscode
|
src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts
|
TypeScript
|
MethodDeclaration
|
$registerTreeViewDataProvider(treeViewId: string): void {
}
|
CRAZYCUPCAKES40/vscode
|
src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts
|
TypeScript
|
MethodDeclaration
|
$refresh(viewId: string, itemsToRefresh?: { [treeItemHandle: string]: ITreeItem }): void {
this.onRefresh.fire(itemsToRefresh);
}
|
CRAZYCUPCAKES40/vscode
|
src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts
|
TypeScript
|
MethodDeclaration
|
$reveal(): TPromise<void> {
return null;
}
|
CRAZYCUPCAKES40/vscode
|
src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts
|
TypeScript
|
TypeAliasDeclaration
|
export type FilterType = keyof typeof FILTER_OPERATOR_MAP;
|
vbisrikkanth/easydmfollowers
|
src/types.d.ts
|
TypeScript
|
TypeAliasDeclaration
|
export type FilterCondition = {
id: string;
value: string | number | boolean;
operator: FilterType;
}
|
vbisrikkanth/easydmfollowers
|
src/types.d.ts
|
TypeScript
|
TypeAliasDeclaration
|
export type Filter = {
filterType: FilterType;
conditions: FilterCondition[];
}
|
vbisrikkanth/easydmfollowers
|
src/types.d.ts
|
TypeScript
|
TypeAliasDeclaration
|
export type PaginationOptions = {
where?: any;
order?: string[][];
limit?: number;
offset: number;
}
|
vbisrikkanth/easydmfollowers
|
src/types.d.ts
|
TypeScript
|
TypeAliasDeclaration
|
export type UserPaginationOptions = PaginationOptions & { segmentIds: number[] }
|
vbisrikkanth/easydmfollowers
|
src/types.d.ts
|
TypeScript
|
TypeAliasDeclaration
|
export type CampaignUserPaginationOptions = PaginationOptions & { id: number }
|
vbisrikkanth/easydmfollowers
|
src/types.d.ts
|
TypeScript
|
TypeAliasDeclaration
|
export type CampaignUserPaginationResult = {
rows: (UserAttributes & CampaignUserAttributes)[];
count: number;
}
|
vbisrikkanth/easydmfollowers
|
src/types.d.ts
|
TypeScript
|
TypeAliasDeclaration
|
export type PaginatedUserResult = {
rows: UserAttributes[];
count: number;
}
|
vbisrikkanth/easydmfollowers
|
src/types.d.ts
|
TypeScript
|
TypeAliasDeclaration
|
export type TwitterKeys = {
consumer_key: string,
consumer_secret: string,
access_token_key: string,
access_token_secret: string
}
|
vbisrikkanth/easydmfollowers
|
src/types.d.ts
|
TypeScript
|
TypeAliasDeclaration
|
export type CampaignUpdateAttributes = {
name?: string;
message?: string;
description?: string;
allocated_msg_count?: number;
scheduled_time?: number;
status?: number;
}
|
vbisrikkanth/easydmfollowers
|
src/types.d.ts
|
TypeScript
|
TypeAliasDeclaration
|
export type SegmentUpdateAttributes = {
name?: string;
description?: string;
filters?: Filter;
}
|
vbisrikkanth/easydmfollowers
|
src/types.d.ts
|
TypeScript
|
TypeAliasDeclaration
|
export type CampaignCreateAttribute = {
name: string;
message: string;
description: string;
allocated_msg_count: number;
scheduled_time: number;
segmentIds: number[];
order?: string[][];
}
|
vbisrikkanth/easydmfollowers
|
src/types.d.ts
|
TypeScript
|
ArrowFunction
|
tpsData => {
tpsData.autofill = tpsData.autofill || {};
if (this.kpuData) {
const data = this.kpuData[this.tpsNo];
if (data) {
const prefix = FORM_TYPE.PPWP + ';' + IS_PLANO.NO;
tpsData.autofill[`${prefix};1;kpu`] = {
[SUM_KEY.jum]: data[SUM_KEY.jum]
} as SumMap;
tpsData.autofill[`${prefix};2;kpu`] = {
[SUM_KEY.pas1]: data[SUM_KEY.pas1],
[SUM_KEY.pas2]: data[SUM_KEY.pas2],
[SUM_KEY.sah]: data[SUM_KEY.sah],
[SUM_KEY.tSah]: data[SUM_KEY.tSah]
} as SumMap;
}
}
this.tpsData = tpsData;
const img = this.tpsData.images[this.imageId];
if (img) {
this.setExistingTipe(img);
this.tps$.next(img);
this.autofill(img);
} else {
this.digitizeNextImage();
}
}
|
kawalpemilu/upload.kawalpemilu.org
|
web/src/app/approver/approver.component.ts
|
TypeScript
|
ArrowFunction
|
(a, b) => {
const x = imgs[a];
const y = imgs[b];
if (x.meta && x.meta.m && y.meta && y.meta.m) {
const p = x.meta.m[0];
const q = y.meta.m[0];
return p < q ? -1 : p > q ? 1 : 0;
}
return x.uploader.ts - y.uploader.ts;
}
|
kawalpemilu/upload.kawalpemilu.org
|
web/src/app/approver/approver.component.ts
|
TypeScript
|
ArrowFunction
|
() => {
this.hie.update(this.initialKelId).then(() => {
setTimeout(() => {
this.imageId = '';
this.imageIdChange.emit('');
this.completed.next();
}, 100);
});
}
|
kawalpemilu/upload.kawalpemilu.org
|
web/src/app/approver/approver.component.ts
|
TypeScript
|
ArrowFunction
|
() => {
setTimeout(() => {
this.imageId = '';
this.imageIdChange.emit('');
this.completed.next();
}, 100);
}
|
kawalpemilu/upload.kawalpemilu.org
|
web/src/app/approver/approver.component.ts
|
TypeScript
|
ArrowFunction
|
() => {
this.imageId = '';
this.imageIdChange.emit('');
this.completed.next();
}
|
kawalpemilu/upload.kawalpemilu.org
|
web/src/app/approver/approver.component.ts
|
TypeScript
|
ArrowFunction
|
(v: number[]) => {
this.formGroup.get(SUM_KEY[SUM_KEY.sah]).setValue(v[0] + v[1]);
}
|
kawalpemilu/upload.kawalpemilu.org
|
web/src/app/approver/approver.component.ts
|
TypeScript
|
ArrowFunction
|
() => {
const inp: HTMLInputElement = document.querySelector('form input');
if (inp) {
inp.focus();
}
}
|
kawalpemilu/upload.kawalpemilu.org
|
web/src/app/approver/approver.component.ts
|
TypeScript
|
ArrowFunction
|
(a, b) => this.toInt(a) - this.toInt(b)
|
kawalpemilu/upload.kawalpemilu.org
|
web/src/app/approver/approver.component.ts
|
TypeScript
|
ArrowFunction
|
() => {
const els = document.getElementsByClassName('searchwilayah');
if (els.length > 0) {
(els[0] as HTMLInputElement).focus();
}
}
|
kawalpemilu/upload.kawalpemilu.org
|
web/src/app/approver/approver.component.ts
|
TypeScript
|
ArrowFunction
|
node => {
this.kelName = node.name;
this.isChangeKel = false;
}
|
kawalpemilu/upload.kawalpemilu.org
|
web/src/app/approver/approver.component.ts
|
TypeScript
|
MethodDeclaration
|
async ngOnInit() {
this.initialKelId = this.kelId;
this.initialTpsNo = this.tpsNo;
this.kpuData = await this.fsdb
.doc<KpuData>(FsPath.kpu(this.kelId))
.valueChanges()
.pipe(
this.perf.trace('kpuData'),
take(1)
)
.toPromise();
this.fsdb
.doc<TpsData>(FsPath.tps(this.kelId, this.tpsNo))
.valueChanges()
.pipe(take(1))
.toPromise()
.then(tpsData => {
tpsData.autofill = tpsData.autofill || {};
if (this.kpuData) {
const data = this.kpuData[this.tpsNo];
if (data) {
const prefix = FORM_TYPE.PPWP + ';' + IS_PLANO.NO;
tpsData.autofill[`${prefix};1;kpu`] = {
[SUM_KEY.jum]: data[SUM_KEY.jum]
} as SumMap;
tpsData.autofill[`${prefix};2;kpu`] = {
[SUM_KEY.pas1]: data[SUM_KEY.pas1],
[SUM_KEY.pas2]: data[SUM_KEY.pas2],
[SUM_KEY.sah]: data[SUM_KEY.sah],
[SUM_KEY.tSah]: data[SUM_KEY.tSah]
} as SumMap;
}
}
this.tpsData = tpsData;
const img = this.tpsData.images[this.imageId];
if (img) {
this.setExistingTipe(img);
this.tps$.next(img);
this.autofill(img);
} else {
this.digitizeNextImage();
}
});
}
|
kawalpemilu/upload.kawalpemilu.org
|
web/src/app/approver/approver.component.ts
|
TypeScript
|
MethodDeclaration
|
setExistingTipe(i: TpsImage) {
if (i.c1 && i.c1.type && i.c1.plano && i.c1.halaman) {
// @ts-ignore
const tipe = (i.tipe =
i.c1.type + ';' + i.c1.plano + ';' + i.c1.halaman + ';ex');
this.tpsData.autofill[tipe] = i.sum;
}
}
|
kawalpemilu/upload.kawalpemilu.org
|
web/src/app/approver/approver.component.ts
|
TypeScript
|
MethodDeclaration
|
autofill(i: TpsImage) {
// @ts-ignore
const tipe = i.tipe;
if (tipe) {
const t = tipe.split(';');
this.setFormType(+t[0]);
this.setIsPlano(+t[1]);
this.setHalaman(t[2]);
if (this.tpsData.autofill) {
const sum = this.tpsData.autofill[tipe];
if (sum) {
for (const key of Object.keys(sum)) {
if (!(key in SUM_KEY)) {
delete sum[key];
}
}
this.formGroup.setValue(sum);
}
}
}
}
|
kawalpemilu/upload.kawalpemilu.org
|
web/src/app/approver/approver.component.ts
|
TypeScript
|
MethodDeclaration
|
digitizeNextImage() {
this.kelId = this.initialKelId;
this.tpsNo = this.initialTpsNo;
this.imageId = '';
this.imageIdChange.emit('');
this.formType = null;
this.isPlano = null;
this.halaman = null;
this.formGroup = null;
this.approveStatus = 'pending';
this.tryUnsubscribe();
let next: TpsImage = null;
const imgs = this.tpsData.images;
let lembar = 1;
for (const id of Object.keys(imgs).sort((a, b) => {
const x = imgs[a];
const y = imgs[b];
if (x.meta && x.meta.m && y.meta && y.meta.m) {
const p = x.meta.m[0];
const q = y.meta.m[0];
return p < q ? -1 : p > q ? 1 : 0;
}
return x.uploader.ts - y.uploader.ts;
})) {
const i = imgs[id];
if (i.uploader.uid === KPU_SCAN_UID) {
// @ts-ignore
i.tipe = FORM_TYPE.PPWP + ';' + IS_PLANO.NO + ';' + lembar + ';kpu';
lembar = 2;
}
this.setExistingTipe(i);
}
for (const id of Object.keys(imgs)) {
const img = imgs[id];
if (!img.c1 && (!this.imageId || next.uploader.ts > img.uploader.ts)) {
this.imageId = id;
next = img;
}
}
this.tps$.next(next);
if (this.imageId) {
this.imageIdChange.emit(this.imageId);
this.autofill(next);
} else {
this.imageId = 'done';
this.imageIdChange.emit('done');
setTimeout(() => {
this.hie.update(this.initialKelId).then(() => {
setTimeout(() => {
this.imageId = '';
this.imageIdChange.emit('');
this.completed.next();
}, 100);
});
}, 1000);
}
}
|
kawalpemilu/upload.kawalpemilu.org
|
web/src/app/approver/approver.component.ts
|
TypeScript
|
MethodDeclaration
|
ngOnDestroy() {
this.tryUnsubscribe();
}
|
kawalpemilu/upload.kawalpemilu.org
|
web/src/app/approver/approver.component.ts
|
TypeScript
|
MethodDeclaration
|
trySubscribe() {
this.tryUnsubscribe();
const p1 = this.formGroup.get(SUM_KEY[SUM_KEY.pas1]);
const p2 = this.formGroup.get(SUM_KEY[SUM_KEY.pas2]);
if (!p1 || !p2) {
return;
}
this.autoSumSub = combineLatest([
p1.valueChanges.pipe(
startWith(0),
distinctUntilChanged()
),
p2.valueChanges.pipe(
startWith(0),
distinctUntilChanged()
)
]).subscribe((v: number[]) => {
this.formGroup.get(SUM_KEY[SUM_KEY.sah]).setValue(v[0] + v[1]);
});
}
|
kawalpemilu/upload.kawalpemilu.org
|
web/src/app/approver/approver.component.ts
|
TypeScript
|
MethodDeclaration
|
tryUnsubscribe() {
if (this.autoSumSub) {
this.autoSumSub.unsubscribe();
this.autoSumSub = null;
}
}
|
kawalpemilu/upload.kawalpemilu.org
|
web/src/app/approver/approver.component.ts
|
TypeScript
|
MethodDeclaration
|
async approve() {
const perf = firebase.performance();
const trace = perf.trace('approve');
trace.start();
this.isLoading = true;
const sum = {} as SumMap;
if (this.formGroup) {
this.formGroup.disable();
for (const key of LEMBAR[this.formType][this.isPlano][this.halaman]) {
sum[key] = this.formGroup.get(key).value;
}
}
try {
const user = this.userService.user;
const body: ApproveRequest = {
kelId: this.kelId,
kelName: '',
tpsNo: this.tpsNo,
sum,
imageId: this.imageId,
c1: {
type: this.formType,
plano: this.isPlano,
halaman: this.halaman || '0'
}
};
const res: any = await this.api.post(user, `approve`, body);
if (res.ok) {
console.log('ok');
this.approveStatus = 'approved';
this.tpsData.images[this.imageId].c1 = body.c1;
setTimeout(this.digitizeNextImage.bind(this), 1000);
} else {
console.error(res);
alert(JSON.stringify(res));
}
} catch (e) {
console.error(e.message);
alert(JSON.stringify(e.message));
}
if (this.formGroup) {
this.formGroup.enable();
}
this.isLoading = false;
trace.stop();
}
|
kawalpemilu/upload.kawalpemilu.org
|
web/src/app/approver/approver.component.ts
|
TypeScript
|
MethodDeclaration
|
skipDulu() {
this.tpsData.images[this.imageId].c1 = {} as C1Form;
this.digitizeNextImage();
}
|
kawalpemilu/upload.kawalpemilu.org
|
web/src/app/approver/approver.component.ts
|
TypeScript
|
MethodDeclaration
|
setFormType(type: FORM_TYPE) {
this.formType = +type;
this.approveStatus =
this.formType === FORM_TYPE.OTHERS ||
this.formType === FORM_TYPE.PEMANDANGAN ||
this.formType === FORM_TYPE.MALICIOUS
? 'ready'
: 'pending';
this.isPlano = null;
this.halaman = null;
this.formGroup = null;
this.tryUnsubscribe();
}
|
kawalpemilu/upload.kawalpemilu.org
|
web/src/app/approver/approver.component.ts
|
TypeScript
|
MethodDeclaration
|
setIsPlano(plano: IS_PLANO) {
this.approveStatus = 'pending';
this.isPlano = plano;
this.halaman = null;
this.formGroup = null;
this.tryUnsubscribe();
}
|
kawalpemilu/upload.kawalpemilu.org
|
web/src/app/approver/approver.component.ts
|
TypeScript
|
MethodDeclaration
|
setHalaman(hal: Halaman) {
this.halaman = hal;
if (!this.getLembar()) {
this.approveStatus = 'ready';
return;
}
const group = {};
for (const key of this.getLembar()) {
group[key] = [null, this.VALIDATORS];
}
this.formGroup = this.formBuilder.group(group);
this.trySubscribe();
setTimeout(() => {
const inp: HTMLInputElement = document.querySelector('form input');
if (inp) {
inp.focus();
}
}, 100);
}
|
kawalpemilu/upload.kawalpemilu.org
|
web/src/app/approver/approver.component.ts
|
TypeScript
|
MethodDeclaration
|
getLembar() {
return LEMBAR[this.formType][this.isPlano][this.halaman];
}
|
kawalpemilu/upload.kawalpemilu.org
|
web/src/app/approver/approver.component.ts
|
TypeScript
|
MethodDeclaration
|
getHalaman() {
const lembar = LEMBAR[this.formType][this.isPlano];
return Object.keys(lembar).sort((a, b) => this.toInt(a) - this.toInt(b));
}
|
kawalpemilu/upload.kawalpemilu.org
|
web/src/app/approver/approver.component.ts
|
TypeScript
|
MethodDeclaration
|
toInt(s) {
const i = s.indexOf('.');
if (i === -1) {
return +s * 100;
}
return +s.substring(0, i) * 100 + +s.substring(i + 1);
}
|
kawalpemilu/upload.kawalpemilu.org
|
web/src/app/approver/approver.component.ts
|
TypeScript
|
MethodDeclaration
|
getError(ctrlName: string) {
return this.formGroup.get(ctrlName).hasError('pattern')
? 'Rentang angka 0..999'
: '';
}
|
kawalpemilu/upload.kawalpemilu.org
|
web/src/app/approver/approver.component.ts
|
TypeScript
|
MethodDeclaration
|
changeKel() {
this.isChangeKel = true;
setTimeout(() => {
const els = document.getElementsByClassName('searchwilayah');
if (els.length > 0) {
(els[0] as HTMLInputElement).focus();
}
}, 100);
}
|
kawalpemilu/upload.kawalpemilu.org
|
web/src/app/approver/approver.component.ts
|
TypeScript
|
MethodDeclaration
|
changeKelId(state: HierarchyNode) {
this.kelId = state.id;
this.hie
.get$(this.kelId)
.pipe(take(1))
.toPromise()
.then(node => {
this.kelName = node.name;
this.isChangeKel = false;
});
}
|
kawalpemilu/upload.kawalpemilu.org
|
web/src/app/approver/approver.component.ts
|
TypeScript
|
ArrowFunction
|
response => {
appSettings.setBoolean("isLoggedIn", true);
appSettings.setString("account",JSON.stringify(this.user))
appSettings.setString("username",this.user.username)
this.processing = false;
this.routerExtensions.navigateByUrl("main", {clearHistory: true});
}
|
AStA-HTWG-Konstanz/app
|
src/app/signin/signin.component.ts
|
TypeScript
|
ArrowFunction
|
error => {
this.error = true;
this.processing = false;
}
|
AStA-HTWG-Konstanz/app
|
src/app/signin/signin.component.ts
|
TypeScript
|
ClassDeclaration
|
@Component({
selector: 'ns-signin',
templateUrl: './signin.component.html',
styleUrls: ['./signin.component.css'],
moduleId: module.id,
})
export class SigninComponent implements OnInit {
user: User;
processing: boolean = false;
error: boolean = false;
constructor(
private loginservice: LoginService,
private routerExtensions: RouterExtensions,
private page: Page
) { }
ngOnInit() {
this.page.actionBarHidden = true;
this.user = new User("","");
}
onDrawerButtonTap(): void {
const sideDrawer = <RadSideDrawer>app.getRootView();
sideDrawer.showDrawer();
}
login() {
this.processing = true;
this.error = false;
this.loginservice.login(this.user).subscribe(
response => {
appSettings.setBoolean("isLoggedIn", true);
appSettings.setString("account",JSON.stringify(this.user))
appSettings.setString("username",this.user.username)
this.processing = false;
this.routerExtensions.navigateByUrl("main", {clearHistory: true});
},
error => {
this.error = true;
this.processing = false;
}
)
}
onNameChange(args: any) {
let textField = <TextField>args.object;
this.user.username = textField.text;
}
onPasswordChange(args: any) {
let textField = <TextField>args.object;
this.user.password = textField.text;
}
}
|
AStA-HTWG-Konstanz/app
|
src/app/signin/signin.component.ts
|
TypeScript
|
MethodDeclaration
|
ngOnInit() {
this.page.actionBarHidden = true;
this.user = new User("","");
}
|
AStA-HTWG-Konstanz/app
|
src/app/signin/signin.component.ts
|
TypeScript
|
MethodDeclaration
|
onDrawerButtonTap(): void {
const sideDrawer = <RadSideDrawer>app.getRootView();
sideDrawer.showDrawer();
}
|
AStA-HTWG-Konstanz/app
|
src/app/signin/signin.component.ts
|
TypeScript
|
MethodDeclaration
|
login() {
this.processing = true;
this.error = false;
this.loginservice.login(this.user).subscribe(
response => {
appSettings.setBoolean("isLoggedIn", true);
appSettings.setString("account",JSON.stringify(this.user))
appSettings.setString("username",this.user.username)
this.processing = false;
this.routerExtensions.navigateByUrl("main", {clearHistory: true});
},
error => {
this.error = true;
this.processing = false;
}
)
}
|
AStA-HTWG-Konstanz/app
|
src/app/signin/signin.component.ts
|
TypeScript
|
MethodDeclaration
|
onNameChange(args: any) {
let textField = <TextField>args.object;
this.user.username = textField.text;
}
|
AStA-HTWG-Konstanz/app
|
src/app/signin/signin.component.ts
|
TypeScript
|
MethodDeclaration
|
onPasswordChange(args: any) {
let textField = <TextField>args.object;
this.user.password = textField.text;
}
|
AStA-HTWG-Konstanz/app
|
src/app/signin/signin.component.ts
|
TypeScript
|
ClassDeclaration
|
export declare class SplitPane implements ComponentInterface {
private rmL;
el: HTMLElement;
visible: boolean;
/**
* The `id` of the main content. When using
* a router this is typically `ion-router-outlet`.
* When not using a router, this is typically
* your main view's `ion-content`. This is not the
* id of the `ion-content` inside of your `ion-menu`.
*/
contentId?: string;
/**
* If `true`, the split pane will be hidden.
*/
disabled: boolean;
/**
* When the split-pane should be shown.
* Can be a CSS media query expression, or a shortcut expression.
* Can also be a boolean expression.
*/
when: string | boolean;
/**
* Expression to be called when the split-pane visibility has changed
*/
ionSplitPaneVisible: EventEmitter<{
visible: boolean;
}>;
visibleChanged(visible: boolean): void;
connectedCallback(): void;
disconnectedCallback(): void;
protected updateState(): void;
private isPane;
private styleChildren;
render(): any;
}
|
Lassaadaissa/DS_Ionic
|
node_modules/@ionic/core/dist/types/components/split-pane/split-pane.d.ts
|
TypeScript
|
MethodDeclaration
|
visibleChanged(visible: boolean): void;
|
Lassaadaissa/DS_Ionic
|
node_modules/@ionic/core/dist/types/components/split-pane/split-pane.d.ts
|
TypeScript
|
MethodDeclaration
|
connectedCallback(): void;
|
Lassaadaissa/DS_Ionic
|
node_modules/@ionic/core/dist/types/components/split-pane/split-pane.d.ts
|
TypeScript
|
MethodDeclaration
|
disconnectedCallback(): void;
|
Lassaadaissa/DS_Ionic
|
node_modules/@ionic/core/dist/types/components/split-pane/split-pane.d.ts
|
TypeScript
|
MethodDeclaration
|
protected updateState(): void;
|
Lassaadaissa/DS_Ionic
|
node_modules/@ionic/core/dist/types/components/split-pane/split-pane.d.ts
|
TypeScript
|
MethodDeclaration
|
render(): any;
|
Lassaadaissa/DS_Ionic
|
node_modules/@ionic/core/dist/types/components/split-pane/split-pane.d.ts
|
TypeScript
|
ArrowFunction
|
() => {
return (<span>加载中...</span>)
}
|
john2300/sourcecode-learn
|
ts-wp/src/web/components/loading/index.tsx
|
TypeScript
|
ArrowFunction
|
blue_applications => {
this.dataModel.DEVICE_CPU_CORES = blue_applications['value'].map(blue_applications => blue_applications.DEVICE_CPU_CORES);
this.dataModel.AGENT_VERSION = blue_applications['value'].map(blue_applications => blue_applications.AGENT_VERSION);
console.log(this.dataModel.DEVICE_CPU_CORES);
this.doughnutChartData = this.dataModel.DEVICE_CPU_CORES;
}
|
AternityAbsa/aternity_absa
|
.history/src/app/layout/charts/charts.component_20180416123932.ts
|
TypeScript
|
ArrowFunction
|
blue_applications => blue_applications.DEVICE_CPU_CORES
|
AternityAbsa/aternity_absa
|
.history/src/app/layout/charts/charts.component_20180416123932.ts
|
TypeScript
|
ArrowFunction
|
blue_applications => blue_applications.AGENT_VERSION
|
AternityAbsa/aternity_absa
|
.history/src/app/layout/charts/charts.component_20180416123932.ts
|
TypeScript
|
ArrowFunction
|
err => {
console.log(err);
}
|
AternityAbsa/aternity_absa
|
.history/src/app/layout/charts/charts.component_20180416123932.ts
|
TypeScript
|
ArrowFunction
|
blue_applications => {
this.dataModel.UXI = blue_applications['value'].map(blue_applications => blue_applications.UXI);
this.dataModel.UXI_WEIGHT = blue_applications['value'].map(blue_applications => blue_applications.UXI_WEIGHT);
this.dataModel.CRASHES = blue_applications['value'].map(blue_applications => blue_applications.CRASHES);
this.dataModel.PERFORMANCE_INDEX = blue_applications['value'].map(blue_applications => blue_applications.PERFORMANCE_INDEX);
this.dataModel.ACTIVITY_VOLUME = blue_applications['value'].map(blue_applications => blue_applications.ACTIVITY_VOLUME);
this.dataModel.HANG_TIME = blue_applications['value'].map(blue_applications => blue_applications.HANG_TIME);
this.radar_uxi = this.dataModel.UXI;
this.radar_crashes = this.dataModel.PERFORMANCE_INDEX;
console.log(this.dataModel.UXI);
/* this.radarChartData = [ 40, 70, 30, 90, 98, 89, 99];**/
/* { data: this.dataModel.UXI, label: 'UXI' },
{ data: this.dataModel.PERFORMANCE_INDEX, label: 'CRASHES' } **/
}
|
AternityAbsa/aternity_absa
|
.history/src/app/layout/charts/charts.component_20180416123932.ts
|
TypeScript
|
ArrowFunction
|
blue_applications => blue_applications.UXI
|
AternityAbsa/aternity_absa
|
.history/src/app/layout/charts/charts.component_20180416123932.ts
|
TypeScript
|
ArrowFunction
|
blue_applications => blue_applications.UXI_WEIGHT
|
AternityAbsa/aternity_absa
|
.history/src/app/layout/charts/charts.component_20180416123932.ts
|
TypeScript
|
ArrowFunction
|
blue_applications => blue_applications.CRASHES
|
AternityAbsa/aternity_absa
|
.history/src/app/layout/charts/charts.component_20180416123932.ts
|
TypeScript
|
ArrowFunction
|
blue_applications => blue_applications.PERFORMANCE_INDEX
|
AternityAbsa/aternity_absa
|
.history/src/app/layout/charts/charts.component_20180416123932.ts
|
TypeScript
|
ArrowFunction
|
blue_applications => blue_applications.ACTIVITY_VOLUME
|
AternityAbsa/aternity_absa
|
.history/src/app/layout/charts/charts.component_20180416123932.ts
|
TypeScript
|
ArrowFunction
|
blue_applications => blue_applications.HANG_TIME
|
AternityAbsa/aternity_absa
|
.history/src/app/layout/charts/charts.component_20180416123932.ts
|
TypeScript
|
MethodDeclaration
|
ngOnInit(){
/** refresh every 5 seconds
this.interval = setInterval(() => {
this.loadBarChart();
}, 1000); **/
/* this.interval = setInterval(() => {
this.loadDoughnut();
}, 1000);
this.interval = setInterval(() => {
this.loadRadar();
}, 2000); **/
/*this.loadBarChart(); **/
/*this.loadDoughnut(); **/
this.loadRadar();
}
|
AternityAbsa/aternity_absa
|
.history/src/app/layout/charts/charts.component_20180416123932.ts
|
TypeScript
|
MethodDeclaration
|
loadDoughnut(){
this.blueprismService.deviceInventoryData().subscribe(
blue_applications => {
this.dataModel.DEVICE_CPU_CORES = blue_applications['value'].map(blue_applications => blue_applications.DEVICE_CPU_CORES);
this.dataModel.AGENT_VERSION = blue_applications['value'].map(blue_applications => blue_applications.AGENT_VERSION);
console.log(this.dataModel.DEVICE_CPU_CORES);
this.doughnutChartData = this.dataModel.DEVICE_CPU_CORES;
},
err => {
console.log(err);
}
);
}
|
AternityAbsa/aternity_absa
|
.history/src/app/layout/charts/charts.component_20180416123932.ts
|
TypeScript
|
MethodDeclaration
|
loadRadar(){
this.blueprismService.applicationRawData().subscribe(
blue_applications => {
this.dataModel.UXI = blue_applications['value'].map(blue_applications => blue_applications.UXI);
this.dataModel.UXI_WEIGHT = blue_applications['value'].map(blue_applications => blue_applications.UXI_WEIGHT);
this.dataModel.CRASHES = blue_applications['value'].map(blue_applications => blue_applications.CRASHES);
this.dataModel.PERFORMANCE_INDEX = blue_applications['value'].map(blue_applications => blue_applications.PERFORMANCE_INDEX);
this.dataModel.ACTIVITY_VOLUME = blue_applications['value'].map(blue_applications => blue_applications.ACTIVITY_VOLUME);
this.dataModel.HANG_TIME = blue_applications['value'].map(blue_applications => blue_applications.HANG_TIME);
this.radar_uxi = this.dataModel.UXI;
this.radar_crashes = this.dataModel.PERFORMANCE_INDEX;
console.log(this.dataModel.UXI);
/* this.radarChartData = [ 40, 70, 30, 90, 98, 89, 99];**/
/* { data: this.dataModel.UXI, label: 'UXI' },
{ data: this.dataModel.PERFORMANCE_INDEX, label: 'CRASHES' } **/
},
err => {
console.log(err);
}
);
}
|
AternityAbsa/aternity_absa
|
.history/src/app/layout/charts/charts.component_20180416123932.ts
|
TypeScript
|
MethodDeclaration
|
// events
private chartClicked(e: any): void {
if (e.active.length === 0) {
return;
}
let label = e.active[0]._model.label;
this.currentNode = this.currentNode || this.allTheData;
this.currentNode = this.currentNode.drilldown[label];
this.barChartLabels = this.currentNode.labels;
}
|
AternityAbsa/aternity_absa
|
.history/src/app/layout/charts/charts.component_20180416123932.ts
|
TypeScript
|
MethodDeclaration
|
private chartHovered(e: any): void {
/** console.log(e); */
}
|
AternityAbsa/aternity_absa
|
.history/src/app/layout/charts/charts.component_20180416123932.ts
|
TypeScript
|
MethodDeclaration
|
/*private updateData(event: any){
const data1 = [20, 50, 90];
const clone = JSON.parse(JSON.stringify(this.barChartData));
clone[0].data = data1;
this.barChartData = clone; **/
/* this.selectedValue = event.target.value;
if (this.selectedValue !== null){
const data1 = this.dataModel.CPU_UTILIZATION_AVG;
const clone = JSON.parse(JSON.stringify(this.barChartData));
clone[0].data = data1;
this.barChartData = clone;
console.log(data1);
}
} **/
private randomize(): void {
// Only Change1 3 values
const data = [
Math.round(Math.random() * 100),
59,
80,
Math.random() * 100,
56,
Math.random() * 100,
40
];
const clone = JSON.parse(JSON.stringify(this.barChartData));
clone[0].data = data;
this.barChartData = clone;
/**
* (My guess), for Angular to recognize the change in the dataset
* it has to change the dataset variable directly,
* so one way around it, is to clone the data, change it and then
* assign it;
*/
}
|
AternityAbsa/aternity_absa
|
.history/src/app/layout/charts/charts.component_20180416123932.ts
|
TypeScript
|
ArrowFunction
|
() => {
it('defaults to no detectors', async () => {
const deviceSupport = new DeviceSupport();
assert.deepEqual(await deviceSupport.detect(), {});
});
it('supports adding detectors', async () => {
const deviceSupport = new DeviceSupport();
deviceSupport.addDetector({name: 'foo', supported: async () => true});
const support = await deviceSupport.detect();
assert.deepEqual(support, { foo: true });
});
it('supports removing detectors', async () => {
const deviceSupport = new DeviceSupport();
deviceSupport.addDetector({name: 'foo', supported: async () => true});
deviceSupport.removeDetector('foo');
const support = await deviceSupport.detect();
assert.deepEqual(support, {});
});
it('throws if detector already exists', () => {
const deviceSupport = new DeviceSupport();
deviceSupport.addDetector({name: 'foo', supported: async () => true});
assert.throws(() => deviceSupport.addDetector({
name: 'foo',
supported: async () => false
}), 'foo already added');
});
it('emits an event', (done) => {
const deviceSupport = new DeviceSupport();
deviceSupport.useEvents = true;
deviceSupport.addDetector({name: 'foo', supported: async () => true});
window.addEventListener(DeviceSupport.supportsEvent, (evt) => {
const supportEvt = evt as CustomEvent<Support>;
assert.deepEqual(supportEvt.detail, { foo: true });
done();
});
deviceSupport.detect();
});
}
|
GoogleChromeLabs/perception-toolk
|
src/support/device-support_test.ts
|
TypeScript
|
ArrowFunction
|
async () => {
const deviceSupport = new DeviceSupport();
assert.deepEqual(await deviceSupport.detect(), {});
}
|
GoogleChromeLabs/perception-toolk
|
src/support/device-support_test.ts
|
TypeScript
|
ArrowFunction
|
async () => {
const deviceSupport = new DeviceSupport();
deviceSupport.addDetector({name: 'foo', supported: async () => true});
const support = await deviceSupport.detect();
assert.deepEqual(support, { foo: true });
}
|
GoogleChromeLabs/perception-toolk
|
src/support/device-support_test.ts
|
TypeScript
|
ArrowFunction
|
async () => true
|
GoogleChromeLabs/perception-toolk
|
src/support/device-support_test.ts
|
TypeScript
|
ArrowFunction
|
async () => {
const deviceSupport = new DeviceSupport();
deviceSupport.addDetector({name: 'foo', supported: async () => true});
deviceSupport.removeDetector('foo');
const support = await deviceSupport.detect();
assert.deepEqual(support, {});
}
|
GoogleChromeLabs/perception-toolk
|
src/support/device-support_test.ts
|
TypeScript
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.