From: Bill Erickson Date: Tue, 10 Nov 2020 16:10:44 +0000 (-0500) Subject: LP1901930 SIP account admin UI WIP X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=c1c6567c6b01458679d4e9254e8a374263e4f907;p=working%2FEvergreen.git LP1901930 SIP account admin UI WIP Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index 75d637f26a..78776fcd16 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -13463,7 +13463,7 @@ SELECT usr, reporter:label="SIP Settings"> - + diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/routing.module.ts b/Open-ILS/src/eg2/src/app/staff/admin/server/routing.module.ts index 194a979052..cae28a0788 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/server/routing.module.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/server/routing.module.ts @@ -42,6 +42,10 @@ const routes: Routes = [{ data: [{schema: 'asset', table: 'call_number_suffix', readonlyFields: 'label_sortkey'}] }, { + path: 'sip/account', + loadChildren: () => + import('./sip/account.module').then(m => m.SipAccountModule) +}, { path: ':schema/:table', component: BasicAdminPageComponent }]; diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/sip/account-list.component.html b/Open-ILS/src/eg2/src/app/staff/admin/server/sip/account-list.component.html new file mode 100644 index 0000000000..a0aa75590a --- /dev/null +++ b/Open-ILS/src/eg2/src/app/staff/admin/server/sip/account-list.component.html @@ -0,0 +1,18 @@ + + +account list + + + + + + + diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/sip/account-list.component.ts b/Open-ILS/src/eg2/src/app/staff/admin/server/sip/account-list.component.ts new file mode 100644 index 0000000000..01889900b6 --- /dev/null +++ b/Open-ILS/src/eg2/src/app/staff/admin/server/sip/account-list.component.ts @@ -0,0 +1,56 @@ +import {Component, Input, ViewChild, OnInit} from '@angular/core'; +import {Router} from '@angular/router'; +import {Observable, of} from 'rxjs'; +import {IdlService, IdlObject} from '@eg/core/idl.service'; +import {OrgService} from '@eg/core/org.service'; +import {AuthService} from '@eg/core/auth.service'; +import {PcrudService} from '@eg/core/pcrud.service'; +import {ToastService} from '@eg/share/toast/toast.service'; +import {StringComponent} from '@eg/share/string/string.component'; +import {StringService} from '@eg/share/string/string.service'; +import {ConfirmDialogComponent} from '@eg/share/dialog/confirm.component'; +import {FmRecordEditorComponent} from '@eg/share/fm-editor/fm-editor.component'; +import {ComboboxEntry} from '@eg/share/combobox/combobox.component'; +import {GridDataSource} from '@eg/share/grid/grid'; +import {Pager} from '@eg/share/util/pager'; + +@Component({ + templateUrl: './account-list.component.html' +}) +export class SipAccountListComponent implements OnInit { + + gridSource: GridDataSource = new GridDataSource(); + + constructor( + private router: Router, + private pcrud: PcrudService + ) {} + + ngOnInit() { + + this.gridSource.getRows = (pager: Pager, sort: any[]) => { + return this.fetchAccounts(pager, sort); + } + } + + fetchAccounts(pager: Pager, sort: any[]): Observable { + + const orderBy: any = {sisacc: 'sip_username'}; + if (sort.length) { + orderBy.sisacc = sort[0].name + ' ' + sort[0].dir; + } + + return this.pcrud.retrieveAll('sipacc', { + offset: pager.offset, + limit: pager.limit, + order_by: orderBy, + flesh: 1, + flesh_fields: {sipacc: ['usr', 'setting_group', 'workstation']} + }); + } + + openAccount(row: any) { + this.router.navigate([`/staff/admin/server/sip/account/${row.id()}`]); + } +} + diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/sip/account.component.html b/Open-ILS/src/eg2/src/app/staff/admin/server/sip/account.component.html new file mode 100644 index 0000000000..a395f1e84e --- /dev/null +++ b/Open-ILS/src/eg2/src/app/staff/admin/server/sip/account.component.html @@ -0,0 +1,2 @@ + +account diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/sip/account.component.ts b/Open-ILS/src/eg2/src/app/staff/admin/server/sip/account.component.ts new file mode 100644 index 0000000000..5e17854e81 --- /dev/null +++ b/Open-ILS/src/eg2/src/app/staff/admin/server/sip/account.component.ts @@ -0,0 +1,21 @@ +import {Component, Input, ViewChild, OnInit} from '@angular/core'; +import {IdlService, IdlObject} from '@eg/core/idl.service'; +import {OrgService} from '@eg/core/org.service'; +import {AuthService} from '@eg/core/auth.service'; +import {PcrudService} from '@eg/core/pcrud.service'; +import {ToastService} from '@eg/share/toast/toast.service'; +import {StringComponent} from '@eg/share/string/string.component'; +import {StringService} from '@eg/share/string/string.service'; +import {ConfirmDialogComponent} from '@eg/share/dialog/confirm.component'; +import {FmRecordEditorComponent} from '@eg/share/fm-editor/fm-editor.component'; +import {ComboboxEntry} from '@eg/share/combobox/combobox.component'; + +@Component({ + templateUrl: './account.component.html' +}) +export class SipAccountComponent implements OnInit { + + ngOnInit() { + } +} + diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/sip/account.module.ts b/Open-ILS/src/eg2/src/app/staff/admin/server/sip/account.module.ts new file mode 100644 index 0000000000..5ab590fc6b --- /dev/null +++ b/Open-ILS/src/eg2/src/app/staff/admin/server/sip/account.module.ts @@ -0,0 +1,25 @@ +import {NgModule} from '@angular/core'; +import {AdminCommonModule} from '@eg/staff/admin/common.module'; +import {SipAccountRoutingModule} from './routing.module'; +import {SipAccountListComponent} from './account-list.component'; +import {SipAccountComponent} from './account.component'; + +@NgModule({ + declarations: [ + SipAccountComponent, + SipAccountListComponent + ], + imports: [ + AdminCommonModule, + SipAccountRoutingModule + ], + exports: [ + ], + providers: [ + ] +}) + +export class SipAccountModule { +} + + diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/sip/routing.module.ts b/Open-ILS/src/eg2/src/app/staff/admin/server/sip/routing.module.ts new file mode 100644 index 0000000000..ee6f41d041 --- /dev/null +++ b/Open-ILS/src/eg2/src/app/staff/admin/server/sip/routing.module.ts @@ -0,0 +1,20 @@ +import {NgModule} from '@angular/core'; +import {RouterModule, Routes} from '@angular/router'; +import {SipAccountListComponent} from './account-list.component'; +import {SipAccountComponent} from './account.component'; + +const routes: Routes = [{ + path: '', + component: SipAccountListComponent +}, { + path: ':id', + component: SipAccountComponent +}]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) + +export class SipAccountRoutingModule {} +