Skip to content

Commit

Permalink
Fixed review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dlabaj committed Mar 29, 2020
1 parent 85e2f93 commit d86f68b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 25 deletions.
1 change: 0 additions & 1 deletion packages/studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"jest": "^24.1.0",
"keycloak-js": "9.0.0",
"mini-css-extract-plugin": "^0.4.5",
"nodemon": "2.0.2",
"optimize-css-assets-webpack-plugin": "^5.0.1",
"prettier": "^1.15.2",
"prop-types": "^15.6.1",
Expand Down
15 changes: 5 additions & 10 deletions packages/studio/src/app/common/appConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,16 @@ import {ApisService, KeycloakAuthenticationService, ConfigService} from '@apicu
// Initialize services.

export class Services {

private static singleton: Services
public configService: ConfigService = new ConfigService();
public autheticationService : KeycloakAuthenticationService = new KeycloakAuthenticationService(this.configService);;
public apisService: ApisService = new ApisService(this.autheticationService, this.configService);;

constructor() {

}

static getInstance() {
if (Services.singleton === undefined) {
Services.singleton = new Services();
}

return Services.singleton;
}

private static singleton: Services;
public configService: ConfigService = new ConfigService();
public autheticationService : KeycloakAuthenticationService = new KeycloakAuthenticationService(this.configService);
public apisService: ApisService = new ApisService(this.autheticationService, this.configService);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,21 @@ import React from 'react';
import { Button, Card, CardActions, CardHead, CardBody, Title } from '@patternfly/react-core';
import {TimesIcon, EyeIcon} from '@patternfly/react-icons';
import ApicurioIcon from '../../../assets/apicurio-icon.png';
import ApiTabs from '../apiTabs';
import { ApiTabs } from '../apiTabs';
import data from '../../../../api-data.json';

export interface ApiDrawerPanelContentProps {
currentApiId: string
}

export class ApiDrawerPanelContent extends React.Component<ApiDrawerPanelContentProps> {
;
constructor(props: ApiDrawerPanelContentProps) {
super(props);
}

render() {
function findId(array: any[], id: string) {
const apiTemp = array.find(api => api.id === id);
if (apiTemp !== undefined) {
return apiTemp;
}
else {
return Error;
}
}

const apiObject = findId(data.apis, this.props.currentApiId);
const apiObject = this.findId(data.apis, this.props.currentApiId);

return (
<Card>
Expand Down Expand Up @@ -56,7 +47,16 @@ export class ApiDrawerPanelContent extends React.Component<ApiDrawerPanelContent
<ApiTabs createdBy={apiObject.createdBy} createdOn={apiObject.createdOn}/>
</Card>
)
};
}
private findId = (array: any[], id: string): any => {
const apiTemp = array.find(api => api.id === id);
if (apiTemp !== undefined) {
return apiTemp;
}
else {
return Error;
}
}
}

export default ApiDrawerPanelContent;
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const ApiToolbar = () => {
}

return (
<DataToolbar>
<DataToolbar id="apiToolbar">
<DataToolbarContent>
<DataToolbarItem>
This is where the Data Toolbar should go
Expand Down

0 comments on commit d86f68b

Please sign in to comment.