Skip to content
This repository was archived by the owner on Apr 2, 2024. It is now read-only.

Commit 616aa5b

Browse files
Update from fix-cim-impacted-objects (#184)
* Updated CHANGELOG * Refactored the impacted services * Show impacted objects with and without subscriptions * New GUI for CIM impacted objects * Fixed update of impact override * Fixed react select usage with dark theme + use absolute paths for import * Cleanup in typescript and components * Fixed version number and Changelog. Added Changelog and Readme to the linter. * Fixed discussion items Co-authored-by: René Dohmen <[email protected]>
1 parent 46362fb commit 616aa5b

13 files changed

+598
-392
lines changed

CHANGELOG.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,24 @@ reference the gitlab/github issue that is related to the change.
77
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
88
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
99

10-
## [v10.5.0] - TBD
10+
## [v10.6.0] - TBD
1111

1212
- `#47` Fix subscription dropdowns to not resize when typing and fixes alignments with other input fields
1313
- Added description text in Owner_Subscription_Id and added a copy-to-clipboard button
14-
- Updated service ticket detail page to show "last_update_time"
1514
- `#41` Converted most components to a Functions based approach
1615
- Selecting "auto scroll" on process detail page is now stored in localstorage
1716
- `#44` Include subscription description of first product block relation on Subscription detail page
17+
18+
Surf specific:
19+
20+
- Added a log viewer to Service ticket detail
21+
- Refactored Impacted objects tables to also show IMS Circuits
22+
- Fix CIM impacted objects without a subscription ID
23+
- Updated service ticket detail page to show "last_update_time"
1824
- Added button to restart CIM open relate step
25+
26+
## [v10.5.0] - 2022-10-24
27+
1928
- `#42` Fix help button hidden on subscriptions page
2029
- `#141` Convert sass files to emotion 3
2130
- `#157` Redirect workflow submit to process detail

README.md

Lines changed: 32 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,11 @@ seems to fix that issue, whilst keeping hot reload intact. So try adding this to
143143
To run the storybook, do: `yarn storybook`.
144144
Your browser should open to http://localhost:9009/?path=/story/welcome--to-storybook.
145145

146-
147146
## Actions and page views depending on who you are.
147+
148148
The orchestrator client can be configured to allow access to a page or to buttons in the client. The react app
149149
consumes a webassembly OPA policy and evaluates if the user has the correct claims to view certain resources.
150-
The function that gets called is the ```allowed()``` function in `src/utils/policy.ts`. The implementation of `allowed()`
150+
The function that gets called is the `allowed()` function in `src/utils/policy.ts`. The implementation of `allowed()`
151151
is done as follows:
152152

153153
```typescript jsx
@@ -163,58 +163,54 @@ Basically it boils down to: when a call to `allowed` returns true the component
163163
**When no policy is found, the orchestrator-client will allow access to the resource.
164164
Any real access must be enforced by the API. The client only disables features with the `allowed` function**
165165

166-
167166
### Pages
168167

169168
These are the pages in the orchestrator client and how the resources can be viewed. In the implementation we only disable
170169
menu items, not the actual pages. If a user has a direct url they will still be able to access the resource.
171170

172-
|Page|Resource name|
173-
|---|---|
174-
|Processes Pages|`/orchestrator/processes/`|
175-
|Subscriptions Pages|`/orchestrator/subscriptions/`|
176-
|Metadata Pages|`/orchestrator/metadata/`|
177-
|Tasks Pages|`/orchestrator/tasks/`|
178-
|Settings Pages|`/orchestrator/settings/`|
171+
| Page | Resource name |
172+
| ------------------- | ------------------------------ |
173+
| Processes Pages | `/orchestrator/processes/` |
174+
| Subscriptions Pages | `/orchestrator/subscriptions/` |
175+
| Metadata Pages | `/orchestrator/metadata/` |
176+
| Tasks Pages | `/orchestrator/tasks/` |
177+
| Settings Pages | `/orchestrator/settings/` |
179178

180179
If you would like to add an extra menu item you are free to name it as you wish. It is defined in the `allowed` function.
181180

182181
### Actions
182+
183183
Actions are disabled in the same manner as menu items. The following actions are configurable:
184184

185-
|Action|Location|Resource name| Explanation|
186-
|---|---|---|---|
187-
|Modify a subscription|Subscription detail page action menu|`/orchestrator/subscriptions/modify/*`|This resource can be configured per workflow|
188-
|Terminate a subscription| " "|`/orchestrator/subscriptions/terminate/*`|With this resource you can terminate a subscription|
189-
|Validate a subscription|" "|`/orchestrator/subscriptions/validate/*`|With this resource you can validate a certain subscription|
190-
|View a subscription from the process detail page|The process detail page|`/orchestrator/subscriptions/view/from-process`|Interact with a subscription from the process detail page|
191-
|Abort a process|" " |`/orchestrator/processes/abort/*`| The ability to abort a process|
192-
|Delete a process|" "|`/orchestrator/processes/delete/*`| The ability to delete a process, this is always disabled for processes not for tasks|
193-
|Retry a process|" "|`/orchestrator/processes/retry/*`| The ability to retry a failed process or task|
194-
|View a subscription from a process|" "|`/orchestrator/subscriptons/view/from-process` |This enables the link towards the subscription detail page|
195-
|View a process detail page| The process list page| `/orchestrator/processes/details/*`| The allows the person to visit a process detail page|
196-
|Retry all tasks| The tasks list page|`/orchestrator/processes/all-tasks/retry`| The Retry all tasks button|
197-
|Create a task| The tasks list page|`/orchestrator/processes/create/task`| Create a task|
198-
|Create a new subscription|The new process button|`/orchestrator/processes/create/process/menu`||
199-
|Render a user_input_form|Allow access to input steps| `/orchestrator/processes/user_inout/*`|Allow access to input_steps|
200-
|Allow deletion of product blocks| Product block detail page|`/orchestrator/metadata/product-block/delete/*`||
201-
|Edit a product block| " "|`/orchestrator/metadata/product-block/edit/*`||
202-
|View a product block|Product block list page|`/orchestrator/metadata/prodcut-block/view/*`||
203-
|View a product|Product list page|`/orchestrator/metadata/product/view/*`||
204-
|Edit a product|Product detail page|`/orchestrator/metadata/product/edit/*`||
205-
|Delete a product|Product detail page|`/orchestrator/metadata/product/delete/*`||
185+
| Action | Location | Resource name | Explanation |
186+
| ------------------------------------------------ | ------------------------------------ | ----------------------------------------------- | ------------------------------------------------------------------------------------ |
187+
| Modify a subscription | Subscription detail page action menu | `/orchestrator/subscriptions/modify/*` | This resource can be configured per workflow |
188+
| Terminate a subscription | " " | `/orchestrator/subscriptions/terminate/*` | With this resource you can terminate a subscription |
189+
| Validate a subscription | " " | `/orchestrator/subscriptions/validate/*` | With this resource you can validate a certain subscription |
190+
| View a subscription from the process detail page | The process detail page | `/orchestrator/subscriptions/view/from-process` | Interact with a subscription from the process detail page |
191+
| Abort a process | " " | `/orchestrator/processes/abort/*` | The ability to abort a process |
192+
| Delete a process | " " | `/orchestrator/processes/delete/*` | The ability to delete a process, this is always disabled for processes not for tasks |
193+
| Retry a process | " " | `/orchestrator/processes/retry/*` | The ability to retry a failed process or task |
194+
| View a subscription from a process | " " | `/orchestrator/subscriptons/view/from-process` | This enables the link towards the subscription detail page |
195+
| View a process detail page | The process list page | `/orchestrator/processes/details/*` | The allows the person to visit a process detail page |
196+
| Retry all tasks | The tasks list page | `/orchestrator/processes/all-tasks/retry` | The Retry all tasks button |
197+
| Create a task | The tasks list page | `/orchestrator/processes/create/task` | Create a task |
198+
| Create a new subscription | The new process button | `/orchestrator/processes/create/process/menu` | |
199+
| Render a user_input_form | Allow access to input steps | `/orchestrator/processes/user_inout/*` | Allow access to input_steps |
200+
| Allow deletion of product blocks | Product block detail page | `/orchestrator/metadata/product-block/delete/*` | |
201+
| Edit a product block | " " | `/orchestrator/metadata/product-block/edit/*` | |
202+
| View a product block | Product block list page | `/orchestrator/metadata/prodcut-block/view/*` | |
203+
| View a product | Product list page | `/orchestrator/metadata/product/view/*` | |
204+
| Edit a product | Product detail page | `/orchestrator/metadata/product/edit/*` | |
205+
| Delete a product | Product detail page | `/orchestrator/metadata/product/delete/*` | |
206206

207207
New actions or other actions can be enabled or disabled in the same way as menu items, by adding an arbitrary resource
208208
to the project.
209209

210-
211210
## Development tips
212211

213212
### IDE plugins
214213

215-
216214
**Visual Studio Code**
217215

218-
* [vscode-styled-components](https://marketplace.visualstudio.com/items?itemName=styled-components.vscode-styled-components) for syntax highlighting `emotion/css`
219-
220-
216+
- [vscode-styled-components](https://marketplace.visualstudio.com/items?itemName=styled-components.vscode-styled-components) for syntax highlighting `emotion/css`

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "workflow-client",
3-
"version": "1.0.0",
3+
"version": "10.6.0",
44
"private": false,
55
"license": "Apache-2.0",
66
"proxy": "http://localhost:8080",
@@ -15,8 +15,8 @@
1515
"storybook": "start-storybook -p 9009 -s ./public",
1616
"storybook-build": "build-storybook -s ./public",
1717
"storybook-deploy": "PUBLIC_URL=https://workfloworchestrator.github.io/orchestrator-core-gui gh-pages -d storybook-static",
18-
"prettier": "prettier -c \"{**/*.{js,jsx,scss,md,ts,tsx,json},public/**/*.html}\"",
19-
"prettier-fix": "prettier --write \"{**/*.{js,jsx,scss,md,ts,tsx,json},public/**/*.html}\"",
18+
"prettier": "prettier -c \"{**/*.{js,jsx,scss,md,ts,tsx,json},public/**/*.html,*.md}\"",
19+
"prettier-fix": "prettier --write \"{**/*.{js,jsx,scss,md,ts,tsx,json},public/**/*.html,*.md}\"",
2020
"extract": "formatjs extract",
2121
"compile": "formatjs compile"
2222
},

