type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
MethodDeclaration |
findByStatus(status: string) {
return this.emailList.filter((email) => email.status == status);
} | tharkana/node-email-api | src/model/emailModel.ts | TypeScript |
MethodDeclaration |
update(data: Email) {
if (data && data.uid) {
const email = this.findOne(data.uid);
if (email) {
const index = this.emailList.indexOf(email);
this.emailList[index].body = data.body || email.body;
this.emailList[index].to = data.to || email... | tharkana/node-email-api | src/model/emailModel.ts | TypeScript |
MethodDeclaration |
delete(id: string) {
const email = this.findOne(id);
if (email) {
const index = this.emailList.indexOf(email);
this.emailList.splice(index, 1);
return email;
} else {
return undefined;
}
} | tharkana/node-email-api | src/model/emailModel.ts | TypeScript |
ArrowFunction |
() => {
const form = attach(createForm())
const field = attach(
form.createVoidField({
name: 'void',
})
)
field.destroy()
} | 10088/formily | packages/core/src/__tests__/void.spec.ts | TypeScript |
ArrowFunction |
() => {
const form = attach(createForm())
const field1 = attach(
form.createVoidField({
name: 'field1',
title: 'Field 1',
description: 'This is Field 1',
})
)
expect(field1.title).toEqual('Field 1')
expect(field1.description).toEqual('This is Field 1')
const field2 = attach(
f... | 10088/formily | packages/core/src/__tests__/void.spec.ts | TypeScript |
ArrowFunction |
() => {
const form = attach(createForm())
const field = attach(
form.createVoidField({
name: 'aa',
})
)
const component = () => null
field.setComponent(component, { props: 123 })
expect(field.component[0]).toEqual(component)
expect(field.component[1]).toEqual({ props: 123 })
field.setComp... | 10088/formily | packages/core/src/__tests__/void.spec.ts | TypeScript |
ArrowFunction |
() => {
const form = attach(createForm())
const aa = attach(
form.createVoidField({
name: 'aa',
})
)
aa.setTitle('AAA')
aa.setDescription('This is AAA')
expect(aa.title).toEqual('AAA')
expect(aa.description).toEqual('This is AAA')
} | 10088/formily | packages/core/src/__tests__/void.spec.ts | TypeScript |
ArrowFunction |
() => {
const component = () => null
const form = attach(createForm())
const field = attach(
form.createVoidField({
name: 'aa',
})
)
field.setComponent(undefined, { props: 123 })
field.setComponent(component)
expect(field.component[0]).toEqual(component)
expect(field.component[1]).toEqua... | 10088/formily | packages/core/src/__tests__/void.spec.ts | TypeScript |
ArrowFunction |
() => {
const component = () => null
const form = attach(createForm())
const field = attach(
form.createVoidField({
name: 'aa',
})
)
field.setDecorator(undefined, { props: 123 })
field.setDecorator(component)
expect(field.decorator[0]).toEqual(component)
expect(field.decorator[1]).toEqual... | 10088/formily | packages/core/src/__tests__/void.spec.ts | TypeScript |
ArrowFunction |
() => {
const form = attach(createForm())
const aa = attach(
form.createVoidField({
name: 'aa',
})
)
const state = aa.getState()
aa.setState((state) => {
state.title = 'AAA'
})
expect(aa.title).toEqual('AAA')
aa.setState(state)
expect(aa.title).toBeUndefined()
aa.setState((state) ... | 10088/formily | packages/core/src/__tests__/void.spec.ts | TypeScript |
ArrowFunction |
(state) => {
state.title = 'AAA'
} | 10088/formily | packages/core/src/__tests__/void.spec.ts | TypeScript |
ArrowFunction |
(state) => {
state.hidden = false
} | 10088/formily | packages/core/src/__tests__/void.spec.ts | TypeScript |
ArrowFunction |
(state) => {
state.visible = true
} | 10088/formily | packages/core/src/__tests__/void.spec.ts | TypeScript |
ArrowFunction |
(state) => {
state.readOnly = false
} | 10088/formily | packages/core/src/__tests__/void.spec.ts | TypeScript |
ArrowFunction |
(state) => {
state.disabled = false
} | 10088/formily | packages/core/src/__tests__/void.spec.ts | TypeScript |
ArrowFunction |
(state) => {
state.editable = true
} | 10088/formily | packages/core/src/__tests__/void.spec.ts | TypeScript |
ArrowFunction |
(state) => {
state.editable = false
} | 10088/formily | packages/core/src/__tests__/void.spec.ts | TypeScript |
ArrowFunction |
(state) => {
state.readPretty = true
} | 10088/formily | packages/core/src/__tests__/void.spec.ts | TypeScript |
ArrowFunction |
(state) => {
state.readPretty = false
} | 10088/formily | packages/core/src/__tests__/void.spec.ts | TypeScript |
ArrowFunction |
() => {
const form = attach(createForm())
attach(
form.createObjectField({
name: 'object',
})
)
const void_ = attach(
form.createVoidField({
name: 'void',
basePath: 'object',
})
)
const void2_ = attach(
form.createVoidField({
name: 'void',
basePath: 'object... | 10088/formily | packages/core/src/__tests__/void.spec.ts | TypeScript |
ArrowFunction |
async () => {
const form = attach(createForm())
const aa = attach(
form.createField({
name: 'aa',
})
)
const bb = attach(
form.createVoidField({
name: 'bb',
reactions: [
(field) => {
const aa = field.query('aa')
if (aa.get('value') === '123') {
... | 10088/formily | packages/core/src/__tests__/void.spec.ts | TypeScript |
ArrowFunction |
(field) => {
const aa = field.query('aa')
if (aa.get('value') === '123') {
field.visible = false
} else {
field.visible = true
}
if (aa.get('inputValue') === '333') {
field.editable = false
} else if (aa.get('inputValue') =... | 10088/formily | packages/core/src/__tests__/void.spec.ts | TypeScript |
ArrowFunction |
() => {
const form = attach(createForm())
form.setDisplay(null)
form.setPattern(null)
const field = attach(
form.createVoidField({
name: 'xxx',
})
)
expect(field.display).toEqual('visible')
expect(field.pattern).toEqual('editable')
} | 10088/formily | packages/core/src/__tests__/void.spec.ts | TypeScript |
ArrowFunction |
(button) => {
button.setButtonText("Add Command")
.onClick(() => {
new CommandSuggester(this.plugin, this).open();
});
} | claremacrae/obsidian-customizable-menu | src/ui/settingsTab.ts | TypeScript |
ArrowFunction |
() => {
new CommandSuggester(this.plugin, this).open();
} | claremacrae/obsidian-customizable-menu | src/ui/settingsTab.ts | TypeScript |
ArrowFunction |
command => {
const iconDiv = createDiv({ cls: "custom-menu-settings-icon" });
setIcon(iconDiv, command.icon, 20);
const setting = new Setting(containerEl)
.setName(command.name)
.addExtraButton(button => {
button.setIcon("trash")
... | claremacrae/obsidian-customizable-menu | src/ui/settingsTab.ts | TypeScript |
ArrowFunction |
button => {
button.setIcon("trash")
.setTooltip("Remove command")
.onClick(async () => {
this.plugin.settings.menuCommands.remove(command);
await this.plugin.saveSettings();
... | claremacrae/obsidian-customizable-menu | src/ui/settingsTab.ts | TypeScript |
ArrowFunction |
async () => {
this.plugin.settings.menuCommands.remove(command);
await this.plugin.saveSettings();
this.display();
new Notice("You will need to restart Obsidian for the command to disappear.")
... | claremacrae/obsidian-customizable-menu | src/ui/settingsTab.ts | TypeScript |
ArrowFunction |
button => {
button.setIcon("gear")
.setTooltip("Edit icon")
.onClick(() => {
new IconPicker(new CommandSuggester(this.plugin, this), command, true).open(); //rewrite icon picker so it isn't taking a command suggester
... | claremacrae/obsidian-customizable-menu | src/ui/settingsTab.ts | TypeScript |
ArrowFunction |
() => {
new IconPicker(new CommandSuggester(this.plugin, this), command, true).open(); //rewrite icon picker so it isn't taking a command suggester
} | claremacrae/obsidian-customizable-menu | src/ui/settingsTab.ts | TypeScript |
ClassDeclaration |
export default class CustomMenuSettingsTab extends PluginSettingTab {
plugin: CustomMenuPlugin;
constructor(app: App, plugin: CustomMenuPlugin) {
super(app, plugin);
this.plugin = plugin;
}
display(): void {
let { containerEl } = this;
containerEl.empty();
cont... | claremacrae/obsidian-customizable-menu | src/ui/settingsTab.ts | TypeScript |
InterfaceDeclaration |
export interface CustomMenuSettings {
menuCommands: Command[];
} | claremacrae/obsidian-customizable-menu | src/ui/settingsTab.ts | TypeScript |
MethodDeclaration |
display(): void {
let { containerEl } = this;
containerEl.empty();
containerEl.createEl('h2', { text: 'Customizable Menu Settings' });
new Setting(containerEl)
.setName("Add Command to Menu")
.setDesc("Add a new command to the right-click menu")
.add... | claremacrae/obsidian-customizable-menu | src/ui/settingsTab.ts | TypeScript |
ArrowFunction |
(type: string, graph: Graph): Layout | undefined => {
return type === COLA_LAYOUT ? new TopologyColaLayout(graph, { layoutOnDrag: false }) : undefined;
} | Lucifergene/console | frontend/packages/topology/src/components/graph-view/layouts/layoutFactory.ts | TypeScript |
ArrowFunction |
()=>MouseCoordintatePlugin.changeMouseCoordinates | iofirag/stenciljs-gis-example | .history/src/components/gis-viewer/classes/features/ToolbarComp/ToolbarComp_20171226103859.ts | TypeScript |
ArrowFunction |
(dataLayer: ShapeLayerContainer) => {
// const isLayerVisible: boolean = map.hasLayer(dataLayer.leafletHeatLayer);
if (dataLayer.isDisplay) {
if (this.context.mapSettings.mode==='heat') {
this.toggleBetweenHeatCluster(dataLayer, SELECT_LAYER, UNSELECT_LAYER);
} else if (this.cont... | iofirag/stenciljs-gis-example | .history/src/components/gis-viewer/classes/features/ToolbarComp/ToolbarComp_20171226103859.ts | TypeScript |
ArrowFunction |
(fileType: string) => {
this.context.mapState.importedLayers[fileType.toLowerCase()].forEach((dataLayer: ShapeLayerContainer) => {
if (dataLayer.isDisplay) {
if (this.context.mapSettings.mode === 'heat') {
this.toggleBetweenHeatCluster(dataLayer, SELECT_LAYER, UNSELECT_LAYER... | iofirag/stenciljs-gis-example | .history/src/components/gis-viewer/classes/features/ToolbarComp/ToolbarComp_20171226103859.ts | TypeScript |
ArrowFunction |
(dataLayer: ShapeLayerContainer) => {
if (dataLayer.isDisplay) {
if (this.context.mapSettings.mode === 'heat') {
this.toggleBetweenHeatCluster(dataLayer, SELECT_LAYER, UNSELECT_LAYER);
} else if (this.context.mapSettings.mode === 'cluster') {
this.toggleBet... | iofirag/stenciljs-gis-example | .history/src/components/gis-viewer/classes/features/ToolbarComp/ToolbarComp_20171226103859.ts | TypeScript |
MethodDeclaration |
init() {
const context = this.context;
if (!context) { return;}
this.features = {};
context.onAddControlToFeatures = this.addFeatureToToolbarHandler;
const { selectedLeafletObjects, mapState, map, props } = this.context;
const exportDropDownData: any[] = [{
label: 'Export KML',
o... | iofirag/stenciljs-gis-example | .history/src/components/gis-viewer/classes/features/ToolbarComp/ToolbarComp_20171226103859.ts | TypeScript |
MethodDeclaration |
public onChangeMapMode(mode: ClusterHeat) {
// const previewsMode: string = this.context.mapSettings.mode;
this.context.mapSettings.mode = mode;
// Initial layers
this.context.mapState.initialLayers.forEach((dataLayer: ShapeLayerContainer) => {
// const isLayerVisible: boolean = map.hasLayer(data... | iofirag/stenciljs-gis-example | .history/src/components/gis-viewer/classes/features/ToolbarComp/ToolbarComp_20171226103859.ts | TypeScript |
MethodDeclaration | // public getZoomToExtends(): ZoomToExtendComp {
// return this.features[FeaturesNames.ZOOM_TO_EXTEND_COMP];
// }
// public getDrawBar(): DrawBarComp {
// return this.features[FeaturesNames.DRAWBAR_COMP];
// }
// public getDrawLayer(): L.FeatureGroup {
// return this.getDrawBar().getDrawLayer();
// }
private togg... | iofirag/stenciljs-gis-example | .history/src/components/gis-viewer/classes/features/ToolbarComp/ToolbarComp_20171226103859.ts | TypeScript |
MethodDeclaration | // private unitsChangeClickHandler() {
// const toggleableList = [
// FeaturesNames.MEASURE_COMP,
// FeaturesNames.SCALE_CONTROL_COMP,
// FeaturesNames.DRAWBAR_COMP
// ];
// try {
// toggleableList.forEach(key => {
// if (this.features[key]) {
// this.features[key].toggleUnits();
// ... | iofirag/stenciljs-gis-example | .history/src/components/gis-viewer/classes/features/ToolbarComp/ToolbarComp_20171226103859.ts | TypeScript |
ClassDeclaration |
@Module({})
export class CommonModule {} | dawiddominiak/reminders | src/common/common.module.ts | TypeScript |
FunctionDeclaration |
function waitForSpyCall(spy: jasmine.Spy, checkInterval: number = 40, timeout: number = 1000): Promise<any> {
const initialCallsCount = spy.calls.count();
return new Promise<void>((resolve, reject) => {
let intervalId;
const timeoutId = setTimeout(() => {
clearInterval(intervalId);
reject();
... | dadosfera/beast | src/framework/theme/components/list/list-pager.directive.spec.ts | TypeScript |
ArrowFunction |
(resolve, reject) => {
let intervalId;
const timeoutId = setTimeout(() => {
clearInterval(intervalId);
reject();
}, timeout);
intervalId = setInterval(() => {
if (spy.calls.count() > initialCallsCount) {
clearTimeout(timeoutId);
clearInterval(intervalId);
reso... | dadosfera/beast | src/framework/theme/components/list/list-pager.directive.spec.ts | TypeScript |
ArrowFunction |
() => {
clearInterval(intervalId);
reject();
} | dadosfera/beast | src/framework/theme/components/list/list-pager.directive.spec.ts | TypeScript |
ArrowFunction |
() => {
if (spy.calls.count() > initialCallsCount) {
clearTimeout(timeoutId);
clearInterval(intervalId);
resolve();
}
} | dadosfera/beast | src/framework/theme/components/list/list-pager.directive.spec.ts | TypeScript |
ArrowFunction |
() => {
let initialTimeoutInterval;
beforeAll(() => {
initialTimeoutInterval = jasmine.DEFAULT_TIMEOUT_INTERVAL;
jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000;
});
afterAll(() => (jasmine.DEFAULT_TIMEOUT_INTERVAL = initialTimeoutInterval));
beforeEach(() => {
fixture = TestBed.configureTestingModule({... | dadosfera/beast | src/framework/theme/components/list/list-pager.directive.spec.ts | TypeScript |
ArrowFunction |
() => {
initialTimeoutInterval = jasmine.DEFAULT_TIMEOUT_INTERVAL;
jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000;
} | dadosfera/beast | src/framework/theme/components/list/list-pager.directive.spec.ts | TypeScript |
ArrowFunction |
() => (jasmine.DEFAULT_TIMEOUT_INTERVAL = initialTimeoutInterval) | dadosfera/beast | src/framework/theme/components/list/list-pager.directive.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture = TestBed.configureTestingModule({
imports: [NbListModule],
declarations: [PagerTestComponent],
providers: [{ provide: ComponentFixtureAutoDetect, useValue: true }],
}).createComponent(PagerTestComponent);
testComponent = fixture.componentInstance;
fixture.detectChang... | dadosfera/beast | src/framework/theme/components/list/list-pager.directive.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture.destroy();
tick();
fixture.nativeElement.remove();
} | dadosfera/beast | src/framework/theme/components/list/list-pager.directive.spec.ts | TypeScript |
ArrowFunction |
() => {
it('should emit initial page change when list was prefilled', async () => {
try {
await waitForSpyCall(pageChangedSpy);
} catch {
fail('Page change should be emmited');
}
expect(pageChangedSpy).toHaveBeenCalledTimes(1);
expect(pageChangedSpy).toHaveBeenCalledW... | dadosfera/beast | src/framework/theme/components/list/list-pager.directive.spec.ts | TypeScript |
ArrowFunction |
async () => {
try {
await waitForSpyCall(pageChangedSpy);
} catch {
fail('Page change should be emmited');
}
expect(pageChangedSpy).toHaveBeenCalledTimes(1);
expect(pageChangedSpy).toHaveBeenCalledWith(1);
} | dadosfera/beast | src/framework/theme/components/list/list-pager.directive.spec.ts | TypeScript |
ArrowFunction |
() => {
let initialItemsCountBefore;
beforeAll(() => {
initialItemsCountBefore = initialItemsCount;
initialItemsCount = 0;
});
afterAll(() => (initialItemsCount = initialItemsCountBefore));
it('should not emit initial page change when list is empty', async () => {
... | dadosfera/beast | src/framework/theme/components/list/list-pager.directive.spec.ts | TypeScript |
ArrowFunction |
() => {
initialItemsCountBefore = initialItemsCount;
initialItemsCount = 0;
} | dadosfera/beast | src/framework/theme/components/list/list-pager.directive.spec.ts | TypeScript |
ArrowFunction |
() => (initialItemsCount = initialItemsCountBefore) | dadosfera/beast | src/framework/theme/components/list/list-pager.directive.spec.ts | TypeScript |
ArrowFunction |
async () => {
try {
await waitForSpyCall(pageChangedSpy);
fail('Page change should not be emmited');
} catch {}
expect(pageChangedSpy).not.toHaveBeenCalled();
} | dadosfera/beast | src/framework/theme/components/list/list-pager.directive.spec.ts | TypeScript |
ArrowFunction |
async () => {
testComponent.items = new Array(initialItemsCountBefore);
fixture.detectChanges();
try {
await waitForSpyCall(pageChangedSpy);
} catch {
fail('Page change should be emmited');
}
expect(pageChangedSpy).toHaveBeenCalledTimes(1);
e... | dadosfera/beast | src/framework/theme/components/list/list-pager.directive.spec.ts | TypeScript |
ArrowFunction |
() => {
let initialItemsCountBefore;
beforeAll(() => {
initialItemsCountBefore = initialItemsCount;
initialItemsCount = 0;
});
afterAll(() => (initialItemsCount = initialItemsCountBefore));
it('should take into account start page when calculating current page', async () => {
cons... | dadosfera/beast | src/framework/theme/components/list/list-pager.directive.spec.ts | TypeScript |
ArrowFunction |
() => {
initialItemsCountBefore = initialItemsCount;
initialItemsCount = 0;
} | dadosfera/beast | src/framework/theme/components/list/list-pager.directive.spec.ts | TypeScript |
ArrowFunction |
async () => {
const startPage = 5;
const { listElement } = testComponent;
testComponent.items = new Array(initialItemsCountBefore);
testComponent.startPage = startPage;
fixture.detectChanges();
try {
await waitForSpyCall(pageChangedSpy);
} catch {
fail('pageCh... | dadosfera/beast | src/framework/theme/components/list/list-pager.directive.spec.ts | TypeScript |
ArrowFunction |
() => {
beforeEach(async () => {
try {
await waitForSpyCall(pageChangedSpy);
} catch {
throw new Error('No initial page call');
}
// 'pageChanged' will be called once after list initialization, since list has items.
// Reset to start counting from zero calls.
pag... | dadosfera/beast | src/framework/theme/components/list/list-pager.directive.spec.ts | TypeScript |
ArrowFunction |
async () => {
try {
await waitForSpyCall(pageChangedSpy);
} catch {
throw new Error('No initial page call');
}
// 'pageChanged' will be called once after list initialization, since list has items.
// Reset to start counting from zero calls.
pageChangedSpy.calls.reset... | dadosfera/beast | src/framework/theme/components/list/list-pager.directive.spec.ts | TypeScript |
ArrowFunction |
async () => {
const { listElement } = testComponent;
const positionBeforePageTwo = PAGE_HEIGHT - LIST_HEIGHT;
listElement.scrollTop = positionBeforePageTwo;
try {
await waitForSpyCall(pageChangedSpy);
} catch {
/* Expecting to throw because 'pageChanged' shouldn't be calle... | dadosfera/beast | src/framework/theme/components/list/list-pager.directive.spec.ts | TypeScript |
ArrowFunction |
async () => {
const { listElement } = testComponent;
const startPage = 1;
let timesPageShouldBeChanged = 0;
const lastPage = initialItemsCount / ITEMS_PER_PAGE - 1;
const numbersOfPagesToScroll = [1, 2, lastPage, 0];
for (const pagesToScroll of numbersOfPagesToScroll) {
li... | dadosfera/beast | src/framework/theme/components/list/list-pager.directive.spec.ts | TypeScript |
ClassDeclaration |
@Component({
template: `
<nb-list
nbListPageTracker
[pageSize]="pageSize"
[startPage]="startPage"
(pageChange)="pageChanged($event)"
class="list"
>
<nb-list-item *ngFor="let _ of items" class="list-item"></nb-list-item>
</nb-list>
`,
styles: [
`
.list {
... | dadosfera/beast | src/framework/theme/components/list/list-pager.directive.spec.ts | TypeScript |
MethodDeclaration |
pageChanged() {} | dadosfera/beast | src/framework/theme/components/list/list-pager.directive.spec.ts | TypeScript |
ArrowFunction |
(paramMap: ParamMap) => {
if (paramMap.has('reminder')) {
const reminderId = paramMap.get('reminder');
const dialogRef = this.dialog.open(ReminderDialogComponent, {
width: '100%',
data: {
reminderId
}
});
dialogRef.afterClosed().subscribe(... | andryfailli/remindme-frontend | src/app/reminders/reminders-list/reminders-list.component.ts | TypeScript |
ArrowFunction |
(reminder: Reminder) => {
this.router.navigate([
reminder && reminder.archived ? '/archive' : '/inbox'
]);
this.listReminders();
} | andryfailli/remindme-frontend | src/app/reminders/reminders-list/reminders-list.component.ts | TypeScript |
ArrowFunction |
(reminders: Reminder[]) =>
reminders.filter((reminder: Reminder) => reminder.isPast() === false) | andryfailli/remindme-frontend | src/app/reminders/reminders-list/reminders-list.component.ts | TypeScript |
ArrowFunction |
(reminder: Reminder) => reminder.isPast() === false | andryfailli/remindme-frontend | src/app/reminders/reminders-list/reminders-list.component.ts | TypeScript |
ArrowFunction |
(reminders: Reminder[]) =>
reminders.filter((reminder: Reminder) => reminder.isPast() === true) | andryfailli/remindme-frontend | src/app/reminders/reminders-list/reminders-list.component.ts | TypeScript |
ArrowFunction |
(reminder: Reminder) => reminder.isPast() === true | andryfailli/remindme-frontend | src/app/reminders/reminders-list/reminders-list.component.ts | TypeScript |
ArrowFunction |
() => {
this.matSnackBar.open('Reminder moved to the archive.', null, {
duration: 2000
});
this.listReminders();
} | andryfailli/remindme-frontend | src/app/reminders/reminders-list/reminders-list.component.ts | TypeScript |
ArrowFunction |
() => {
this.matSnackBar.open('Reminder moved to inbox.', null, {
duration: 2000
});
this.listReminders();
} | andryfailli/remindme-frontend | src/app/reminders/reminders-list/reminders-list.component.ts | TypeScript |
ArrowFunction |
() => {
this.matSnackBar.open('Reminder deleted.', null, { duration: 2000 });
this.listReminders();
} | andryfailli/remindme-frontend | src/app/reminders/reminders-list/reminders-list.component.ts | TypeScript |
ClassDeclaration |
@Component({
selector: 'app-reminders-list',
templateUrl: './reminders-list.component.html',
styleUrls: ['./reminders-list.component.css']
})
export class RemindersListComponent implements OnInit {
reminders$: Observable<Reminder[]>;
remindersUpcoming$: Observable<Reminder[]>;
remindersPast$: Observable<Re... | andryfailli/remindme-frontend | src/app/reminders/reminders-list/reminders-list.component.ts | TypeScript |
MethodDeclaration |
ngOnInit() {
this.listReminders();
this.route.paramMap.subscribe((paramMap: ParamMap) => {
if (paramMap.has('reminder')) {
const reminderId = paramMap.get('reminder');
const dialogRef = this.dialog.open(ReminderDialogComponent, {
width: '100%',
data: {
rem... | andryfailli/remindme-frontend | src/app/reminders/reminders-list/reminders-list.component.ts | TypeScript |
MethodDeclaration |
listReminders() {
this.reminders$ = this.remindersService
.list(this.router.url.startsWith('/inbox') ? false : true)
.share();
this.remindersUpcoming$ = this.reminders$.map((reminders: Reminder[]) =>
reminders.filter((reminder: Reminder) => reminder.isPast() === false)
);
this.remin... | andryfailli/remindme-frontend | src/app/reminders/reminders-list/reminders-list.component.ts | TypeScript |
MethodDeclaration |
archiveReminder(reminder: Reminder): Observable<Reminder> {
const reminder$: Observable<Reminder> = this.remindersService.archive(
reminder
);
reminder$.subscribe(() => {
this.matSnackBar.open('Reminder moved to the archive.', null, {
duration: 2000
});
this.listReminders();... | andryfailli/remindme-frontend | src/app/reminders/reminders-list/reminders-list.component.ts | TypeScript |
MethodDeclaration |
unarchiveReminder(reminder: Reminder): Observable<Reminder> {
const reminder$: Observable<Reminder> = this.remindersService.unarchive(
reminder
);
reminder$.subscribe(() => {
this.matSnackBar.open('Reminder moved to inbox.', null, {
duration: 2000
});
this.listReminders();
... | andryfailli/remindme-frontend | src/app/reminders/reminders-list/reminders-list.component.ts | TypeScript |
MethodDeclaration |
deleteReminder(reminder: Reminder): Observable<void> {
const reminder$: Observable<void> = this.remindersService.delete(reminder);
reminder$.subscribe(() => {
this.matSnackBar.open('Reminder deleted.', null, { duration: 2000 });
this.listReminders();
});
return reminder$;
} | andryfailli/remindme-frontend | src/app/reminders/reminders-list/reminders-list.component.ts | TypeScript |
ClassDeclaration |
export class PaginationQueryDto {
@ApiProperty()
@IsString()
@IsOptional()
@IsPositive()
limit: string;
@ApiProperty()
@IsString()
@IsOptional()
@IsPositive()
offset: string;
} | abebelagua/testproyect-api | src/dto/pagination.dto.ts | TypeScript |
FunctionDeclaration |
function mapStateToProps(state: CombinedState): StateToProps {
const {
auth: {
user,
fetching: logoutFetching,
fetching: changePasswordFetching,
showChangePasswordDialog: changePasswordDialogShown,
allowChangePassword: renderChangePasswordItem,
... | Intelligent-Systems-Laboratory/cvat | cvat-ui/src/components/header/header.tsx | TypeScript |
FunctionDeclaration |
function mapDispatchToProps(dispatch: any): DispatchToProps {
return {
onLogout: (): void => dispatch(logoutAsync()),
switchSettingsDialog: (show: boolean): void => dispatch(switchSettingsDialogAction(show)),
switchChangePasswordDialog: (show: boolean): void => dispatch(authActions.switchCh... | Intelligent-Systems-Laboratory/cvat | cvat-ui/src/components/header/header.tsx | TypeScript |
FunctionDeclaration |
function HeaderContainer(props: Props): JSX.Element {
const {
user,
tool,
logoutFetching,
changePasswordFetching,
settingsDialogShown,
switchSettingsShortcut,
onLogout,
switchSettingsDialog,
switchChangePasswordDialog,
renderChangePass... | Intelligent-Systems-Laboratory/cvat | cvat-ui/src/components/header/header.tsx | TypeScript |
FunctionDeclaration |
function showAboutModal(): void {
Modal.info({
title: `${tool.name}`,
content: (
<div>
<p>{`${tool.description}`}</p>
<p>
<Text strong>Server version:</Text>
<Text type='secondary'>{`... | Intelligent-Systems-Laboratory/cvat | cvat-ui/src/components/header/header.tsx | TypeScript |
FunctionDeclaration |
function propsAreTheSame(prevProps: Props, nextProps: Props): boolean {
let equal = true;
for (const prop in nextProps) {
if (prop in prevProps && (prevProps as any)[prop] !== (nextProps as any)[prop]) {
if (prop !== 'tool') {
equal = false;
}
}
}
... | Intelligent-Systems-Laboratory/cvat | cvat-ui/src/components/header/header.tsx | TypeScript |
ArrowFunction |
(): void => dispatch(logoutAsync()) | Intelligent-Systems-Laboratory/cvat | cvat-ui/src/components/header/header.tsx | TypeScript |
ArrowFunction |
(show: boolean): void => dispatch(switchSettingsDialogAction(show)) | Intelligent-Systems-Laboratory/cvat | cvat-ui/src/components/header/header.tsx | TypeScript |
ArrowFunction |
(show: boolean): void => dispatch(authActions.switchChangePasswordDialog(show)) | Intelligent-Systems-Laboratory/cvat | cvat-ui/src/components/header/header.tsx | TypeScript |
ArrowFunction |
(): void => switchChangePasswordDialog(true) | Intelligent-Systems-Laboratory/cvat | cvat-ui/src/components/header/header.tsx | TypeScript |
ArrowFunction |
() => switchChangePasswordDialog(false) | Intelligent-Systems-Laboratory/cvat | cvat-ui/src/components/header/header.tsx | TypeScript |
InterfaceDeclaration |
interface Tool {
name: string;
description: string;
server: {
host: string;
version: string;
};
core: {
version: string;
};
canvas: {
version: string;
};
ui: {
version: string;
};
} | Intelligent-Systems-Laboratory/cvat | cvat-ui/src/components/header/header.tsx | TypeScript |
InterfaceDeclaration |
interface StateToProps {
user: any;
tool: Tool;
switchSettingsShortcut: string;
settingsDialogShown: boolean;
changePasswordDialogShown: boolean;
changePasswordFetching: boolean;
logoutFetching: boolean;
renderChangePasswordItem: boolean;
isAnalyticsPluginActive: boolean;
isMode... | Intelligent-Systems-Laboratory/cvat | cvat-ui/src/components/header/header.tsx | TypeScript |
InterfaceDeclaration |
interface DispatchToProps {
onLogout: () => void;
switchSettingsDialog: (show: boolean) => void;
switchChangePasswordDialog: (show: boolean) => void;
} | Intelligent-Systems-Laboratory/cvat | cvat-ui/src/components/header/header.tsx | TypeScript |
TypeAliasDeclaration |
type Props = StateToProps & DispatchToProps; | Intelligent-Systems-Laboratory/cvat | cvat-ui/src/components/header/header.tsx | TypeScript |
MethodDeclaration |
functions< | Intelligent-Systems-Laboratory/cvat | cvat-ui/src/components/header/header.tsx | TypeScript |
MethodDeclaration |
changePasswordFetching ? <Icon type='loading' | Intelligent-Systems-Laboratory/cvat | cvat-ui/src/components/header/header.tsx | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.