type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
MethodDeclaration
/** * Calcule le nombre de colonnes de la galerie */ private computeGridProperties() { if (this.columns) { this.cardsPerRow = +this.columns; } else { let width = window.innerWidth if (width <= 400) { this.cardsPerRow = 3; } else {...
Salomizi/PWA-PO
src/components/app-projects-gallery/app-projects-gallery.tsx
TypeScript
MethodDeclaration
private goToProjectDetails(projet: Projet) { console.log(projet); }
Salomizi/PWA-PO
src/components/app-projects-gallery/app-projects-gallery.tsx
TypeScript
MethodDeclaration
render() { return ( <ion-page> <ion-content> <ion-grid> <ion-row> { this.projets.map((projet) => { return <ion-col class={ 'column-' + this.cardsPerRow }> ...
Salomizi/PWA-PO
src/components/app-projects-gallery/app-projects-gallery.tsx
TypeScript
ClassDeclaration
/** Base class for the instances of 'Component' that represent data, i.e. value. */ export abstract class DataHolder extends Component { protected data: any = undefined; // actual value private readonly schema: IDataSchema = undefined; // schema public constructor(name: string, parent: ComponentOwner,...
tum-ei-esi/virtual-thing
src/virtual_thing/src/components/data.ts
TypeScript
ClassDeclaration
/** Base class for the instances of 'DataHolder' that can be read. */ export abstract class ReadableData extends DataHolder { /** * Performs the given read operation from the given path in data * and returns the result if successful, throws an error otherwise. * * An error may be thrown in t...
tum-ei-esi/virtual-thing
src/virtual_thing/src/components/data.ts
TypeScript
ClassDeclaration
/** Base class for the instances of 'ReadableData' that can also be written. */ export abstract class WritableData extends ReadableData { private isRootPath(path: string): boolean { return !path || path.trim().length == 0; } public fake(){ this.fakeData(); } /** * Performs...
tum-ei-esi/virtual-thing
src/virtual_thing/src/components/data.ts
TypeScript
ClassDeclaration
/** Class representing readonly data. */ export class ReadOnlyData extends ReadableData { public constructor(name: string, parent: ComponentOwner, schema: IDataSchema){ super(name, parent, schema); } }
tum-ei-esi/virtual-thing
src/virtual_thing/src/components/data.ts
TypeScript
ClassDeclaration
/** Class representing read/write-able data. */ export class Data extends WritableData { public constructor(name: string, parent: ComponentOwner, schema: IDataSchema){ super(name, parent, schema); } }
tum-ei-esi/virtual-thing
src/virtual_thing/src/components/data.ts
TypeScript
EnumDeclaration
export enum ReadOp { get = "get", pop = "pop", copy = "copy", length = "length", parse = "parse" }
tum-ei-esi/virtual-thing
src/virtual_thing/src/components/data.ts
TypeScript
EnumDeclaration
export enum WriteOp { set = "set", push = "push", copy = "copy", pushCopy = "pushCopy", concat = "concat" }
tum-ei-esi/virtual-thing
src/virtual_thing/src/components/data.ts
TypeScript
MethodDeclaration
//#region Reset/initialize value /** Resets data to its default value according to the schema. */ public reset(){ if(DataHolder.hasConst(this.schema)){ this.data = this.schema.const; }else if(DataHolder.hasFakeTrue(this.schema)){ this.fakeData(); }else if(this.has...
tum-ei-esi/virtual-thing
src/virtual_thing/src/components/data.ts
TypeScript
MethodDeclaration
protected isFake(){ return !DataHolder.hasConst(this.schema) && DataHolder.hasFakeTrue(this.schema); }
tum-ei-esi/virtual-thing
src/virtual_thing/src/components/data.ts
TypeScript
MethodDeclaration
protected hasDefault(){ return this.schema.default !== undefined; }
tum-ei-esi/virtual-thing
src/virtual_thing/src/components/data.ts
TypeScript
MethodDeclaration
protected hasType(){ return this.schema.type !== undefined; }
tum-ei-esi/virtual-thing
src/virtual_thing/src/components/data.ts
TypeScript
MethodDeclaration
public static hasFakeTrue(schema: IDataSchema){ return schema.fake === true; }
tum-ei-esi/virtual-thing
src/virtual_thing/src/components/data.ts
TypeScript
MethodDeclaration
public static hasConst(schema: IDataSchema){ return schema.const !== undefined; }
tum-ei-esi/virtual-thing
src/virtual_thing/src/components/data.ts
TypeScript
MethodDeclaration
public static isReadOnly(schema: IDataSchema){ return DataHolder.hasConst(schema) || DataHolder.hasFakeTrue(schema); }
tum-ei-esi/virtual-thing
src/virtual_thing/src/components/data.ts
TypeScript
MethodDeclaration
//#endregion /** Fakes data using the schema */ protected fakeData(){ this.data = jsf(this.schema); }
tum-ei-esi/virtual-thing
src/virtual_thing/src/components/data.ts
TypeScript
MethodDeclaration
/** * Validates the given value against the schema. * * Returns true - if the value is valid, false - otherwise. * * @param value Value to validate. * @param withError If true, then in case of validation failure an error * will be thrown. * @param opDescr A string descibing i...
tum-ei-esi/virtual-thing
src/virtual_thing/src/components/data.ts
TypeScript
MethodDeclaration
/** * Composes and returns a string describing an operation * that is being performed over data. * * @param operation A valid read or write operation. * @param path The relative path of the affected entry in data. * @param value The value that is being written in case of a write operation...
tum-ei-esi/virtual-thing
src/virtual_thing/src/components/data.ts
TypeScript
MethodDeclaration
/** * Checks whether data has an entry with the given path. * * Returns true - if check succeeds (i.e. an entry is present), * false - otherwise. * * @param path The relative path of the entry in data. * @param expectedType The expected type of the entry. If this parameter * ...
tum-ei-esi/virtual-thing
src/virtual_thing/src/components/data.ts
TypeScript
MethodDeclaration
/** * Creates and returns an instance of: * - 'ReadOnlyData' in case the given schema contains 'const' or 'fake' * - 'Data' - otherwise * * @param name A name for the instance (name of the node). * @param parent A parent for the instance (parent node) * @param schema A valid schema o...
tum-ei-esi/virtual-thing
src/virtual_thing/src/components/data.ts
TypeScript
MethodDeclaration
/** * Performs the given read operation from the given path in data * and returns the result if successful, throws an error otherwise. * * An error may be thrown in the following cases: * - an entry under the given path does not exist * - the given operation will lead to incompliance wi...
tum-ei-esi/virtual-thing
src/virtual_thing/src/components/data.ts
TypeScript
MethodDeclaration
private isRootPath(path: string): boolean { return !path || path.trim().length == 0; }
tum-ei-esi/virtual-thing
src/virtual_thing/src/components/data.ts
TypeScript
MethodDeclaration
public fake(){ this.fakeData(); }
tum-ei-esi/virtual-thing
src/virtual_thing/src/components/data.ts
TypeScript
MethodDeclaration
/** * Performs the given write operation to the entry with the given * path in data if successful, throws an error otherwise. * * An error may be thrown in the following cases: * - an entry under the given path does not exist * - the given operation will lead to incompliance with the sc...
tum-ei-esi/virtual-thing
src/virtual_thing/src/components/data.ts
TypeScript
ArrowFunction
() => vnode.attrs.runPipeline(vnode.attrs.pipelineName)
GaneshSPatil/gocd
server/src/main/webapp/WEB-INF/rails/webpack/views/pages/pipeline_activity/show_force_build_action_widget.tsx
TypeScript
ArrowFunction
(stage, index) => { return <div class={classnames(styles.stageBoxPipelineActivity, styles.disabledIcon)}> {ShowForceBuildActionWidget.getStageApprovalIcon(index, stage)} <span class={classnames(styles.stageStatus, styles.unknown)}/> </div>; }
GaneshSPatil/gocd
server/src/main/webapp/WEB-INF/rails/webpack/views/pages/pipeline_activity/show_force_build_action_widget.tsx
TypeScript
ClassDeclaration
export class ShowForceBuildActionWidget extends MithrilViewComponent<ShowForceBuildActionAttrs> { view(vnode: m.Vnode<ShowForceBuildActionAttrs, this>): m.Children { return <tr class={classnames(styles.groupContent, styles.forceBuild)}> <td class={styles.left}> <Primary onclick={() => vnode.attrs.r...
GaneshSPatil/gocd
server/src/main/webapp/WEB-INF/rails/webpack/views/pages/pipeline_activity/show_force_build_action_widget.tsx
TypeScript
InterfaceDeclaration
interface ShowForceBuildActionAttrs { group: Group; canForce: Stream<boolean>; pipelineName: string; runPipeline: (name: string) => void; }
GaneshSPatil/gocd
server/src/main/webapp/WEB-INF/rails/webpack/views/pages/pipeline_activity/show_force_build_action_widget.tsx
TypeScript
MethodDeclaration
view(vnode: m.Vnode<ShowForceBuildActionAttrs, this>): m.Children { return <tr class={classnames(styles.groupContent, styles.forceBuild)}> <td class={styles.left}> <Primary onclick={() => vnode.attrs.runPipeline(vnode.attrs.pipelineName)} small={true} dataTestId="for...
GaneshSPatil/gocd
server/src/main/webapp/WEB-INF/rails/webpack/views/pages/pipeline_activity/show_force_build_action_widget.tsx
TypeScript
ArrowFunction
resources=> { this.settings = resources.data[0]; console.log(this.settings); this.profileInfoLabel = this.settings.Labels.find(label=>label.name =='profileInfoLabel').description; this.myBusinessLabel = this.settings.Labels.find(label=>label.name =='my...
RosellM/ng.rs.core
src/app/starter/starter-left-side/starter-left-side.component.ts
TypeScript
ArrowFunction
label=>label.name =='profileInfoLabel'
RosellM/ng.rs.core
src/app/starter/starter-left-side/starter-left-side.component.ts
TypeScript
ArrowFunction
label=>label.name =='myBusinessLabel'
RosellM/ng.rs.core
src/app/starter/starter-left-side/starter-left-side.component.ts
TypeScript
ArrowFunction
label=>label.name =='optionsLeftSideComponentLabel'
RosellM/ng.rs.core
src/app/starter/starter-left-side/starter-left-side.component.ts
TypeScript
ArrowFunction
url => url.name == 'createBusinessUrl'
RosellM/ng.rs.core
src/app/starter/starter-left-side/starter-left-side.component.ts
TypeScript
ArrowFunction
label => label.name == 'createBusinessLabel'
RosellM/ng.rs.core
src/app/starter/starter-left-side/starter-left-side.component.ts
TypeScript
ArrowFunction
label=>label.name =='listMyBusinessLabel'
RosellM/ng.rs.core
src/app/starter/starter-left-side/starter-left-side.component.ts
TypeScript
ArrowFunction
url => url.name == 'listMyBusinessUrl'
RosellM/ng.rs.core
src/app/starter/starter-left-side/starter-left-side.component.ts
TypeScript
ArrowFunction
error=>{ console.log(error); }
RosellM/ng.rs.core
src/app/starter/starter-left-side/starter-left-side.component.ts
TypeScript
ClassDeclaration
@Component({ selector: 'app-starter-left-side', templateUrl: './starter-left-side.component.html', styleUrls: ['./starter-left-side.component.css'] }) export class StarterLeftSideComponent implements OnInit { title = 'app'; profileInfoLabel:string; profileInfoUrl:string; myBusinessLabel:string; my...
RosellM/ng.rs.core
src/app/starter/starter-left-side/starter-left-side.component.ts
TypeScript
MethodDeclaration
ngOnInit(): void { this.loadComponentsResources(); }
RosellM/ng.rs.core
src/app/starter/starter-left-side/starter-left-side.component.ts
TypeScript
MethodDeclaration
private loadComponentsResources(){ this.loadLabels(); }
RosellM/ng.rs.core
src/app/starter/starter-left-side/starter-left-side.component.ts
TypeScript
MethodDeclaration
/** * carga los recursos de un componente(ursl, labels, textos) */ /** * Obtiene configuracione del componente */ private loadLabels(){ this.settingsService.componentName = this.constructor.name; this.settingsService.list().pipe().subscribe( resources=> { ...
RosellM/ng.rs.core
src/app/starter/starter-left-side/starter-left-side.component.ts
TypeScript
FunctionDeclaration
export function invariant(condition: any, message: string, ...args: any[]): asserts condition { if (!condition) { throw new FormattedError(message, ...args); } }
meyer/hyperdeck-emulator
src/invariant.ts
TypeScript
ClassDeclaration
export class FormattedError extends Error { constructor(template: string, ...args: any[]) { super(util.format(template, ...args)); this.template = template; this.args = args; } public template: string; public args: any[]; }
meyer/hyperdeck-emulator
src/invariant.ts
TypeScript
FunctionDeclaration
async function createDummyKeyboardsRepo(gitHubDir: string): Promise<string> { fs.mkdirSync(path.join(gitHubDir, 'dummy')); const keyboardsDummyRepo = await gitService.createRepo( path.join(gitHubDir, 'dummy', 'keyboards'), ).toPromise(); const readme = path.join(keyboardsDummyRepo, 'README.md'); ...
keymanapp/developer.keyman.com
src/projects/projects.controller.spec.ts
TypeScript
FunctionDeclaration
async function createKeyboardsRepoForUser( user: string, gitHubDir: string, ): Promise<string> { // create keyboards repo for user const keyboardsDummyRepo = await createDummyKeyboardsRepo(gitHubDir); return await gitService.clone( keyboardsDummyRepo, path.join(gitHubDir, user, 'keybo...
keymanapp/developer.keyman.com
src/projects/projects.controller.spec.ts
TypeScript
FunctionDeclaration
async function createGlobalKeyboardsRepo(gitHubDir: string): Promise<void> { const keyboardsDummyRepo = await createDummyKeyboardsRepo(gitHubDir); await gitService.clone( keyboardsDummyRepo, path.join(gitHubDir, 'keymanapp', 'keyboards.git'), true, ).toPromise(); }
keymanapp/developer.keyman.com
src/projects/projects.controller.spec.ts
TypeScript
ArrowFunction
async () => { jest.setTimeout(10000 /* 10s */); const module: TestingModule = await Test.createTestingModule({ imports: [HttpModule, ConfigModule, BackendProjectModule], controllers: [ProjectsController], providers: [ TokenService, { provide: GithubService, ...
keymanapp/developer.keyman.com
src/projects/projects.controller.spec.ts
TypeScript
ArrowFunction
(): any => ({ getRepos: jest.fn(() => true), forkRepo: jest.fn(() => of({ name: 'foo' })), createPullRequest: jest.fn(() => of()), pullRequestExists: jest.fn(() => throwError(new HttpException('Pull request does not exist', 404))), pullRequestDetails: jest.fn...
keymanapp/developer.keyman.com
src/projects/projects.controller.spec.ts
TypeScript
ArrowFunction
() => of({ name: 'foo' })
keymanapp/developer.keyman.com
src/projects/projects.controller.spec.ts
TypeScript
ArrowFunction
() => of()
keymanapp/developer.keyman.com
src/projects/projects.controller.spec.ts
TypeScript
ArrowFunction
() => throwError(new HttpException('Pull request does not exist', 404))
keymanapp/developer.keyman.com
src/projects/projects.controller.spec.ts
TypeScript
ArrowFunction
() => { expect(sut).toBeDefined(); }
keymanapp/developer.keyman.com
src/projects/projects.controller.spec.ts
TypeScript
ArrowFunction
() => { it('should return list of repos', async () => { jest.spyOn(githubService, 'getRepos').mockImplementationOnce(() => of({ name: 'foo', owner: { login: 'foo' }, })); const session = { login: 'foo' }; await expect(sut.getRepos(session, 'token 12345', 1).toPromise()) ...
keymanapp/developer.keyman.com
src/projects/projects.controller.spec.ts
TypeScript
ArrowFunction
async () => { jest.spyOn(githubService, 'getRepos').mockImplementationOnce(() => of({ name: 'foo', owner: { login: 'foo' }, })); const session = { login: 'foo' }; await expect(sut.getRepos(session, 'token 12345', 1).toPromise()) .resolves.toEqual([{ name: 'foo' }]); ...
keymanapp/developer.keyman.com
src/projects/projects.controller.spec.ts
TypeScript
ArrowFunction
() => of({ name: 'foo', owner: { login: 'foo' }, })
keymanapp/developer.keyman.com
src/projects/projects.controller.spec.ts
TypeScript
ArrowFunction
async () => { jest.spyOn(githubService, 'getRepos').mockImplementationOnce(() => of( { name: 'foo', owner: { login: 'foo' }, }, { name: 'other', owner: { login: 'bar' }, }, ), ); const session = {...
keymanapp/developer.keyman.com
src/projects/projects.controller.spec.ts
TypeScript
ArrowFunction
() => of( { name: 'foo', owner: { login: 'foo' }, }, { name: 'other', owner: { login: 'bar' }, }, )
keymanapp/developer.keyman.com
src/projects/projects.controller.spec.ts
TypeScript
ArrowFunction
async () => { jest.spyOn(githubService, 'getRepos').mockImplementationOnce(() => empty()); const session = { login: 'foo' }; await expect(sut.getRepos(session, 'token 12345', 99).toPromise()).resolves.toEqual([]); }
keymanapp/developer.keyman.com
src/projects/projects.controller.spec.ts
TypeScript
ArrowFunction
() => empty()
keymanapp/developer.keyman.com
src/projects/projects.controller.spec.ts
TypeScript
ArrowFunction
() => { let gitHubDir: string; let workDir: string; beforeEach(async () => { workDir = fs.mkdtempSync(path.join(os.tmpdir(), 'workdir-')); jest.spyOn(config, 'workDirectory', 'get').mockReturnValue(workDir); const prefix = path.join(os.tmpdir(), 'projectstests-'); gitHubDir = fs.m...
keymanapp/developer.keyman.com
src/projects/projects.controller.spec.ts
TypeScript
ArrowFunction
async () => { workDir = fs.mkdtempSync(path.join(os.tmpdir(), 'workdir-')); jest.spyOn(config, 'workDirectory', 'get').mockReturnValue(workDir); const prefix = path.join(os.tmpdir(), 'projectstests-'); gitHubDir = fs.mkdtempSync(prefix); jest.spyOn(sut, 'gitHubUrl', 'get').mockReturnValu...
keymanapp/developer.keyman.com
src/projects/projects.controller.spec.ts
TypeScript
ArrowFunction
() => { deleteFolderRecursive(gitHubDir); deleteFolderRecursive(workDir); }
keymanapp/developer.keyman.com
src/projects/projects.controller.spec.ts
TypeScript
ArrowFunction
async () => { expect.assertions(4); // Setup const session = { login: 'foo' }; await createKeyboardsRepoForUser('foo', gitHubDir); // Execute const project = await sut.createRepo(session, 'token 12345', 'remoteTestRepo').toPromise(); // Verify // Should clone single-k...
keymanapp/developer.keyman.com
src/projects/projects.controller.spec.ts
TypeScript
ArrowFunction
async () => { expect.assertions(5); // Setup const session = { login: 'foo' }; await createGlobalKeyboardsRepo(gitHubDir); jest .spyOn(githubService, 'forkRepo') .mockImplementation(() => { return gitService.clone( path.join(gitHubDir, 'dummy', 'k...
keymanapp/developer.keyman.com
src/projects/projects.controller.spec.ts
TypeScript
ArrowFunction
() => { return gitService.clone( path.join(gitHubDir, 'dummy', 'keyboards'), path.join(gitHubDir, 'foo', 'keyboards.git'), true, ).pipe( map(() => ({ name: 'keyboards' })), ); }
keymanapp/developer.keyman.com
src/projects/projects.controller.spec.ts
TypeScript
ArrowFunction
() => ({ name: 'keyboards' })
keymanapp/developer.keyman.com
src/projects/projects.controller.spec.ts
TypeScript
ArrowFunction
() => { let gitHubDir: string; let workDir: string; let gitHubKeyboardsRepo: string; let localKeyboardsRepo: string; beforeEach(async () => { workDir = fs.mkdtempSync(path.join(os.tmpdir(), 'workdir-')); jest.spyOn(config, 'workDirectory', 'get').mockReturnValue(workDir); const ...
keymanapp/developer.keyman.com
src/projects/projects.controller.spec.ts
TypeScript
ArrowFunction
async () => { workDir = fs.mkdtempSync(path.join(os.tmpdir(), 'workdir-')); jest.spyOn(config, 'workDirectory', 'get').mockReturnValue(workDir); const prefix = path.join(os.tmpdir(), 'projectstests-'); gitHubDir = fs.mkdtempSync(prefix); jest.spyOn(sut, 'gitHubUrl', 'get').mockReturnValu...
keymanapp/developer.keyman.com
src/projects/projects.controller.spec.ts
TypeScript
ArrowFunction
async () => { // Setup expect.assertions(4); const session = { login: 'jdoe' }; const mockImplementation = jest .spyOn(githubService, 'createPullRequest') .mockImplementationOnce(() => of({ 'number': 42, url: 'https://api.github.com/repos/keymanap...
keymanapp/developer.keyman.com
src/projects/projects.controller.spec.ts
TypeScript
ArrowFunction
() => of({ 'number': 42, url: 'https://api.github.com/repos/keymanapp/keyboards/pulls/42', state: PrState.Open, action: PrAction.Created, })
keymanapp/developer.keyman.com
src/projects/projects.controller.spec.ts
TypeScript
ClassDeclaration
export default class ChthonianPlanetGen extends BasePlanetGen implements IPlanetGen { getKey(): number { return PlanetType.Chthonian; } run(workObj: PlanetTypeWorker): Orbit<IPlanet> { const stats = new PlanetStats(); stats.size = Score.nG; stats.atmosphere = Score.n1; ...
mantrai/stellar-nursery
src/generators/planet/chthonian-planet-gen.ts
TypeScript
MethodDeclaration
getKey(): number { return PlanetType.Chthonian; }
mantrai/stellar-nursery
src/generators/planet/chthonian-planet-gen.ts
TypeScript
MethodDeclaration
run(workObj: PlanetTypeWorker): Orbit<IPlanet> { const stats = new PlanetStats(); stats.size = Score.nG; stats.atmosphere = Score.n1; stats.hydrosphere = Score.n0; stats.biosphere = Score.n0; stats.planetGroup = 'Jovian'; stats.planetClass = 'Chthonian'; ...
mantrai/stellar-nursery
src/generators/planet/chthonian-planet-gen.ts
TypeScript
ArrowFunction
({ size }: IconProps) => { return ( <svg viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg" width={size ? iconSize[size] : undefined} > <path fillRule="evenodd" clipRule="evenodd" d="M25.9999 8.09999C25.1249 8.47499 24.3499 8.69999 23.3749 8.82499C24.3999 8.24999 25.0749 7.4 25.3999 6....
guardian/source
packages/@guardian/src-icons/twitter.tsx
TypeScript
ArrowFunction
data => { this.myCareplan = data; // this.allCarePlan = data.other_programs; }
harshravi/CHP
src/app/features/home/dashboard/components/home-data-table/home-data-table.component.ts
TypeScript
ArrowFunction
data => { // this.myCarePlan = data.my_programs; this.allCarePlan = data; }
harshravi/CHP
src/app/features/home/dashboard/components/home-data-table/home-data-table.component.ts
TypeScript
ArrowFunction
message => { }
harshravi/CHP
src/app/features/home/dashboard/components/home-data-table/home-data-table.component.ts
TypeScript
ArrowFunction
() => { this.temp = this.listData; this.rows = this.listData; this.allData = this.listAllData; this.loadingIndicator = false; this.carePlanData = this.myCareplan; this.isMycarePlan = true; }
harshravi/CHP
src/app/features/home/dashboard/components/home-data-table/home-data-table.component.ts
TypeScript
ArrowFunction
d => { t = d.result.then(data => { if (data === 'saved' || data === true) { this.updateGridWithCurrentData(); } }); }
harshravi/CHP
src/app/features/home/dashboard/components/home-data-table/home-data-table.component.ts
TypeScript
ArrowFunction
data => { if (data === 'saved' || data === true) { this.updateGridWithCurrentData(); } }
harshravi/CHP
src/app/features/home/dashboard/components/home-data-table/home-data-table.component.ts
TypeScript
ArrowFunction
(sub) => { if (sub) { sub.unsubscribe(); } }
harshravi/CHP
src/app/features/home/dashboard/components/home-data-table/home-data-table.component.ts
TypeScript
ArrowFunction
() => { window.dispatchEvent(new Event('resize')); }
harshravi/CHP
src/app/features/home/dashboard/components/home-data-table/home-data-table.component.ts
TypeScript
MethodDeclaration
ngAfterViewChecked() { // Check if the table size has changed, if (this.table && this.table.recalculate && (this.tableWrapper.nativeElement.clientWidth !== this.currentComponentWidth)) { this.currentComponentWidth = this.tableWrapper.nativeElement.clientWidth; this.table.recalculate(); this.c...
harshravi/CHP
src/app/features/home/dashboard/components/home-data-table/home-data-table.component.ts
TypeScript
MethodDeclaration
onPage(event) { this.gridOptions.offset = event.offset; this.updateGridWithCurrentData(); }
harshravi/CHP
src/app/features/home/dashboard/components/home-data-table/home-data-table.component.ts
TypeScript
MethodDeclaration
// call this method for responsive method updateTableNext(event) { this.offsetCount++; this.hidePrevBtn = false; this.gridOptions.offset = this.offsetCount; this.updateGridWithCurrentData(); }
harshravi/CHP
src/app/features/home/dashboard/components/home-data-table/home-data-table.component.ts
TypeScript
MethodDeclaration
updateTablePrev(event) { this.offsetCount--; this.gridOptions.offset = this.offsetCount; if (this.offsetCount <= 0) { this.hidePrevBtn = true; } this.updateGridWithCurrentData(); }
harshravi/CHP
src/app/features/home/dashboard/components/home-data-table/home-data-table.component.ts
TypeScript
MethodDeclaration
/** * This is a refactored utility function which helps to toggle the rows and helps in * collapsing the whole table and expanding it out as well. * @param row Currently clicked row. This helps in evaluating the current row and then toggling it out. */ toggleAndAssign(row) { this.table.rowDetail.toggleE...
harshravi/CHP
src/app/features/home/dashboard/components/home-data-table/home-data-table.component.ts
TypeScript
MethodDeclaration
toggleExpandRow(row) { if (this.rowToggled === row || this.rowToggled === undefined) { this.toggleAndAssign(row); } else { this.table.rowDetail.collapseAllRows(); this.toggleAndAssign(row); } this.dashboardHeader.emit(row); }
harshravi/CHP
src/app/features/home/dashboard/components/home-data-table/home-data-table.component.ts
TypeScript
MethodDeclaration
onDetailToggle(event) { }
harshravi/CHP
src/app/features/home/dashboard/components/home-data-table/home-data-table.component.ts
TypeScript
MethodDeclaration
updateFilter(event) { this.gridOptions.offset = 0; this.table.offset = 0; this.updateGridWithCurrentData(); // let val = event.target.value; // val = val.toLowerCase(); // // filter our data // const temp = this.temp.filter(function (d) { // return d.participant_name.toLowerCase().in...
harshravi/CHP
src/app/features/home/dashboard/components/home-data-table/home-data-table.component.ts
TypeScript
MethodDeclaration
// onChange(checked) { // if (checked) { // this.rows = this.listData; // this.temp = this.listData; // this.isMycarePlan = true; // } // else { // this.rows = this.allData; // this.temp = this.allData; // this.isMycarePlan = false; // } // } participantSelection(selectedCategory) { ...
harshravi/CHP
src/app/features/home/dashboard/components/home-data-table/home-data-table.component.ts
TypeScript
MethodDeclaration
// add tags on dropdown selection onSelection(data) { const temp = []; const program_name = []; const risk_name = []; const options = (this.isMycarePlan) ? this.myCareplan : this.allCarePlan; this.riskStatus = []; this.programNumber = []; this._CheckBoxService.setCheckBoxData(data); cons...
harshravi/CHP
src/app/features/home/dashboard/components/home-data-table/home-data-table.component.ts
TypeScript
MethodDeclaration
// watching for changes ngOnChanges(changes: { [propName: string]: SimpleChange }) { if (changes['listData'] !== undefined && this.isChecked) { this.rows = this.listData; this.temp = this.listData; } else if (changes['listAllData'] !== undefined) { if (!this.isChecked) { this.rows = th...
harshravi/CHP
src/app/features/home/dashboard/components/home-data-table/home-data-table.component.ts
TypeScript
MethodDeclaration
removeSelection(data) { this._CheckBoxService.removeCheckBoxData(data); const newData = this._CheckBoxService.getCheckBoxData(); const options = (this.isMycarePlan) ? this.myCareplan : this.allCarePlan; const pgmName = []; this.riskStatus = []; this.programNumber = []; // uncheck data from ...
harshravi/CHP
src/app/features/home/dashboard/components/home-data-table/home-data-table.component.ts
TypeScript
MethodDeclaration
getVitalComponentClass(status) { switch (status) { case -1: return 'vital-gray'; case 0: return 'vital-green'; case 1: return 'vital-orange'; case 2: return 'vital-red'; } }
harshravi/CHP
src/app/features/home/dashboard/components/home-data-table/home-data-table.component.ts
TypeScript
MethodDeclaration
ngOnInit() { this.userDetail = <IUserDetail>this._storage.get('userdetails'); this.gridOptions = { my_patients: this.showParticipant, program_nums: null, risk_status: null, search_params: null, offset: 0 }; // Putting this condition as a Role based calling of services. ...
harshravi/CHP
src/app/features/home/dashboard/components/home-data-table/home-data-table.component.ts
TypeScript
MethodDeclaration
resetItems() { this._CheckBoxService.removeCompleteData(); const newData = this._CheckBoxService.getCheckBoxData(); // updating table data and Checkbox data this.updateData(newData); }
harshravi/CHP
src/app/features/home/dashboard/components/home-data-table/home-data-table.component.ts
TypeScript