Skip to content

Commit

Permalink
Merge pull request #801 from dickschoeller/material-table
Browse files Browse the repository at this point in the history
Material table
  • Loading branch information
dickschoeller committed Dec 20, 2018
2 parents 5257071 + 6f3047d commit f2a768d
Show file tree
Hide file tree
Showing 72 changed files with 629 additions and 898 deletions.
8 changes: 0 additions & 8 deletions gedbrowserng-frontend/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ import {
HeadService,
ServiceBase,
FamilyService,
NewNoteLinkService,
NewPersonLinkService,
NewSourceLinkService,
NewSubmitterLinkService,
NoteService,
PersonService,
SourceService,
Expand Down Expand Up @@ -85,10 +81,6 @@ const rootRouting: ModuleWithProviders = RouterModule.forRoot([], { useHash: tru
providers: [
DatasetsService,
HeadService,
NewNoteLinkService,
NewPersonLinkService,
NewSourceLinkService,
NewSubmitterLinkService,
NoteService,
FamilyService,
PersonService,
Expand Down
44 changes: 0 additions & 44 deletions gedbrowserng-frontend/src/app/bases/base-dialog.ts

This file was deleted.

1 change: 0 additions & 1 deletion gedbrowserng-frontend/src/app/bases/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ export * from './initable-person-creator';
export * from './note-creator';
export * from './source-creator';
export * from './submitter-creator';
export * from './base-dialog';
12 changes: 6 additions & 6 deletions gedbrowserng-frontend/src/app/bases/initable-person-creator.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import {OnInit, OnChanges} from '@angular/core';
import { OnInit, OnChanges } from '@angular/core';

import {NewPersonHelper} from '../utils';
import {NewPersonLinkService} from '../services';
import {PersonCreator} from './person-creator';
import { NewPersonHelper } from '../utils';
import { PersonService } from '../services';
import { PersonCreator } from './person-creator';

export abstract class InitablePersonCreator extends PersonCreator implements OnInit, OnChanges {
nph = new NewPersonHelper();

constructor(public newPersonLinkService: NewPersonLinkService) {
super(newPersonLinkService);
constructor(public personService: PersonService) {
super(personService);
}

ngOnInit(): void {
Expand Down
6 changes: 3 additions & 3 deletions gedbrowserng-frontend/src/app/bases/note-creator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ import { MatDialog, MatDialogRef, } from '@angular/material';
import { RefreshNote } from '../interfaces/refresh-note';
import { ApiNote, NewNoteDialogData } from '../models';
import { UrlBuilder, NewNoteHelper } from '../utils';
import { NewNoteLinkService } from '../services';
import { NewNoteDialogComponent } from '../components/new-note-dialog';
import { NoteService } from '../services';

export abstract class NoteCreator implements RefreshNote {
data: NewNoteDialogData;

constructor(public newNoteLinkService: NewNoteLinkService,
constructor(public noteService: NoteService,
public dialog: MatDialog) {}

createNote(data: NewNoteDialogData): void {
if (data != null && data !== undefined) {
const newNote: ApiNote = NewNoteHelper.buildNote(data);
this.newNoteLinkService.post(this.noteUB(), this.noteAnchor(), newNote)
this.noteService.postLink(this.noteUB(), this.noteAnchor(), newNote)
.subscribe((note: ApiNote) => this.refreshNote(note));
}
}
Expand Down
8 changes: 4 additions & 4 deletions gedbrowserng-frontend/src/app/bases/person-creator.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { RefreshPerson } from '../interfaces';
import { ApiPerson, NewPersonDialogData, LinkPersonDialogData } from '../models';
import { NewPersonHelper, UrlBuilder } from '../utils';
import { NewPersonLinkService } from '../services';
import { PersonService } from '../services';

export abstract class PersonCreator implements RefreshPerson {
constructor(public newPersonLinkService: NewPersonLinkService) {}
constructor(public personService: PersonService) {}

createPerson(data: NewPersonDialogData): void {
if (data != null) {
const newPerson: ApiPerson = NewPersonHelper.buildPerson(data);
this.newPersonLinkService.post(this.personUB(), this.personAnchor(), newPerson)
this.personService.postLink(this.personUB(), this.personAnchor(), newPerson)
.subscribe((d: ApiPerson) => this.refreshPerson());
}
}

linkPerson(data: LinkPersonDialogData) {
this.newPersonLinkService.put(this.personUB(), this.personAnchor(), data.selectOne.person)
this.personService.putLink(this.personUB(), this.personAnchor(), data.selectOne.person)
.subscribe((person: ApiPerson) => { this.refreshPerson(); });
}

Expand Down
6 changes: 3 additions & 3 deletions gedbrowserng-frontend/src/app/bases/source-creator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ import { MatDialog, MatDialogRef, } from '@angular/material';
import { RefreshSource } from '../interfaces';
import { ApiSource, NewSourceDialogData } from '../models';
import { NewSourceHelper, UrlBuilder } from '../utils';
import { NewSourceLinkService } from '../services';
import { NewSourceDialogComponent } from '../components/new-source-dialog';
import { SourceService } from '../services';

export abstract class SourceCreator implements RefreshSource {
data: NewSourceDialogData;

constructor(
public newSourceLinkService: NewSourceLinkService,
public sourceService: SourceService,
public dialog: MatDialog,
) {}

createSource(data: NewSourceDialogData): void {
if (data != null && data !== undefined) {
const newSource: ApiSource = NewSourceHelper.buildSource(data);
this.newSourceLinkService.post(this.sourceUB(), this.sourceAnchor(), newSource)
this.sourceService.postLink(this.sourceUB(), this.sourceAnchor(), newSource)
.subscribe((source: ApiSource) => this.refreshSource(source));
}
}
Expand Down
6 changes: 3 additions & 3 deletions gedbrowserng-frontend/src/app/bases/submitter-creator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ import { MatDialog, MatDialogRef, } from '@angular/material';
import { RefreshSubmitter } from '../interfaces';
import { ApiSubmitter, NewSubmitterDialogData } from '../models';
import { NewSubmitterHelper, UrlBuilder } from '../utils';
import { NewSubmitterLinkService } from '../services';
import { NewSubmitterDialogComponent } from '../components/new-submitter-dialog';
import { SubmitterService } from '../services';

export abstract class SubmitterCreator implements RefreshSubmitter {
data: NewSubmitterDialogData;

constructor(
public newSubmitterLinkService: NewSubmitterLinkService,
public submitterService: SubmitterService,
public dialog: MatDialog,
) {}

createSubmitter(data: NewSubmitterDialogData): void {
if (data != null && data !== undefined) {
const newSubmitter: ApiSubmitter = NewSubmitterHelper.buildSubmitter(data);
this.newSubmitterLinkService.post(this.submitterUB(), this.submitterAnchor(), newSubmitter)
this.submitterService.postLink(this.submitterUB(), this.submitterAnchor(), newSubmitter)
.subscribe((submitter: ApiSubmitter) => this.refreshSubmitter(submitter));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { MatDialog } from '@angular/material';
import { HasAttributeList } from '../../interfaces';
import { NoteCreator } from '../../bases';
import { ApiObject, ApiNote, ApiAttribute, LinkDialogData, LinkItem } from '../../models';
import { NoteService, NewNoteLinkService, ServiceBase } from '../../services';
import { NoteService } from '../../services';
import { UrlBuilder, NewNoteHelper, ApiComparators, LinkHelper, Refresher, LinkDialogLauncher, UnlinkHelper } from '../../utils';

@Component({
Expand All @@ -16,12 +16,8 @@ export class NoteButtonComponent extends NoteCreator {
@Input() parent: HasAttributeList;
@Input() dataset: string;

constructor(
public service: NoteService,
public newNoteLinkService: NewNoteLinkService,
public dialog: MatDialog,
) {
super(newNoteLinkService, dialog);
constructor(public service: NoteService, public dialog: MatDialog) {
super(service, dialog);
}

noteUB(): UrlBuilder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { MatDialog } from '@angular/material';
import { HasAttributeList } from '../../interfaces';
import { SourceCreator } from '../../bases';
import { ApiObject, ApiSource, ApiAttribute, LinkDialogData, LinkItem } from '../../models';
import { SourceService, NewSourceLinkService, ServiceBase } from '../../services';
import { SourceService } from '../../services';
import { UrlBuilder, NewSourceHelper, ApiComparators, LinkHelper, Refresher, LinkDialogLauncher, UnlinkHelper } from '../../utils';

@Component({
Expand All @@ -18,10 +18,9 @@ export class SourceButtonComponent extends SourceCreator {

constructor(
public service: SourceService,
public newSourceLinkService: NewSourceLinkService,
public dialog: MatDialog,
) {
super(newSourceLinkService, dialog);
super(service, dialog);
}

sourceUB(): UrlBuilder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { MatDialog } from '@angular/material';
import { HasAttributeList } from '../../interfaces';
import { SubmitterCreator } from '../../bases';
import { ApiObject, ApiSubmitter, ApiAttribute, LinkDialogData, LinkItem } from '../../models';
import { SubmitterService, NewSubmitterLinkService } from '../../services';
import { SubmitterService } from '../../services';
import { UrlBuilder, NewSubmitterHelper, ApiComparators, LinkHelper, Refresher, LinkDialogLauncher, UnlinkHelper } from '../../utils';

@Component({
Expand All @@ -18,10 +18,9 @@ export class SubmitterButtonComponent extends SubmitterCreator {

constructor(
public service: SubmitterService,
public newSubmitterLinkService: NewSubmitterLinkService,
public dialog: MatDialog,
) {
super(newSubmitterLinkService, dialog);
super(service, dialog);
}

submitterUB(): UrlBuilder {
Expand Down
1 change: 0 additions & 1 deletion gedbrowserng-frontend/src/app/modules/note-list/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export * from './note-list-page.component';
export * from './note-list.component';
export * from './note-list-item.component';
export * from './note-list-resolver.service';
export * from './note-list.module';

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1,3 @@

.inner-card {
padding: 0;
}
Loading

0 comments on commit f2a768d

Please sign in to comment.