Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: logspec section #836

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Feat: logspec section #836

wants to merge 3 commits into from

Conversation

murilx
Copy link
Contributor

@murilx murilx commented Jan 23, 2025

  • Added children prop to Section. The children will be showed after all links in a single column instead of two as the links do
  • Added contentHandler function to handle the different types of data that can be showed in a misc section of a details page and also handles special fields like 'log_excerpt' with pattern matching
  • Added the getLogspecSection function that creates the json needed by SectionGroup to create the section correctly. It creates a titled subsection for every object in the logpsec field in misc up to depth 2 and Nested objects beyond depth 2 can be viewed through the Json viewer

Closes #804

Visual Reference

image

- Added `children` prop to Section. The children will be showed after
  all links in a single column instead of two as the links do
- Added `contentHandler` function to handle the different types of data
  that can be showed in a misc section of a details page and also
  handles special fields like 'log_excerpt' with pattern matching
- Added the `getLogspecSection` function that creates the json needed by
  `SectionGroup` to create the section correctly. It creates a titled
  subsection for every object in the logpsec field in misc up to depth
  2 and Nested objects beyond depth 2 can be viewed through the Json
  viewer

Closes #804
- Created `misc.tsx` utils file containing the miscContentHandler
  function
- Added the content handler function to the misc section as well as
  logspec section
@murilx murilx marked this pull request as ready for review January 23, 2025 16:25
@WilsonNet
Copy link
Collaborator

maybe when we have an empty log_exceprt we should show the fallback text

typeof obj === 'object' &&
obj !== null &&
!Array.isArray(obj) &&
Object.keys(obj).every(key => typeof key === 'string')
Copy link
Collaborator

Choose a reason for hiding this comment

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

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys

Object keys already return string keys, I don't think objects can have any other type of key, maps can though

@@ -22,7 +22,7 @@ interface ILogSheet {
}

export interface IJsonContent {
src?: JSON;
src?: object;
Copy link
Collaborator

@WilsonNet WilsonNet Jan 23, 2025

Choose a reason for hiding this comment

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

Record<string, unknown> | Array<unknown>
functions are object in javascript

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optimistic logspec in Issue Details pages
2 participants