Skip to content

Commit c61d1b8

Browse files
committed
Fix review comments
1 parent 4286e35 commit c61d1b8

File tree

7 files changed

+10
-19
lines changed

7 files changed

+10
-19
lines changed

Diff for: features/apimgt/org.wso2.carbon.apimgt.publisher.feature/src/main/resources/publisher/source/src/app/components/Apis/Details/LifeCycle/LifeCycleUpdate.jsx

+1-4
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ import { injectIntl, FormattedMessage } from 'react-intl';
2929
import Typography from '@material-ui/core/Typography';
3030
import API from 'AppData/api';
3131
import { CircularProgress } from '@material-ui/core';
32-
import {
33-
ScopeValidation, resourceMethod, resourcePath, client,
34-
} from 'AppData/ScopeValidation';
32+
import { ScopeValidation, resourceMethod, resourcePath } from 'AppData/ScopeValidation';
3533
import Alert from 'AppComponents/Shared/Alert';
3634
import Banner from 'AppComponents/Shared/Banner';
3735
import LaunchIcon from '@material-ui/icons/Launch';
@@ -323,7 +321,6 @@ class LifeCycleUpdate extends Component {
323321
<ScopeValidation
324322
resourcePath={resourcePath.API_CHANGE_LC}
325323
resourceMethod={resourceMethod.POST}
326-
client={client.API_CLIENT}
327324
>
328325
<div className={classes.buttonsWrapper}>
329326
{!isWorkflowPending

Diff for: features/apimgt/org.wso2.carbon.apimgt.publisher.feature/src/main/resources/publisher/source/src/app/components/Apis/Details/Subscriptions/SubscriptionsTable.jsx

+1-4
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@ import UserIcon from '@material-ui/icons/Person';
4444

4545
import Alert from 'AppComponents/Shared/Alert';
4646
import API from 'AppData/api';
47-
import {
48-
ScopeValidation, resourceMethod, resourcePath, client,
49-
} from 'AppData/ScopeValidation';
47+
import { ScopeValidation, resourceMethod, resourcePath } from 'AppData/ScopeValidation';
5048
import AuthManager from 'AppData/AuthManager';
5149
import Invoice from './Invoice';
5250

@@ -855,7 +853,6 @@ class SubscriptionsTable extends Component {
855853
<ScopeValidation
856854
resourceMethod={resourceMethod.POST}
857855
resourcePath={resourcePath.BLOCK_SUBSCRIPTION}
858-
client={client.API_CLIENT}
859856
>
860857
{
861858
this.getSubscriptionBlockingButtons(

Diff for: features/apimgt/org.wso2.carbon.apimgt.publisher.feature/src/main/resources/publisher/source/src/app/components/Apis/Details/components/CreateNewVersionButton.jsx

+1-4
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ import { withStyles } from '@material-ui/core/styles';
2525
import Typography from '@material-ui/core/Typography';
2626
import { FormattedMessage } from 'react-intl';
2727

28-
import {
29-
client, resourceMethod, resourcePath, ScopeValidation,
30-
} from 'AppData/ScopeValidation';
28+
import { resourceMethod, resourcePath, ScopeValidation } from 'AppData/ScopeValidation';
3129
import VerticalDivider from 'AppComponents/Shared/VerticalDivider';
3230

3331
const styles = (theme) => ({
@@ -86,7 +84,6 @@ function CreateNewVersionButton(props) {
8684
<ScopeValidation
8785
resourceMethod={resourceMethod.POST}
8886
resourcePath={resourcePath.API_COPY}
89-
client={client.API_CLIENT}
9087
>
9188
<div className={classes.createNewVersionWrapper}>
9289
<VerticalDivider height={70} />

Diff for: features/apimgt/org.wso2.carbon.apimgt.publisher.feature/src/main/resources/publisher/source/src/app/components/Apis/Details/components/DeleteApiButton.jsx

+1-4
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ import { withRouter } from 'react-router-dom';
1010
import { withStyles } from '@material-ui/core/styles';
1111
import IconButton from '@material-ui/core/IconButton';
1212
import API from 'AppData/api';
13-
import {
14-
client, resourceMethod, resourcePath, ScopeValidation,
15-
} from 'AppData/ScopeValidation';
13+
import { resourceMethod, resourcePath, ScopeValidation } from 'AppData/ScopeValidation';
1614
import Alert from 'AppComponents/Shared/Alert';
1715
import VerticalDivider from 'AppComponents/Shared/VerticalDivider';
1816
import { FormattedMessage } from 'react-intl';
@@ -192,7 +190,6 @@ class DeleteApiButton extends React.Component {
192190
<ScopeValidation
193191
resourceMethod={resourceMethod.DELETE}
194192
resourcePath={path}
195-
client={client.API_CLIENT}
196193
>
197194
<Box
198195
className={classNames({ [classes.inlineBlock]: updateData, [classes.flexBox]: !updateData })}

Diff for: features/apimgt/org.wso2.carbon.apimgt.publisher.feature/src/main/resources/publisher/source/src/app/data/ScopeValidation.jsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,15 @@ export default class ScopeValidation extends React.Component {
143143
}
144144
}
145145

146+
ScopeValidation.defaultProps = {
147+
client: client.API_CLIENT,
148+
};
149+
146150
ScopeValidation.propTypes = {
147151
children: PropTypes.node.isRequired,
148152
resourcePath: PropTypes.string.isRequired,
149153
resourceMethod: PropTypes.string.isRequired,
150-
client: PropTypes.shape({}).isRequired,
154+
client: PropTypes.shape({}),
151155
};
152156

153157
export {

Diff for: features/apimgt/org.wso2.carbon.apimgt.publisher.feature/src/main/resources/publisher/source/src/app/data/ServiceCatalogClient.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class ServiceCatalogClient {
100100
return (
101101
resolved.spec.paths[resourcePath]
102102
&& resolved.spec.paths[resourcePath][resourceMethod]
103-
&& resolved.spec.paths[resourcePath][resourceMethod].security[0].OAuth2Security[0]
103+
&& resolved.spec.paths[resourcePath][resourceMethod].security[0].OAuth2Security
104104
);
105105
});
106106
}

Diff for: features/apimgt/org.wso2.carbon.apimgt.publisher.feature/src/main/resources/publisher/source/src/app/data/Utils.js

-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ class Utils {
209209
*/
210210
static getServiceCatalogSwaggerURL() {
211211
return 'https://' + Utils.getCurrentEnvironment().host + Utils.CONST.SERVICE_CATALOG_SWAGGER_YAML;
212-
// return Utils.CONST.SERVICE_CATALOG_SWAGGER_YAML;
213212
}
214213

215214
/**

0 commit comments

Comments
 (0)