src/custom-surf/api/index.ts

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {
33
OpenServiceTicketPayload,
44
ServiceTicket,
55
ServiceTicketBackgroundJobCount,
6-
ServiceTicketImpactedIMSCircuit,
76
ServiceTicketProcessState,
87
ServiceTicketWithDetails,
98
} from "custom/types";
@@ -72,9 +71,8 @@ abstract class CustomApiClientInterface extends BaseApiClient {
7271
abstract cimTicketById: (ticket_id: string) => Promise<ServiceTicketWithDetails>;
7372
abstract cimPatchImpactedObject: (
7473
ticket_id: string,
75-
subscription_id: string,
76-
circuit_id: number,
77-
impactedObject: ServiceTicketImpactedIMSCircuit
74+
index: number,
75+
impact: string
7876
) => Promise<ServiceTicketWithDetails>;
7977
}
8078

@@ -280,15 +278,10 @@ export class CustomApiClient extends CustomApiClientInterface {
280278
);
281279
};
282280

283-
cimPatchImpactedObject = (
284-
ticket_id: string,
285-
subscription_id: string,
286-
circuit_id: number,
287-
impactedObject: ServiceTicketImpactedIMSCircuit
288-
): Promise<ServiceTicketWithDetails> => {
281+
cimPatchImpactedObject = (ticket_id: string, index: number, impact: string): Promise<ServiceTicketWithDetails> => {
289282
return this.postPutJson(
290-
prefix_cim_dev_uri(`surf/cim/objects/${ticket_id}/subscription/${subscription_id}/circuit/${circuit_id}`),
291-
impactedObject,
283+
prefix_cim_dev_uri(`surf/cim/objects/${ticket_id}/${index}`),
284+
{ impact_override: impact },
292285
"patch",
293286
true,
294287
false
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import { EuiBasicTable } from "@elastic/eui";
2+
import { BackgroundJobLog } from "custom/types";
3+
import { renderStringAsDateTime } from "custom/Utils";
4+
import React, { Fragment } from "react";
5+
import { WrappedComponentProps, injectIntl } from "react-intl";
6+
7+
interface IProps extends WrappedComponentProps {
8+
data: BackgroundJobLog[];
9+
}
10+
11+
const BackgroundJobLogs = ({ data }: IProps) => {
12+
let columns = [
13+
{
14+
field: "entry_time",
15+
name: "Date",
16+
render: (entry_time: string, data: any) => renderStringAsDateTime(data.entry_time),
17+
width: 200,
18+
schema: "date",
19+
},
20+
{
21+
field: "process_state",
22+
name: "State",
23+
truncateText: true,
24+
sortable: true,
25+
width: 100,
26+
},
27+
{
28+
field: "message",
29+
name: "Log message",
30+
sortable: true,
31+
truncateText: true,
32+
width: "40%",
33+
},
34+
{
35+
field: "subscription_id",
36+
name: "Subscription ID",
37+
sortable: true,
38+
width: 200,
39+
},
40+
{
41+
field: "customer ID",
42+
name: "Customer ID",
43+
sortable: true,
44+
width: 200,
45+
},
46+
];
47+
48+
return (
49+
<Fragment>
50+
<EuiBasicTable
51+
tableCaption={`Background jobs log table`}
52+
items={data}
53+
// @ts-ignore
54+
columns={columns}
55+
/>
56+
</Fragment>
57+
);
58+
};
59+
export default injectIntl(BackgroundJobLogs);

0 commit comments

Comments
 (0)