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: modal implementation for data ingestion table #1244

Open
wants to merge 22 commits into
base: develop
Choose a base branch
from

Conversation

soleksy-splunk
Copy link
Contributor

@soleksy-splunk soleksy-splunk commented Jun 21, 2024

Issue number: ADDON-70993, ADDON-72969

Summary

Changes

Added a modal for data ingestion table view to show the specific data for input selector.

User experience

Users can see the data volume and number of events visualization chart for the particular row using the modal popup in data ingestion table.

Checklist

If your change doesn't seem to apply, please leave them unchecked.

@rohanm-crest rohanm-crest changed the title [DO NOT MERGE]feat: spike poc dashboard side panel feat: modal implementation for data ingestion table Sep 3, 2024
@rohanm-crest rohanm-crest self-assigned this Sep 4, 2024
@rohanm-crest rohanm-crest marked this pull request as ready for review September 4, 2024 09:26
@rohanm-crest rohanm-crest requested review from a team as code owners September 4, 2024 09:26
@soleksy-splunk
Copy link
Contributor Author

@rohanm-crest as there was data_ingestion_modal_definition.json created, there is also a need to adjust smoke tests accordingly
so to file tests/testdata/expected_addons/expected_files_conflict_test/expected_log.json
at the end you need to add

  "appserver/static/js/build/custom/resources_tab_definition.json                  created\u001b[0m": "INFO",
  "appserver/static/js/build/custom/data_ingestion_modal_definition.json           created\u001b[0m": "INFO"

instead of current

  "appserver/static/js/build/custom/resources_tab_definition.json                  created\u001b[0m": "INFO"

lets make sure pipelines passed and i will than check all of it

Copy link
Contributor Author

@soleksy-splunk soleksy-splunk left a comment

Choose a reason for hiding this comment

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

just a small thing i found after brief look

}

table td:first-child:hover {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

can we use some id for this one? table seems unsave? probably only table in this page but styles might be left without refreshing whole page and it will influence other tables.

@soleksy-splunk
Copy link
Contributor Author

some ideas regarding selector inside modal,

  1. selector with input shouldn't be a part of fetched JSON, as data for it we can get inside method handleDashboardEvent via events
targetId: "data_ingestion_table_ds"
type: "datasource.done"

inside payload there are all data from table, thanks to that we can have all inputs from first column and add it into selector,

Also it would be nice to have a separated selector (from definition.json) as we need to change json definition based on selector change) , if user clicks testInput2 we need to adjust search queries,
Similar mechanism is already done for search functionality

  1. We can always use as it is so keep selector input inside definition.json but
    cons:
    we will double number of search calls (maybe not issue as they are cached)
    we need to find a way to dynamically edit search query based on those changes

pros:
less flickering
everything from ui perspective is handled via dashboard components

Copy link
Contributor Author

@soleksy-splunk soleksy-splunk left a comment

Choose a reason for hiding this comment

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

Also lets remember to not marge it untill we align all dynamics part into this PR.

handleRequestClose={() => {
setDisplayModalForInput(null);
}}
title={`${displayModalForInput}`}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

it should match figma

Data ingestion details (By input).

By input is changable and can be

By Input
By Source type
By Source
By Host
By Index
By Account

`;

const ModalHeader = styled(Modal.Header)`
background-color: ${variables.backgroundColorHover};
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am not sure the semantic name of the color backgroundColorHover applies to the non-hover background color

`;

export const DataIngestionModal = (props: {
open: boolean | undefined;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
open: boolean | undefined;
open?: boolean;

ui/src/pages/Dashboard/DataIngestionModal.tsx Outdated Show resolved Hide resolved
margin: 0px 10px;

.footerBtn:first-child {
justify-self: start;
Copy link
Collaborator

Choose a reason for hiding this comment

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

can it be justify content space between for the parent?

Copy link
Contributor

Choose a reason for hiding this comment

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

I have tried that but it's taking the full width for both the buttons

const StyledDiv = styled('div')`
display: flex;
justify-content: space-between;
margin: 0px 10px;

.footerBtn {
    margin: 0 auto;
}

`;

background-color: ${variables.backgroundColorHover};
`;

const StyledDiv = styled('div')`
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would name this variable something more meaningful

const StyledDiv = styled('div')`
display: grid;
grid-template-columns: 0.35fr 1fr;
margin: 0px 10px;
Copy link
Collaborator

Choose a reason for hiding this comment

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

please avoid hardcoded value as much as possible

Suggested change
margin: 0px 10px;
margin: 0px ${variables.spacingSmall};

Copy link
Contributor

Choose a reason for hiding this comment

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

Done


const ModalWrapper = styled(Modal)`
width: 60%;
height: 80%;
Copy link
Collaborator

Choose a reason for hiding this comment

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

does it work fine on small and huge screen sizes?

Copy link
Contributor

Choose a reason for hiding this comment

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

Changed it to vh/vw respectivley

ui/src/pages/Dashboard/DataIngestionModal.tsx Outdated Show resolved Hide resolved
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.

5 participants