Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

primeng: acquisitions accounts #1247

Open
wants to merge 1 commit into
base: next-version
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 23 additions & 6 deletions projects/admin/src/app/acquisition/acquisition-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,33 @@ import { AccountListComponent } from './components/account/account-list/account-
import { AccountTransferComponent } from './components/account/account-transfer/account-transfer.component';
import { OrderReceiptViewComponent } from './components/receipt/receipt-form/order-receipt-view.component';
import { CanOrderReceiptGuard } from './routes/guards/can-order-receipt.guard';
import { AcquisitionMainComponent } from './components/acquisition-main/acquisition-main.component';

const routes: Routes = [
{ path: '', redirectTo: 'accounts', pathMatch: 'full' },
{ path: 'accounts/transfer', component: AccountTransferComponent, canActivate: [ PermissionGuard ], data: { permissions: [ PERMISSIONS.ACAC_TRANSFER ] } },
{ path: 'accounts', component: AccountListComponent, canActivate: [ PermissionGuard ], data: { permissions: [ PERMISSIONS.ACAC_ACCESS, PERMISSIONS.ACAC_SEARCH ], operator: PERMISSION_OPERATOR.AND } },
{ path: 'acq_orders/:pid/receive', component: OrderReceiptViewComponent, canActivate: [ CanOrderReceiptGuard ] }
{
path: '',
component: AcquisitionMainComponent,
children: [
{ path: '', redirectTo: 'accounts', pathMatch: 'full' },
{
path: 'accounts/transfer',
component: AccountTransferComponent,
canActivate: [PermissionGuard],
data: { permissions: [PERMISSIONS.ACAC_TRANSFER] },
},
{
path: 'accounts',
component: AccountListComponent,
canActivate: [PermissionGuard],
data: { permissions: [PERMISSIONS.ACAC_ACCESS, PERMISSIONS.ACAC_SEARCH], operator: PERMISSION_OPERATOR.AND },
},
{ path: 'acq_orders/:pid/receive', component: OrderReceiptViewComponent, canActivate: [CanOrderReceiptGuard] },
],
},
];

@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
exports: [RouterModule],
})
export class AcquisitionRoutingModule { }
export class AcquisitionRoutingModule {}
7 changes: 3 additions & 4 deletions projects/admin/src/app/acquisition/acquisition.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import { PreviewEmailModule } from '../shared/preview-email/preview-email.module
import { AcquisitionRoutingModule } from './acquisition-routing.module';
import { AcqAccountApiService } from './api/acq-account-api.service';
import { AcqOrderApiService } from './api/acq-order-api.service';
import { AccountBriefViewComponent } from './components/account/account-brief-view/account-brief-view.component';
import { AccountDetailViewComponent } from './components/account/account-detail-view/account-detail-view.component';
import { AccountListComponent } from './components/account/account-list/account-list.component';
import { AccountTransferComponent } from './components/account/account-transfer/account-transfer.component';
Expand Down Expand Up @@ -57,14 +56,13 @@ import { NoteBadgeColorPipe } from './pipes/note-badge-color.pipe';
import { PreviewContentPipe } from './pipes/preview-content.pipe';
import { ReceiptLineTotalAmountPipe } from './pipes/receipt-line-total-amount.pipe';
import { ReceptionDatesPipe } from './pipes/reception-dates.pipe';
import { ChipsModule } from 'primeng/chips';
import { PrimengImportModule } from '../shared/primeng-import/primeng-import.module';
import { NotesComponent } from './components/notes/notes.component';
import { AcquisitionMainComponent } from './components/acquisition-main/acquisition-main.component';

@NgModule({
declarations: [
AccountListComponent,
AccountBriefViewComponent,
AccountTransferComponent,
AccountDetailViewComponent,
BudgetsBriefViewComponent,
Expand All @@ -89,7 +87,8 @@ import { NotesComponent } from './components/notes/notes.component';
PreviewContentPipe,
ReceiptLineTotalAmountPipe,
OrderEmailFormComponent,
NotesComponent
NotesComponent,
AcquisitionMainComponent
],
imports: [
CommonModule,
Expand Down
138 changes: 0 additions & 138 deletions projects/admin/src/app/acquisition/acquisition.scss

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export class AcqAccountApiService {
const query = defaultQueryParams.join(' AND ');
options = { ...{sort: 'name'}, ...options }; // add some default params
return this.recordService
.getRecords(this.resourceName, query, 1, RecordService.MAX_REST_RESULTS_SIZE, undefined, undefined, undefined, options.sort)
.getRecords(this.resourceName, query, 1, RecordService.MAX_REST_RESULTS_SIZE, undefined, undefined, {'Accept': 'application/rero+json'}, options.sort)
.pipe(
map((result: Record) => this.recordService.totalHits(result.hits.total) === 0 ? [] : result.hits.hits),
map((hits: any[]) => hits.map(hit => ({...this.accountDefaultData, ...hit.metadata}) ))
Expand Down
1 change: 1 addition & 0 deletions projects/admin/src/app/acquisition/classes/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,5 @@ export interface IAcqAccount extends IAcqBaseResource {
distribution: number;
budget: IObjectReference;
parent: IObjectReference;
number_of_children?: number;
}

This file was deleted.

Loading
Loading