forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Inspector Views] [Request View] - Migrate inspector_views to new pla…
…tform (elastic#43191) * [Inspector Views] [Request View] - Migrate inspector_views to new platform * fix i18n keys * rename scss files * fix PR comments
- Loading branch information
Showing
20 changed files
with
475 additions
and
358 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
125 changes: 0 additions & 125 deletions
125
src/legacy/core_plugins/inspector_views/public/requests/request_details.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@import './requests/index'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
src/plugins/inspector/public/views/requests/components/details/req_details_request.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import React, { Component } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { EuiCodeBlock } from '@elastic/eui'; | ||
import { Request } from '../../../../adapters/request/types'; | ||
import { RequestDetailsProps } from '../types'; | ||
|
||
export class RequestDetailsRequest extends Component<RequestDetailsProps> { | ||
static propTypes = { | ||
request: PropTypes.object.isRequired, | ||
}; | ||
|
||
static shouldShow = (request: Request) => Boolean(request && request.json); | ||
|
||
render() { | ||
const { json } = this.props.request; | ||
|
||
if (!json) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<EuiCodeBlock | ||
language="json" | ||
paddingSize="s" | ||
isCopyable | ||
data-test-subj="inspectorRequestBody" | ||
> | ||
{JSON.stringify(json, null, 2)} | ||
</EuiCodeBlock> | ||
); | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
src/plugins/inspector/public/views/requests/components/details/req_details_response.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import React, { Component } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { EuiCodeBlock } from '@elastic/eui'; | ||
import { Request } from '../../../../adapters/request/types'; | ||
import { RequestDetailsProps } from '../types'; | ||
|
||
export class RequestDetailsResponse extends Component<RequestDetailsProps> { | ||
static propTypes = { | ||
request: PropTypes.object.isRequired, | ||
}; | ||
|
||
static shouldShow = (request: Request) => | ||
Boolean(RequestDetailsResponse.getResponseJson(request)); | ||
|
||
static getResponseJson = (request: Request) => (request.response ? request.response.json : null); | ||
|
||
render() { | ||
const responseJSON = RequestDetailsResponse.getResponseJson(this.props.request); | ||
|
||
if (!responseJSON) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<EuiCodeBlock | ||
language="json" | ||
paddingSize="s" | ||
isCopyable | ||
data-test-subj="inspectorResponseBody" | ||
> | ||
{JSON.stringify(responseJSON, null, 2)} | ||
</EuiCodeBlock> | ||
); | ||
} | ||
} |
Oops, something went wrong.