Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,15 @@ import {
import { ShellEnrollmentInstructions } from '../../../../../components/enrollment_instructions';
import { Loading } from '../../../../../components';

const CONFIG_KEYS_ORDER = ['id', 'revision', 'outputs', 'datasources'];
const CONFIG_KEYS_ORDER = [
'id',
'revision',
'outputs',
'datasources',
'enabled',
'package',
'input',
];

export const ConfigYamlView = memo<{ config: AgentConfig }>(({ config }) => {
const core = useCore();
Expand All @@ -47,7 +55,17 @@ export const ConfigYamlView = memo<{ config: AgentConfig }>(({ config }) => {
<EuiCodeBlock language="yaml" isCopyable>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be done in a separate PR but it would be nice to have overflowHeight prop set, currently the page scrolls very long depending on the config

{dump(fullConfigRequest.data.item, {
sortKeys: (keyA: string, keyB: string) => {
return CONFIG_KEYS_ORDER.indexOf(keyA) - CONFIG_KEYS_ORDER.indexOf(keyB);
const indexA = CONFIG_KEYS_ORDER.indexOf(keyA);
const indexB = CONFIG_KEYS_ORDER.indexOf(keyB);
if (indexA >= 0 && indexB < 0) {
return -1;
}

if (indexA < 0 && indexB >= 0) {
return 1;
}

return indexA - indexB;
},
})}
</EuiCodeBlock>
Expand Down