Skip to content

Commit 69163a7

Browse files
authored
fix(ourlogs): Column editor fixes (#88690)
### Summary Hide the docs button and show body in the column editor.
1 parent 00b7a33 commit 69163a7

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed

static/app/views/explore/logs/constants.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,23 @@ export const AlwaysPresentLogFields: OurLogFieldKey[] = [
2424
OurLogKnownFieldKey.SEVERITY_TEXT,
2525
];
2626

27+
const AlwaysHiddenLogFields: OurLogFieldKey[] = [
28+
OurLogKnownFieldKey.ID,
29+
OurLogKnownFieldKey.ORGANIZATION_ID,
30+
OurLogKnownFieldKey.ITEM_TYPE,
31+
OurLogKnownFieldKey.PROJECT,
32+
];
33+
2734
/**
2835
* These are fields that should be hidden in log details view when receiving all data from the API.
2936
*/
3037
export const HiddenLogDetailFields: OurLogFieldKey[] = [
31-
OurLogKnownFieldKey.ID,
38+
...AlwaysHiddenLogFields,
3239
OurLogKnownFieldKey.BODY,
33-
OurLogKnownFieldKey.ORGANIZATION_ID,
34-
OurLogKnownFieldKey.ITEM_TYPE,
35-
OurLogKnownFieldKey.PROJECT,
3640
];
3741

42+
export const HiddenColumnEditorLogFields: OurLogFieldKey[] = [...AlwaysHiddenLogFields];
43+
3844
const LOGS_FILTERS: FilterKeySection = {
3945
value: 'logs_filters',
4046
label: t('Logs'),

static/app/views/explore/logs/logsTab.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import {
2727
} from 'sentry/views/explore/contexts/logs/logsPageParams';
2828
import {useTraceItemAttributes} from 'sentry/views/explore/contexts/traceItemAttributeContext';
2929
import {useLogAnalytics} from 'sentry/views/explore/hooks/useAnalytics';
30-
import {HiddenLogDetailFields} from 'sentry/views/explore/logs/constants';
30+
import {HiddenColumnEditorLogFields} from 'sentry/views/explore/logs/constants';
3131
import {LogsTable} from 'sentry/views/explore/logs/logsTable';
3232
import {useExploreLogsTable} from 'sentry/views/explore/logs/useLogsQuery';
3333
import {ColumnEditorModal} from 'sentry/views/explore/tables/columnEditorModal';
@@ -71,7 +71,8 @@ export function LogsTabContent({
7171
onColumnsChange={setFields}
7272
stringTags={stringAttributes}
7373
numberTags={numberAttributes}
74-
hiddenKeys={HiddenLogDetailFields}
74+
hiddenKeys={HiddenColumnEditorLogFields}
75+
isDocsButtonHidden
7576
/>
7677
),
7778
{closeEvents: 'escape-key'}

static/app/views/explore/tables/columnEditorModal.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ interface ColumnEditorModalProps extends ModalRenderProps {
2929
onColumnsChange: (fields: string[]) => void;
3030
stringTags: TagCollection;
3131
hiddenKeys?: string[];
32+
isDocsButtonHidden?: boolean;
3233
}
3334

3435
export function ColumnEditorModal({
@@ -41,6 +42,7 @@ export function ColumnEditorModal({
4142
numberTags,
4243
stringTags,
4344
hiddenKeys,
45+
isDocsButtonHidden = false,
4446
}: ColumnEditorModalProps) {
4547
const tags: Array<SelectOption<string>> = useMemo(() => {
4648
let allTags = [
@@ -137,9 +139,11 @@ export function ColumnEditorModal({
137139
</Body>
138140
<Footer data-test-id="editor-footer">
139141
<ButtonBar gap={1}>
140-
<LinkButton priority="default" href={SPAN_PROPS_DOCS_URL} external>
141-
{t('Read the Docs')}
142-
</LinkButton>
142+
{!isDocsButtonHidden && (
143+
<LinkButton priority="default" href={SPAN_PROPS_DOCS_URL} external>
144+
{t('Read the Docs')}
145+
</LinkButton>
146+
)}
143147
<Button aria-label={t('Apply')} priority="primary" onClick={handleApply}>
144148
{t('Apply')}
145149
</Button>

0 commit comments

Comments
 (0)