Skip to content

chore(docs): use static values in demos #11769

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

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

Conversation

Mash707
Copy link
Contributor

@Mash707 Mash707 commented Apr 20, 2025

Closes #11768

@patternfly-build
Copy link
Contributor

patternfly-build commented Apr 20, 2025

@Mash707
Copy link
Contributor Author

Mash707 commented Apr 20, 2025

/patterns/right-to-left/react-demos/paginated-table should I create a sampleData.tsx for this similar to other demos?

Copy link
Contributor

@thatblindgeye thatblindgeye left a comment

Choose a reason for hiding this comment

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

We should make a similar update to the TimestampBasicFormats example file

@thatblindgeye
Copy link
Contributor

@Mash707 for now we could just update those random values in the PaginatedTable file itself

@Mash707
Copy link
Contributor Author

Mash707 commented Apr 21, 2025

@Mash707 for now we could just update those random values in the PaginatedTable file itself

@thatblindgeye There are 25 entries for this example https://www.patternfly.org/patterns/right-to-left/react-demos/paginated-table/, this would make the source code pretty big with unnecessary information. Let me know what you think

@Mash707 Mash707 force-pushed the docs-use-static-data-demos branch from 45b61dd to a511304 Compare April 21, 2025 18:10
@thatblindgeye
Copy link
Contributor

@Mash707 Ah yeah fair, may not hurt to have a separate file for that data then

@Mash707 Mash707 force-pushed the docs-use-static-data-demos branch from a511304 to 3020895 Compare May 3, 2025 23:40
@Mash707
Copy link
Contributor Author

Mash707 commented May 3, 2025

/patterns/right-to-left/react-demos/paginated-table should I create a sampleData.tsx for this similar to other demos?

@thatblindgeye regarding this example I have few things to clarify:

  • I have added a sampleData2.tsx file in the demos folder because only then it is getting build in the dist folder so that I can import it into RTL.md file.
  • I am still trying to figure out how can we handle row translations with static values. Could you recommend an approach that I can work upon to make translations work? Previously every time the translation was switched new rows were created with the new transation.
    useEffect(() => {
    const newRows = createRows();
    setManagedRows(newRows);
    setPaginatedRows(newRows.slice((page - 1) * perPage, page * perPage));
    }, [translation]);

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.

Misc docs - demos should not use randomly generated data
4 participants