ngx-st-sap-installed-instruments 19.0.0 → 20.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +483 -483
- package/assets/group-details.scss +37 -37
- package/fesm2022/ngx-st-sap-installed-instruments.mjs +262 -279
- package/fesm2022/ngx-st-sap-installed-instruments.mjs.map +1 -1
- package/index.d.ts +543 -5
- package/package.json +7 -7
- package/lib/base-interfaces.d.ts +0 -8
- package/lib/components/sap-installed-instrument-details/activities-list-view/activities-list-view.component.d.ts +0 -20
- package/lib/components/sap-installed-instrument-details/activity-details-view/activity-details-view.component.d.ts +0 -10
- package/lib/components/sap-installed-instrument-details/attachments-list-view/attachments-list-view.component.d.ts +0 -15
- package/lib/components/sap-installed-instrument-details/call-details-view/call-details-view.component.d.ts +0 -23
- package/lib/components/sap-installed-instrument-details/calls-list-view/calls-list-view.component.d.ts +0 -20
- package/lib/components/sap-installed-instrument-details/data-details-view/data-details-view.component.d.ts +0 -9
- package/lib/components/sap-installed-instrument-details/sap-installed-instrument-details.component.d.ts +0 -27
- package/lib/components/sap-installed-instrument-details/service-contract-details-view/service-contract-details-view.component.d.ts +0 -7
- package/lib/components/sap-installed-instrument-details/service-contracts-list-view/service-contracts-list-view.component.d.ts +0 -17
- package/lib/components/sap-installed-instrument-details/service-contracts-modal-details-view/service-contracts-modal-details-view.component.d.ts +0 -12
- package/lib/components/sap-installed-instrument-list/sap-installed-instrument-list-search/sap-installed-instrument-list-search.component.d.ts +0 -53
- package/lib/components/sap-installed-instrument-list/sap-installed-instrument-list-table/sap-installed-instrument-list-table.component.d.ts +0 -36
- package/lib/components/sap-installed-instrument-list/sap-installed-instrument-list.component.d.ts +0 -24
- package/lib/models/installed-instrument-form.model.d.ts +0 -20
- package/lib/models/installed-instrument-sort-by-column.enum.d.ts +0 -13
- package/lib/models/installed-instrument-sort-order.enum.d.ts +0 -4
- package/lib/models/installed-instrument-table-columns.model.d.ts +0 -14
- package/lib/models/sap-activity.model.d.ts +0 -24
- package/lib/models/sap-attachment.model.d.ts +0 -7
- package/lib/models/sap-call.model.d.ts +0 -37
- package/lib/models/sap-contract.model.d.ts +0 -20
- package/lib/models/sap-country.model.d.ts +0 -4
- package/lib/models/sap-installed-instrument-list.model.d.ts +0 -24
- package/lib/models/sap-installed-instrument-search.model.d.ts +0 -23
- package/lib/models/sap-installed-instrument.model.d.ts +0 -54
- package/lib/models/sap-state.model.d.ts +0 -5
- package/lib/models/sap-territory.model.d.ts +0 -4
- package/lib/models/view-sap-installed-instrument-list.model.d.ts +0 -4
- package/lib/ngx-st-sap-installed-instruments.module.d.ts +0 -52
- package/lib/services/sap-installed-instruments.service.d.ts +0 -33
- package/public-api.d.ts +0 -28
package/README.md
CHANGED
|
@@ -1,483 +1,483 @@
|
|
|
1
|
-
# NgxStSapInstalledInstruments
|
|
2
|
-
|
|
3
|
-
Angular components for displaying and managing SAP installed instruments (equipment) with details, service contracts, and activities.
|
|
4
|
-
|
|
5
|
-
## Table of Contents
|
|
6
|
-
- [Overview](#overview)
|
|
7
|
-
- [Installation](#installation)
|
|
8
|
-
- [Components](#components)
|
|
9
|
-
- [Examples](#examples)
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## Overview
|
|
14
|
-
|
|
15
|
-
The `ngx-st-sap-installed-instruments` library provides components for managing installed instruments/equipment in SAP including:
|
|
16
|
-
- Searchable list of installed instruments
|
|
17
|
-
- Detailed instrument information
|
|
18
|
-
- Service contracts view
|
|
19
|
-
- Service calls and activities
|
|
20
|
-
- Attachments management
|
|
21
|
-
- Territory filtering
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
## Installation
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
npm install ngx-st-sap-installed-instruments
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
Import the module in your application:
|
|
32
|
-
|
|
33
|
-
```typescript
|
|
34
|
-
import { NgxStSapInstalledInstrumentsModule } from 'ngx-st-sap-installed-instruments';
|
|
35
|
-
|
|
36
|
-
@NgModule({
|
|
37
|
-
imports: [
|
|
38
|
-
NgxStSapInstalledInstrumentsModule
|
|
39
|
-
]
|
|
40
|
-
})
|
|
41
|
-
export class AppModule { }
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
---
|
|
45
|
-
|
|
46
|
-
## Components
|
|
47
|
-
|
|
48
|
-
### SapInstalledInstrumentList
|
|
49
|
-
|
|
50
|
-
Main component displaying searchable list of installed instruments.
|
|
51
|
-
|
|
52
|
-
#### Selector
|
|
53
|
-
```html
|
|
54
|
-
<app-sap-installed-instrument-list></app-sap-installed-instrument-list>
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
#### Inputs
|
|
58
|
-
|
|
59
|
-
##### `accessToken`
|
|
60
|
-
- **Type:** `string`
|
|
61
|
-
- **Description:** Authentication token for API requests.
|
|
62
|
-
- **Example:**
|
|
63
|
-
```typescript
|
|
64
|
-
[accessToken]="authToken"
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
##### `territoryFilter` (required)
|
|
68
|
-
- **Type:** `boolean`
|
|
69
|
-
- **Description:** When true, filters instruments by user's territory.
|
|
70
|
-
- **Example:**
|
|
71
|
-
```typescript
|
|
72
|
-
[territoryFilter]="true"
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
##### `showWithCardContent`
|
|
76
|
-
- **Type:** `boolean`
|
|
77
|
-
- **Default:** `true`
|
|
78
|
-
- **Description:** Wraps the component in a Material card.
|
|
79
|
-
- **Example:**
|
|
80
|
-
```typescript
|
|
81
|
-
[showWithCardContent]="false"
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
##### `useMapButton`
|
|
85
|
-
- **Type:** `boolean`
|
|
86
|
-
- **Default:** `false`
|
|
87
|
-
- **Description:** Shows a map button for location visualization.
|
|
88
|
-
- **Example:**
|
|
89
|
-
```typescript
|
|
90
|
-
[useMapButton]="true"
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
#### Features
|
|
94
|
-
- Search by multiple criteria:
|
|
95
|
-
- Customer name
|
|
96
|
-
- Instrument serial number
|
|
97
|
-
- Item code
|
|
98
|
-
- Installation date range
|
|
99
|
-
- Sort by various fields
|
|
100
|
-
- Territory-based filtering
|
|
101
|
-
- Pagination
|
|
102
|
-
- Direct navigation to details
|
|
103
|
-
- URL query parameter persistence
|
|
104
|
-
|
|
105
|
-
#### Example
|
|
106
|
-
|
|
107
|
-
```html
|
|
108
|
-
<app-sap-installed-instrument-list
|
|
109
|
-
[accessToken]="token"
|
|
110
|
-
[territoryFilter]="true"
|
|
111
|
-
[showWithCardContent]="true"
|
|
112
|
-
[useMapButton]="false">
|
|
113
|
-
</app-sap-installed-instrument-list>
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
```typescript
|
|
117
|
-
export class InstrumentsComponent {
|
|
118
|
-
token = this.authService.getAccessToken();
|
|
119
|
-
}
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
---
|
|
123
|
-
|
|
124
|
-
### SapInstalledInstrumentListTable
|
|
125
|
-
|
|
126
|
-
Table component showing the list of instruments.
|
|
127
|
-
|
|
128
|
-
Used internally by SapInstalledInstrumentList but can be used standalone.
|
|
129
|
-
|
|
130
|
-
#### Features
|
|
131
|
-
- Sortable columns
|
|
132
|
-
- Clickable rows for navigation
|
|
133
|
-
- Display key information:
|
|
134
|
-
- Customer name
|
|
135
|
-
- Item code and description
|
|
136
|
-
- Serial number
|
|
137
|
-
- Internal serial number
|
|
138
|
-
- Installation date
|
|
139
|
-
- Status
|
|
140
|
-
|
|
141
|
-
---
|
|
142
|
-
|
|
143
|
-
### SapInstalledInstrumentListSearch
|
|
144
|
-
|
|
145
|
-
Search form component for filtering instruments.
|
|
146
|
-
|
|
147
|
-
Used internally by SapInstalledInstrumentList.
|
|
148
|
-
|
|
149
|
-
#### Features
|
|
150
|
-
- Customer search
|
|
151
|
-
- Serial number search
|
|
152
|
-
- Item code search
|
|
153
|
-
- Date range picker for installation date
|
|
154
|
-
- Clear filters button
|
|
155
|
-
- Form validation
|
|
156
|
-
|
|
157
|
-
---
|
|
158
|
-
|
|
159
|
-
### SapInstalledInstrumentDetails
|
|
160
|
-
|
|
161
|
-
Detailed view of a single installed instrument.
|
|
162
|
-
|
|
163
|
-
#### Selector
|
|
164
|
-
```html
|
|
165
|
-
<app-sap-installed-instrument-details></app-sap-installed-instrument-details>
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
#### Features
|
|
169
|
-
- Complete instrument information
|
|
170
|
-
- Service contracts section
|
|
171
|
-
- Service calls list
|
|
172
|
-
- Activities log
|
|
173
|
-
- Attachments
|
|
174
|
-
- Tabbed interface
|
|
175
|
-
|
|
176
|
-
---
|
|
177
|
-
|
|
178
|
-
### DataDetailsView
|
|
179
|
-
|
|
180
|
-
Displays the core data of the installed instrument.
|
|
181
|
-
|
|
182
|
-
#### Features
|
|
183
|
-
- Customer information
|
|
184
|
-
- Item details
|
|
185
|
-
- Serial numbers
|
|
186
|
-
- Installation date
|
|
187
|
-
- Location information
|
|
188
|
-
- Status
|
|
189
|
-
- Notes
|
|
190
|
-
|
|
191
|
-
---
|
|
192
|
-
|
|
193
|
-
### ServiceContractsListView
|
|
194
|
-
|
|
195
|
-
Shows active and historical service contracts.
|
|
196
|
-
|
|
197
|
-
#### Features
|
|
198
|
-
- Contract number and description
|
|
199
|
-
- Start and end dates
|
|
200
|
-
- Contract status
|
|
201
|
-
- Coverage details
|
|
202
|
-
- Link to contract details
|
|
203
|
-
|
|
204
|
-
---
|
|
205
|
-
|
|
206
|
-
### ServiceContractDetailsView
|
|
207
|
-
|
|
208
|
-
Detailed view of a single service contract.
|
|
209
|
-
|
|
210
|
-
---
|
|
211
|
-
|
|
212
|
-
### CallsListView
|
|
213
|
-
|
|
214
|
-
Displays service calls related to the instrument.
|
|
215
|
-
|
|
216
|
-
#### Features
|
|
217
|
-
- Call ID and subject
|
|
218
|
-
- Priority level
|
|
219
|
-
- Status
|
|
220
|
-
- Assigned technician
|
|
221
|
-
- Creation and resolution dates
|
|
222
|
-
- Call description
|
|
223
|
-
|
|
224
|
-
---
|
|
225
|
-
|
|
226
|
-
### CallDetailsView
|
|
227
|
-
|
|
228
|
-
Detailed view of a service call.
|
|
229
|
-
|
|
230
|
-
---
|
|
231
|
-
|
|
232
|
-
### ActivitiesListView
|
|
233
|
-
|
|
234
|
-
Shows activities/notes related to the instrument.
|
|
235
|
-
|
|
236
|
-
#### Features
|
|
237
|
-
- Activity type
|
|
238
|
-
- Date and time
|
|
239
|
-
- Performed by
|
|
240
|
-
- Description
|
|
241
|
-
- Duration
|
|
242
|
-
|
|
243
|
-
---
|
|
244
|
-
|
|
245
|
-
### ActivityDetailsView
|
|
246
|
-
|
|
247
|
-
Detailed view of a single activity.
|
|
248
|
-
|
|
249
|
-
---
|
|
250
|
-
|
|
251
|
-
### AttachmentsListView
|
|
252
|
-
|
|
253
|
-
Displays and manages attachments for the instrument.
|
|
254
|
-
|
|
255
|
-
Uses the `ngx-st-attachments` component internally.
|
|
256
|
-
|
|
257
|
-
---
|
|
258
|
-
|
|
259
|
-
## Examples
|
|
260
|
-
|
|
261
|
-
### Basic Instrument List
|
|
262
|
-
|
|
263
|
-
```html
|
|
264
|
-
<div class="instruments-page">
|
|
265
|
-
<h1>Installed Instruments</h1>
|
|
266
|
-
|
|
267
|
-
<app-sap-installed-instrument-list
|
|
268
|
-
[accessToken]="accessToken"
|
|
269
|
-
[territoryFilter]="true">
|
|
270
|
-
</app-sap-installed-instrument-list>
|
|
271
|
-
</div>
|
|
272
|
-
```
|
|
273
|
-
|
|
274
|
-
```typescript
|
|
275
|
-
export class InstrumentsPageComponent {
|
|
276
|
-
accessToken: string;
|
|
277
|
-
|
|
278
|
-
constructor(private authService: AuthService) {
|
|
279
|
-
this.accessToken = this.authService.getToken();
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
```
|
|
283
|
-
|
|
284
|
-
### With Map Integration
|
|
285
|
-
|
|
286
|
-
```html
|
|
287
|
-
<app-sap-installed-instrument-list
|
|
288
|
-
[accessToken]="accessToken"
|
|
289
|
-
[territoryFilter]="false"
|
|
290
|
-
[useMapButton]="true">
|
|
291
|
-
</app-sap-installed-instrument-list>
|
|
292
|
-
```
|
|
293
|
-
|
|
294
|
-
### Without Card Wrapper (Custom Layout)
|
|
295
|
-
|
|
296
|
-
```html
|
|
297
|
-
<mat-card class="custom-instruments-card">
|
|
298
|
-
<mat-card-header>
|
|
299
|
-
<mat-card-title>Equipment List</mat-card-title>
|
|
300
|
-
<mat-card-subtitle>All installed instruments</mat-card-subtitle>
|
|
301
|
-
</mat-card-header>
|
|
302
|
-
|
|
303
|
-
<mat-card-content>
|
|
304
|
-
<app-sap-installed-instrument-list
|
|
305
|
-
[accessToken]="accessToken"
|
|
306
|
-
[territoryFilter]="filterByTerritory"
|
|
307
|
-
[showWithCardContent]="false">
|
|
308
|
-
</app-sap-installed-instrument-list>
|
|
309
|
-
</mat-card-content>
|
|
310
|
-
</mat-card>
|
|
311
|
-
```
|
|
312
|
-
|
|
313
|
-
### Instrument Details Page
|
|
314
|
-
|
|
315
|
-
```html
|
|
316
|
-
<div class="instrument-details-page">
|
|
317
|
-
<mat-toolbar>
|
|
318
|
-
<button mat-icon-button (click)="goBack()">
|
|
319
|
-
<mat-icon>arrow_back</mat-icon>
|
|
320
|
-
</button>
|
|
321
|
-
<span>Instrument Details</span>
|
|
322
|
-
</mat-toolbar>
|
|
323
|
-
|
|
324
|
-
<app-sap-installed-instrument-details
|
|
325
|
-
[instrumentId]="instrumentId">
|
|
326
|
-
</app-sap-installed-instrument-details>
|
|
327
|
-
</div>
|
|
328
|
-
```
|
|
329
|
-
|
|
330
|
-
```typescript
|
|
331
|
-
export class InstrumentDetailsComponent implements OnInit {
|
|
332
|
-
instrumentId: string;
|
|
333
|
-
|
|
334
|
-
constructor(
|
|
335
|
-
private route: ActivatedRoute,
|
|
336
|
-
private location: Location
|
|
337
|
-
) {}
|
|
338
|
-
|
|
339
|
-
ngOnInit() {
|
|
340
|
-
this.instrumentId = this.route.snapshot.params['id'];
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
goBack() {
|
|
344
|
-
this.location.back();
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
```
|
|
348
|
-
|
|
349
|
-
### With Territory Filter Toggle
|
|
350
|
-
|
|
351
|
-
```html
|
|
352
|
-
<div class="instruments-with-filter">
|
|
353
|
-
<mat-toolbar>
|
|
354
|
-
<span>Installed Instruments</span>
|
|
355
|
-
<span class="toolbar-spacer"></span>
|
|
356
|
-
<mat-slide-toggle
|
|
357
|
-
[(ngModel)]="filterByTerritory"
|
|
358
|
-
(change)="onFilterChange()">
|
|
359
|
-
My Territory Only
|
|
360
|
-
</mat-slide-toggle>
|
|
361
|
-
</mat-toolbar>
|
|
362
|
-
|
|
363
|
-
<app-sap-installed-instrument-list
|
|
364
|
-
[accessToken]="accessToken"
|
|
365
|
-
[territoryFilter]="filterByTerritory">
|
|
366
|
-
</app-sap-installed-instrument-list>
|
|
367
|
-
</div>
|
|
368
|
-
```
|
|
369
|
-
|
|
370
|
-
```typescript
|
|
371
|
-
export class InstrumentsComponent {
|
|
372
|
-
accessToken: string;
|
|
373
|
-
filterByTerritory = true;
|
|
374
|
-
|
|
375
|
-
constructor(private authService: AuthService) {
|
|
376
|
-
this.accessToken = this.authService.getToken();
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
onFilterChange() {
|
|
380
|
-
console.log('Territory filter:', this.filterByTerritory);
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
```
|
|
384
|
-
|
|
385
|
-
### Complete Page with Search Persistence
|
|
386
|
-
|
|
387
|
-
The component automatically saves search filters and sorting to URL query parameters, allowing users to bookmark or share specific searches.
|
|
388
|
-
|
|
389
|
-
```typescript
|
|
390
|
-
export class InstrumentsComponent {
|
|
391
|
-
// Component automatically reads from URL on init
|
|
392
|
-
// Example URL: /instruments?customerName=ABC&serialNumber=12345&active=asc
|
|
393
|
-
}
|
|
394
|
-
```
|
|
395
|
-
|
|
396
|
-
### Custom Routing Configuration
|
|
397
|
-
|
|
398
|
-
```typescript
|
|
399
|
-
const routes: Routes = [
|
|
400
|
-
{
|
|
401
|
-
path: 'instruments',
|
|
402
|
-
component: InstrumentsListComponent
|
|
403
|
-
},
|
|
404
|
-
{
|
|
405
|
-
path: 'instruments/:id',
|
|
406
|
-
component: InstrumentDetailsComponent
|
|
407
|
-
}
|
|
408
|
-
];
|
|
409
|
-
```
|
|
410
|
-
|
|
411
|
-
---
|
|
412
|
-
|
|
413
|
-
## Features
|
|
414
|
-
|
|
415
|
-
### Smart Search
|
|
416
|
-
- Multiple search criteria
|
|
417
|
-
- Date range filtering
|
|
418
|
-
- Real-time filtering
|
|
419
|
-
- Search persistence in URL
|
|
420
|
-
|
|
421
|
-
### Sorting
|
|
422
|
-
- Sort by any column
|
|
423
|
-
- Ascending/descending
|
|
424
|
-
- Sort state persistence
|
|
425
|
-
|
|
426
|
-
### Territory Filtering
|
|
427
|
-
- Filter by user's assigned territory
|
|
428
|
-
- Optional - can show all instruments
|
|
429
|
-
- Useful for sales organizations
|
|
430
|
-
|
|
431
|
-
### Navigation
|
|
432
|
-
- Click any row to view details
|
|
433
|
-
- Browser back button support
|
|
434
|
-
- Shareable URLs with search state
|
|
435
|
-
|
|
436
|
-
### Responsive Design
|
|
437
|
-
- Card-based layout
|
|
438
|
-
- Mobile-friendly
|
|
439
|
-
- Responsive table
|
|
440
|
-
|
|
441
|
-
---
|
|
442
|
-
|
|
443
|
-
## Data Models
|
|
444
|
-
|
|
445
|
-
### SapInstalledInstrumentListModel
|
|
446
|
-
|
|
447
|
-
```typescript
|
|
448
|
-
interface SapInstalledInstrumentListModel {
|
|
449
|
-
insID: number; // Instrument ID
|
|
450
|
-
itemCode: string; // Item code
|
|
451
|
-
itemName: string; // Item description
|
|
452
|
-
manufacturerSerialNumber: string; // Serial number
|
|
453
|
-
internalSerialNum: string; // Internal serial number
|
|
454
|
-
customer: string; // Customer name
|
|
455
|
-
customerCode: string; // Customer code
|
|
456
|
-
installDate: Date; // Installation date
|
|
457
|
-
statusOfSerialNumber: string; // Status
|
|
458
|
-
location: string; // Installation location
|
|
459
|
-
}
|
|
460
|
-
```
|
|
461
|
-
|
|
462
|
-
### InstalledInstrumentFormModel
|
|
463
|
-
|
|
464
|
-
```typescript
|
|
465
|
-
interface InstalledInstrumentFormModel {
|
|
466
|
-
customerName?: string;
|
|
467
|
-
serialNumber?: string;
|
|
468
|
-
itemCode?: string;
|
|
469
|
-
installationDateFrom?: Date;
|
|
470
|
-
installationDateTo?: Date;
|
|
471
|
-
}
|
|
472
|
-
```
|
|
473
|
-
|
|
474
|
-
---
|
|
475
|
-
|
|
476
|
-
## Build
|
|
477
|
-
|
|
478
|
-
Run `ng build ngx-st-sap-installed-instruments` to build the project. The build artifacts will be stored in the `dist/` directory.
|
|
479
|
-
|
|
480
|
-
## Publishing
|
|
481
|
-
|
|
482
|
-
After building your library with `ng build ngx-st-sap-installed-instruments`, go to the dist folder `cd dist/ngx-st-sap-installed-instruments` and run `npm publish`.
|
|
483
|
-
|
|
1
|
+
# NgxStSapInstalledInstruments
|
|
2
|
+
|
|
3
|
+
Angular components for displaying and managing SAP installed instruments (equipment) with details, service contracts, and activities.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
- [Overview](#overview)
|
|
7
|
+
- [Installation](#installation)
|
|
8
|
+
- [Components](#components)
|
|
9
|
+
- [Examples](#examples)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Overview
|
|
14
|
+
|
|
15
|
+
The `ngx-st-sap-installed-instruments` library provides components for managing installed instruments/equipment in SAP including:
|
|
16
|
+
- Searchable list of installed instruments
|
|
17
|
+
- Detailed instrument information
|
|
18
|
+
- Service contracts view
|
|
19
|
+
- Service calls and activities
|
|
20
|
+
- Attachments management
|
|
21
|
+
- Territory filtering
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Installation
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install ngx-st-sap-installed-instruments
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Import the module in your application:
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
import { NgxStSapInstalledInstrumentsModule } from 'ngx-st-sap-installed-instruments';
|
|
35
|
+
|
|
36
|
+
@NgModule({
|
|
37
|
+
imports: [
|
|
38
|
+
NgxStSapInstalledInstrumentsModule
|
|
39
|
+
]
|
|
40
|
+
})
|
|
41
|
+
export class AppModule { }
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Components
|
|
47
|
+
|
|
48
|
+
### SapInstalledInstrumentList
|
|
49
|
+
|
|
50
|
+
Main component displaying searchable list of installed instruments.
|
|
51
|
+
|
|
52
|
+
#### Selector
|
|
53
|
+
```html
|
|
54
|
+
<app-sap-installed-instrument-list></app-sap-installed-instrument-list>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
#### Inputs
|
|
58
|
+
|
|
59
|
+
##### `accessToken`
|
|
60
|
+
- **Type:** `string`
|
|
61
|
+
- **Description:** Authentication token for API requests.
|
|
62
|
+
- **Example:**
|
|
63
|
+
```typescript
|
|
64
|
+
[accessToken]="authToken"
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
##### `territoryFilter` (required)
|
|
68
|
+
- **Type:** `boolean`
|
|
69
|
+
- **Description:** When true, filters instruments by user's territory.
|
|
70
|
+
- **Example:**
|
|
71
|
+
```typescript
|
|
72
|
+
[territoryFilter]="true"
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
##### `showWithCardContent`
|
|
76
|
+
- **Type:** `boolean`
|
|
77
|
+
- **Default:** `true`
|
|
78
|
+
- **Description:** Wraps the component in a Material card.
|
|
79
|
+
- **Example:**
|
|
80
|
+
```typescript
|
|
81
|
+
[showWithCardContent]="false"
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
##### `useMapButton`
|
|
85
|
+
- **Type:** `boolean`
|
|
86
|
+
- **Default:** `false`
|
|
87
|
+
- **Description:** Shows a map button for location visualization.
|
|
88
|
+
- **Example:**
|
|
89
|
+
```typescript
|
|
90
|
+
[useMapButton]="true"
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
#### Features
|
|
94
|
+
- Search by multiple criteria:
|
|
95
|
+
- Customer name
|
|
96
|
+
- Instrument serial number
|
|
97
|
+
- Item code
|
|
98
|
+
- Installation date range
|
|
99
|
+
- Sort by various fields
|
|
100
|
+
- Territory-based filtering
|
|
101
|
+
- Pagination
|
|
102
|
+
- Direct navigation to details
|
|
103
|
+
- URL query parameter persistence
|
|
104
|
+
|
|
105
|
+
#### Example
|
|
106
|
+
|
|
107
|
+
```html
|
|
108
|
+
<app-sap-installed-instrument-list
|
|
109
|
+
[accessToken]="token"
|
|
110
|
+
[territoryFilter]="true"
|
|
111
|
+
[showWithCardContent]="true"
|
|
112
|
+
[useMapButton]="false">
|
|
113
|
+
</app-sap-installed-instrument-list>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
```typescript
|
|
117
|
+
export class InstrumentsComponent {
|
|
118
|
+
token = this.authService.getAccessToken();
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
### SapInstalledInstrumentListTable
|
|
125
|
+
|
|
126
|
+
Table component showing the list of instruments.
|
|
127
|
+
|
|
128
|
+
Used internally by SapInstalledInstrumentList but can be used standalone.
|
|
129
|
+
|
|
130
|
+
#### Features
|
|
131
|
+
- Sortable columns
|
|
132
|
+
- Clickable rows for navigation
|
|
133
|
+
- Display key information:
|
|
134
|
+
- Customer name
|
|
135
|
+
- Item code and description
|
|
136
|
+
- Serial number
|
|
137
|
+
- Internal serial number
|
|
138
|
+
- Installation date
|
|
139
|
+
- Status
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
### SapInstalledInstrumentListSearch
|
|
144
|
+
|
|
145
|
+
Search form component for filtering instruments.
|
|
146
|
+
|
|
147
|
+
Used internally by SapInstalledInstrumentList.
|
|
148
|
+
|
|
149
|
+
#### Features
|
|
150
|
+
- Customer search
|
|
151
|
+
- Serial number search
|
|
152
|
+
- Item code search
|
|
153
|
+
- Date range picker for installation date
|
|
154
|
+
- Clear filters button
|
|
155
|
+
- Form validation
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
### SapInstalledInstrumentDetails
|
|
160
|
+
|
|
161
|
+
Detailed view of a single installed instrument.
|
|
162
|
+
|
|
163
|
+
#### Selector
|
|
164
|
+
```html
|
|
165
|
+
<app-sap-installed-instrument-details></app-sap-installed-instrument-details>
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
#### Features
|
|
169
|
+
- Complete instrument information
|
|
170
|
+
- Service contracts section
|
|
171
|
+
- Service calls list
|
|
172
|
+
- Activities log
|
|
173
|
+
- Attachments
|
|
174
|
+
- Tabbed interface
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
### DataDetailsView
|
|
179
|
+
|
|
180
|
+
Displays the core data of the installed instrument.
|
|
181
|
+
|
|
182
|
+
#### Features
|
|
183
|
+
- Customer information
|
|
184
|
+
- Item details
|
|
185
|
+
- Serial numbers
|
|
186
|
+
- Installation date
|
|
187
|
+
- Location information
|
|
188
|
+
- Status
|
|
189
|
+
- Notes
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
### ServiceContractsListView
|
|
194
|
+
|
|
195
|
+
Shows active and historical service contracts.
|
|
196
|
+
|
|
197
|
+
#### Features
|
|
198
|
+
- Contract number and description
|
|
199
|
+
- Start and end dates
|
|
200
|
+
- Contract status
|
|
201
|
+
- Coverage details
|
|
202
|
+
- Link to contract details
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
### ServiceContractDetailsView
|
|
207
|
+
|
|
208
|
+
Detailed view of a single service contract.
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
### CallsListView
|
|
213
|
+
|
|
214
|
+
Displays service calls related to the instrument.
|
|
215
|
+
|
|
216
|
+
#### Features
|
|
217
|
+
- Call ID and subject
|
|
218
|
+
- Priority level
|
|
219
|
+
- Status
|
|
220
|
+
- Assigned technician
|
|
221
|
+
- Creation and resolution dates
|
|
222
|
+
- Call description
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
### CallDetailsView
|
|
227
|
+
|
|
228
|
+
Detailed view of a service call.
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
### ActivitiesListView
|
|
233
|
+
|
|
234
|
+
Shows activities/notes related to the instrument.
|
|
235
|
+
|
|
236
|
+
#### Features
|
|
237
|
+
- Activity type
|
|
238
|
+
- Date and time
|
|
239
|
+
- Performed by
|
|
240
|
+
- Description
|
|
241
|
+
- Duration
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
### ActivityDetailsView
|
|
246
|
+
|
|
247
|
+
Detailed view of a single activity.
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
### AttachmentsListView
|
|
252
|
+
|
|
253
|
+
Displays and manages attachments for the instrument.
|
|
254
|
+
|
|
255
|
+
Uses the `ngx-st-attachments` component internally.
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## Examples
|
|
260
|
+
|
|
261
|
+
### Basic Instrument List
|
|
262
|
+
|
|
263
|
+
```html
|
|
264
|
+
<div class="instruments-page">
|
|
265
|
+
<h1>Installed Instruments</h1>
|
|
266
|
+
|
|
267
|
+
<app-sap-installed-instrument-list
|
|
268
|
+
[accessToken]="accessToken"
|
|
269
|
+
[territoryFilter]="true">
|
|
270
|
+
</app-sap-installed-instrument-list>
|
|
271
|
+
</div>
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
```typescript
|
|
275
|
+
export class InstrumentsPageComponent {
|
|
276
|
+
accessToken: string;
|
|
277
|
+
|
|
278
|
+
constructor(private authService: AuthService) {
|
|
279
|
+
this.accessToken = this.authService.getToken();
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
### With Map Integration
|
|
285
|
+
|
|
286
|
+
```html
|
|
287
|
+
<app-sap-installed-instrument-list
|
|
288
|
+
[accessToken]="accessToken"
|
|
289
|
+
[territoryFilter]="false"
|
|
290
|
+
[useMapButton]="true">
|
|
291
|
+
</app-sap-installed-instrument-list>
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
### Without Card Wrapper (Custom Layout)
|
|
295
|
+
|
|
296
|
+
```html
|
|
297
|
+
<mat-card class="custom-instruments-card">
|
|
298
|
+
<mat-card-header>
|
|
299
|
+
<mat-card-title>Equipment List</mat-card-title>
|
|
300
|
+
<mat-card-subtitle>All installed instruments</mat-card-subtitle>
|
|
301
|
+
</mat-card-header>
|
|
302
|
+
|
|
303
|
+
<mat-card-content>
|
|
304
|
+
<app-sap-installed-instrument-list
|
|
305
|
+
[accessToken]="accessToken"
|
|
306
|
+
[territoryFilter]="filterByTerritory"
|
|
307
|
+
[showWithCardContent]="false">
|
|
308
|
+
</app-sap-installed-instrument-list>
|
|
309
|
+
</mat-card-content>
|
|
310
|
+
</mat-card>
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
### Instrument Details Page
|
|
314
|
+
|
|
315
|
+
```html
|
|
316
|
+
<div class="instrument-details-page">
|
|
317
|
+
<mat-toolbar>
|
|
318
|
+
<button mat-icon-button (click)="goBack()">
|
|
319
|
+
<mat-icon>arrow_back</mat-icon>
|
|
320
|
+
</button>
|
|
321
|
+
<span>Instrument Details</span>
|
|
322
|
+
</mat-toolbar>
|
|
323
|
+
|
|
324
|
+
<app-sap-installed-instrument-details
|
|
325
|
+
[instrumentId]="instrumentId">
|
|
326
|
+
</app-sap-installed-instrument-details>
|
|
327
|
+
</div>
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
```typescript
|
|
331
|
+
export class InstrumentDetailsComponent implements OnInit {
|
|
332
|
+
instrumentId: string;
|
|
333
|
+
|
|
334
|
+
constructor(
|
|
335
|
+
private route: ActivatedRoute,
|
|
336
|
+
private location: Location
|
|
337
|
+
) {}
|
|
338
|
+
|
|
339
|
+
ngOnInit() {
|
|
340
|
+
this.instrumentId = this.route.snapshot.params['id'];
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
goBack() {
|
|
344
|
+
this.location.back();
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
### With Territory Filter Toggle
|
|
350
|
+
|
|
351
|
+
```html
|
|
352
|
+
<div class="instruments-with-filter">
|
|
353
|
+
<mat-toolbar>
|
|
354
|
+
<span>Installed Instruments</span>
|
|
355
|
+
<span class="toolbar-spacer"></span>
|
|
356
|
+
<mat-slide-toggle
|
|
357
|
+
[(ngModel)]="filterByTerritory"
|
|
358
|
+
(change)="onFilterChange()">
|
|
359
|
+
My Territory Only
|
|
360
|
+
</mat-slide-toggle>
|
|
361
|
+
</mat-toolbar>
|
|
362
|
+
|
|
363
|
+
<app-sap-installed-instrument-list
|
|
364
|
+
[accessToken]="accessToken"
|
|
365
|
+
[territoryFilter]="filterByTerritory">
|
|
366
|
+
</app-sap-installed-instrument-list>
|
|
367
|
+
</div>
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
```typescript
|
|
371
|
+
export class InstrumentsComponent {
|
|
372
|
+
accessToken: string;
|
|
373
|
+
filterByTerritory = true;
|
|
374
|
+
|
|
375
|
+
constructor(private authService: AuthService) {
|
|
376
|
+
this.accessToken = this.authService.getToken();
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
onFilterChange() {
|
|
380
|
+
console.log('Territory filter:', this.filterByTerritory);
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
### Complete Page with Search Persistence
|
|
386
|
+
|
|
387
|
+
The component automatically saves search filters and sorting to URL query parameters, allowing users to bookmark or share specific searches.
|
|
388
|
+
|
|
389
|
+
```typescript
|
|
390
|
+
export class InstrumentsComponent {
|
|
391
|
+
// Component automatically reads from URL on init
|
|
392
|
+
// Example URL: /instruments?customerName=ABC&serialNumber=12345&active=asc
|
|
393
|
+
}
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
### Custom Routing Configuration
|
|
397
|
+
|
|
398
|
+
```typescript
|
|
399
|
+
const routes: Routes = [
|
|
400
|
+
{
|
|
401
|
+
path: 'instruments',
|
|
402
|
+
component: InstrumentsListComponent
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
path: 'instruments/:id',
|
|
406
|
+
component: InstrumentDetailsComponent
|
|
407
|
+
}
|
|
408
|
+
];
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
---
|
|
412
|
+
|
|
413
|
+
## Features
|
|
414
|
+
|
|
415
|
+
### Smart Search
|
|
416
|
+
- Multiple search criteria
|
|
417
|
+
- Date range filtering
|
|
418
|
+
- Real-time filtering
|
|
419
|
+
- Search persistence in URL
|
|
420
|
+
|
|
421
|
+
### Sorting
|
|
422
|
+
- Sort by any column
|
|
423
|
+
- Ascending/descending
|
|
424
|
+
- Sort state persistence
|
|
425
|
+
|
|
426
|
+
### Territory Filtering
|
|
427
|
+
- Filter by user's assigned territory
|
|
428
|
+
- Optional - can show all instruments
|
|
429
|
+
- Useful for sales organizations
|
|
430
|
+
|
|
431
|
+
### Navigation
|
|
432
|
+
- Click any row to view details
|
|
433
|
+
- Browser back button support
|
|
434
|
+
- Shareable URLs with search state
|
|
435
|
+
|
|
436
|
+
### Responsive Design
|
|
437
|
+
- Card-based layout
|
|
438
|
+
- Mobile-friendly
|
|
439
|
+
- Responsive table
|
|
440
|
+
|
|
441
|
+
---
|
|
442
|
+
|
|
443
|
+
## Data Models
|
|
444
|
+
|
|
445
|
+
### SapInstalledInstrumentListModel
|
|
446
|
+
|
|
447
|
+
```typescript
|
|
448
|
+
interface SapInstalledInstrumentListModel {
|
|
449
|
+
insID: number; // Instrument ID
|
|
450
|
+
itemCode: string; // Item code
|
|
451
|
+
itemName: string; // Item description
|
|
452
|
+
manufacturerSerialNumber: string; // Serial number
|
|
453
|
+
internalSerialNum: string; // Internal serial number
|
|
454
|
+
customer: string; // Customer name
|
|
455
|
+
customerCode: string; // Customer code
|
|
456
|
+
installDate: Date; // Installation date
|
|
457
|
+
statusOfSerialNumber: string; // Status
|
|
458
|
+
location: string; // Installation location
|
|
459
|
+
}
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
### InstalledInstrumentFormModel
|
|
463
|
+
|
|
464
|
+
```typescript
|
|
465
|
+
interface InstalledInstrumentFormModel {
|
|
466
|
+
customerName?: string;
|
|
467
|
+
serialNumber?: string;
|
|
468
|
+
itemCode?: string;
|
|
469
|
+
installationDateFrom?: Date;
|
|
470
|
+
installationDateTo?: Date;
|
|
471
|
+
}
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
---
|
|
475
|
+
|
|
476
|
+
## Build
|
|
477
|
+
|
|
478
|
+
Run `ng build ngx-st-sap-installed-instruments` to build the project. The build artifacts will be stored in the `dist/` directory.
|
|
479
|
+
|
|
480
|
+
## Publishing
|
|
481
|
+
|
|
482
|
+
After building your library with `ng build ngx-st-sap-installed-instruments`, go to the dist folder `cd dist/ngx-st-sap-installed-instruments` and run `npm publish`.
|
|
483
|
+
|