Skip to content

Commit 52a9245

Browse files
Merge pull request #414 from zenml-io/UAT
2 parents 4aadf3f + 2881586 commit 52a9245

File tree

137 files changed

+13255
-329
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+13255
-329
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
REACT_APP_BASE_API_URL="https://appserver.zenml.io/api/v1"
1+
REACT_APP_BASE_API_URL=https://appserver.zenml.io/api/v1
22
REACT_APP_HUB_API_URL="https://hubapi.zenml.io"
33
REACT_APP_VERSION=$npm_package_version

global.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ interface TAction {
3535
interface TServerInfo {
3636
id: string;
3737
version: string;
38+
debug: boolean;
3839
deploymentType: string;
3940
databaseType: string;
4041
secretsStoreType: string;

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@
113113
"eslint-plugin-prettier": "^3.1.4",
114114
"eslint-plugin-react": "^7.20.5",
115115
"eslint-plugin-redux-saga": "^1.1.3",
116+
"husky": "^8.0.0",
116117
"postcss": "^8.4.16",
117118
"prettier": "^2.0.5",
118119
"react-hooks-testing-library": "^0.6.0",
119-
"react-test-renderer": "^16.13.1",
120-
"husky": "^8.0.0"
120+
"react-test-renderer": "^16.13.1"
121121
},
122122
"engines": {
123123
"npm": ">=6.14.17",

src/App.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Provider } from 'react-redux';
44
import { RouteConfig } from './routes';
55

66
import configureStore from './redux/setup/storeSetup';
7+
import './utils/axios';
78
import Toaster from './ui/layouts/common/Toaster';
89

910
import 'bootstrap/dist/css/bootstrap-grid.min.css';
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import getconnectorByIdApi from './getConnectorByIdApi';
2+
3+
import { endpoints } from '../endpoints';
4+
import { apiUrl } from '../apiUrl';
5+
import { httpMethods } from '../constants';
6+
7+
const mockFetchApiWithAuthRequest = jest.fn().mockImplementation(() => Promise);
8+
9+
jest.mock('../fetchApi', () => ({
10+
fetchApiWithAuthRequest: (params: any): any =>
11+
mockFetchApiWithAuthRequest(params),
12+
}));
13+
14+
const authenticationToken = 'token';
15+
const pipelineId = 'runId';
16+
17+
describe('getconnectorByIdApi', () => {
18+
it('calls fetch api with correct params', () => {
19+
// getconnectorByIdApi({ authenticationToken, pipelineId });
20+
expect(mockFetchApiWithAuthRequest).toHaveBeenCalledWith({
21+
method: httpMethods.get,
22+
url: apiUrl(endpoints.connectors.get(pipelineId)),
23+
authenticationToken,
24+
});
25+
});
26+
});
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { fetchApiWithAuthRequest } from '../fetchApi';
2+
import { endpoints } from '../endpoints';
3+
import { httpMethods } from '../constants';
4+
import { apiUrl } from '../apiUrl';
5+
6+
const getconnectorByIdApi = ({
7+
authenticationToken,
8+
connectorId,
9+
}: {
10+
authenticationToken: string;
11+
connectorId: TId;
12+
}): Promise<TOrganization> =>
13+
fetchApiWithAuthRequest({
14+
url: apiUrl(endpoints.Connectors.get(connectorId)),
15+
method: httpMethods.get,
16+
authenticationToken,
17+
});
18+
19+
export default getconnectorByIdApi;
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import { fetchApiWithAuthRequest } from '../fetchApi';
2+
import { endpoints } from '../endpoints';
3+
import { httpMethods } from '../constants';
4+
import { apiUrl } from '../apiUrl';
5+
6+
const getConnectorComponentsApi = ({
7+
connector_id,
8+
workspace,
9+
sort_by,
10+
logical_operator,
11+
page,
12+
size,
13+
name,
14+
filtersParam,
15+
// id,
16+
authenticationToken,
17+
}: {
18+
connector_id?: string;
19+
workspace: string;
20+
sort_by: string;
21+
logical_operator: string;
22+
page: number;
23+
size: number;
24+
name?: string;
25+
filtersParam?: object;
26+
// id?: any;
27+
authenticationToken: string;
28+
}): Promise<any> =>
29+
fetchApiWithAuthRequest({
30+
url: apiUrl(endpoints.Connectors.connectorComponents),
31+
params: {
32+
connector_id,
33+
sort_by,
34+
logical_operator,
35+
page,
36+
size,
37+
name,
38+
...filtersParam,
39+
// id,
40+
},
41+
method: httpMethods.get,
42+
authenticationToken,
43+
});
44+
45+
export default getConnectorComponentsApi;
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import { fetchApiWithAuthRequest } from '../fetchApi';
2+
import { endpoints } from '../endpoints';
3+
import { httpMethods } from '../constants';
4+
import { apiUrl } from '../apiUrl';
5+
6+
const getConnectorsTypesApi = ({
7+
component_id,
8+
workspace,
9+
sort_by,
10+
logical_operator,
11+
page,
12+
size,
13+
connector_type,
14+
filtersParam,
15+
// id,
16+
authenticationToken,
17+
}: {
18+
component_id?: any;
19+
workspace: string;
20+
sort_by: string;
21+
logical_operator: string;
22+
page: number;
23+
size: number;
24+
connector_type?: string;
25+
filtersParam?: object;
26+
// id?: any;
27+
authenticationToken: string;
28+
}): Promise<any> =>
29+
fetchApiWithAuthRequest({
30+
url: apiUrl(endpoints.Connectors.connectorsTypes),
31+
params: {
32+
component_id,
33+
sort_by,
34+
logical_operator,
35+
page,
36+
size,
37+
connector_type,
38+
...filtersParam,
39+
// id,
40+
},
41+
method: httpMethods.get,
42+
authenticationToken,
43+
});
44+
45+
export default getConnectorsTypesApi;
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import getMyconnectorsApi from './getMyConnectorsApi';
2+
3+
import { endpoints } from '../endpoints';
4+
import { apiUrl } from '../apiUrl';
5+
import { httpMethods } from '../constants';
6+
7+
const mockFetchApiWithAuthRequest = jest.fn().mockImplementation(() => Promise);
8+
9+
jest.mock('../fetchApi', () => ({
10+
fetchApiWithAuthRequest: (params: any): any =>
11+
mockFetchApiWithAuthRequest(params),
12+
}));
13+
14+
const authenticationToken = 'token';
15+
16+
describe('getMyconnectorsApi', () => {
17+
it('calls fetch api with correct params', () => {
18+
// getMyconnectorsApi({ authenticationToken });
19+
expect(mockFetchApiWithAuthRequest).toHaveBeenCalledWith({
20+
method: httpMethods.get,
21+
url: apiUrl(endpoints.connectors.my),
22+
authenticationToken,
23+
});
24+
});
25+
});
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import { fetchApiWithAuthRequest } from '../fetchApi';
2+
import { endpoints } from '../endpoints';
3+
import { httpMethods } from '../constants';
4+
import { apiUrl } from '../apiUrl';
5+
6+
const getMyConnectorsApi = ({
7+
component_id,
8+
workspace,
9+
sort_by,
10+
logical_operator,
11+
page,
12+
size,
13+
name,
14+
filtersParam,
15+
// id,
16+
authenticationToken,
17+
}: {
18+
component_id?: any;
19+
workspace: string;
20+
sort_by: string;
21+
logical_operator: string;
22+
page: number;
23+
size: number;
24+
name?: string;
25+
filtersParam?: object;
26+
// id?: any;
27+
authenticationToken: string;
28+
}): Promise<TStack> =>
29+
fetchApiWithAuthRequest({
30+
url: apiUrl(endpoints.Connectors.my(workspace)),
31+
params: {
32+
component_id,
33+
sort_by,
34+
logical_operator,
35+
page,
36+
size,
37+
name,
38+
...filtersParam,
39+
// id,
40+
},
41+
method: httpMethods.get,
42+
authenticationToken,
43+
});
44+
45+
export default getMyConnectorsApi;

0 commit comments

Comments
 (0)