Skip to content

Commit

Permalink
Replace diaas-api by halstack-client
Browse files Browse the repository at this point in the history
  • Loading branch information
Echevarria Fernandez committed Nov 10, 2022
2 parents 0a70cd6 + e7b1780 commit d69c877
Show file tree
Hide file tree
Showing 16 changed files with 724 additions and 145 deletions.
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Bug report
about: Create a report to help us fixing breaking things
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Include steps to reproduce the behavior.

Example:

1. Create a new React App using `create-react-app`.
2. Install the `@dxc-technology\halstack-react` dependencies and run the app.
3. Click on '...'.
4. Scroll down to '...'.
5. See the error.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here.

**Add labels**
Add any applicable label like the concerned components or the target version of the Design System where the bug has been found.
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Feature request
about: Suggest an idea for this project
---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.

**Add Labels**
Add any applicable labels like related components, services, team or project reporting this new feature... etc
20 changes: 20 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
**Checklist**
_(Check off all the items before submitting)_
- [ ] Build process is done without errors and all tests pass in `/lib` directory.
- [ ] Self-reviewed the code prior to submitting.
- [ ] Added/updated documentation to `/README` as needed.
- [ ] Added/updated tests as needed.

**Purpose**
A clear description of the purpose of the change. Applicable in case this change is not linked to an issue.

**Description**
A clear and concise description of the change.

**Screenshots**
If applicable, add screenshots to help explain your change.

**Additional context**
Add any other context about the change here.

**Closes #`issue-number`**
39 changes: 39 additions & 0 deletions .github/workflows/publish-next.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish Next Version

on:
push:
branches:
- master
paths:
- "lib/**"

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: 16.x
registry-url: https://registry.npmjs.org/

- name: Install lib dependencies
run: cd lib && npm install --omit=dev

- name: Build library
run: cd lib && npm run build

- name: Test library
run: cd lib && npm run test

- name: Publish NEXT version to npm
run: |
sed -i "s#\"version\": \"0.0.0\"#\"version\": \"0.0.0-${GITHUB_SHA:0:7}\"#" ./dist/package.json
cd dist
npm publish --tag next --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
41 changes: 41 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish Release

on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: 16.x
registry-url: https://registry.npmjs.org/

- name: Install lib dependencies
run: cd lib && npm install --omit=dev

- name: Build library
run: cd lib && npm run build

- name: Test library
run: cd lib && npm run test

- name: Publish RELEASE to npm
run: |
sed -i "s#\"version\": \"0.0.0\"#\"version\": \"${TAG_NAME}\"#" ./dist/package.json
cd dist
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
TAG_NAME: ${{ github.event.release.tag_name }}

- name: Install scripts dependencies
run: cd scripts && npm install

26 changes: 26 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build and test

on: pull_request

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: 16.x
registry-url: https://registry.npmjs.org/

- name: Install lib dependencies
run: cd lib && npm install

- name: Build library
run: cd lib && npm run build

- name: Test library
run: cd lib && npm run test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/example/src/hal
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import HalUI from "@diaas/hal-ui";
<HalUI url={api_base_url} headers={headers_object} />
```
### Properties
Name|Type|Default|Description
|:---|:---|:---|:---
`url`|`String`|None|Required. This property contains the base url of your HAL API.
`headers`|`JSON Object`|None|Contains an object with the headers to be sent to every request to the API.
| Name | Type | Default | Description |
| :-------- | :------------ | :------ | :-------------------------------------------------------------------------- |
| `url` | `String` | None | Required. This property contains the base URL of your HAL API. |
| `headers` | `JSON Object` | None | Contains an object with the headers to be sent to every request to the API. |

## Develop
In the first place, clone this repository.
Expand Down
8 changes: 4 additions & 4 deletions example/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "diaas-hal-ui-example",
"name": "diaas-hal-browser-example",
"version": "0.1.0",
"private": true,
"dependencies": {
"@diaas/hal-ui": "file:../lib",
"@dxc-technology/halstack-browser": "file:../lib",
"@dxc-technology/halstack-client": "^1.3.3",
"react": "^16.7.0",
"react-dom": "^16.7.0",
"react-scripts": "2.1.2"
"react-dom": "^16.7.0"
},
"scripts": {
"start": "react-scripts start",
Expand Down
28 changes: 12 additions & 16 deletions example/src/App.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
import React, { Component } from "react";
import HalUI from "@diaas/hal-ui";
import HalUI from "@dxc-technology/halstack-browser";
//import HalUI from "./hal/hal-ui/HalUI";
import "./App.css";

const API_PROFILE_ID = ""; // From DXC Developer Central
const API_USER_NAME = ""; // From DXC Developer Central
const YOUR_API_KEY = ""; // From DXC Developer Central

const YOUR_API_KEY = 'RlbIOdmhnj9Pd85G8fwFA5fdJWYcXtHq7my0wNa1'; // From DXC Developer Central
class App extends Component {
state = { actions: [] };

/*
This example uses DXC Prospects API published in DXC Developer Central.
The following 3 headers must be passed to the API and can be obtained
This example uses DXC Carriers API published in DXC Developer Central.
The following x-api-key header must be passed to the API and can be obtained
after registering and signing in Developer Central.
More information at https://developer.dxc.com/api/insurance/life/integral-prospects/codelab
More information at https://developer.dxc.com/apis/catalog
*/

urlProspects =
"https://api.dxc-dev-integral.hub-1.dev.us.insurance.dxc.com/prospects";

urlProspects = "https://api.dxc-dev-assurelife.hub-1.dev.us.insurance.dxc.com/carriers"
headersProspects = {
"Content-Type": "application/json",
Accept: "application/json",
"x-api-key": YOUR_API_KEY,
userName: API_USER_NAME,
profileid: API_PROFILE_ID,
};
'Content-Type': 'application/json, application/hal+json',
'Accept': 'application/json, application/hal+json',
'x-api-key': YOUR_API_KEY
}

render() {
return (
Expand Down
Loading

0 comments on commit d69c877

Please sign in to comment.