-
Notifications
You must be signed in to change notification settings - Fork 6
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
Set up DataView layout #5
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
bb12269
Update PF version
fhlavac dea98b2
feat(layout): Set up the DataView layout
fhlavac 046ed8f
Update tests
fhlavac 72be342
Do not pass props to children
fhlavac dfac428
feat(layout): Clean the code
fhlavac 6664871
Ignore link-in-text-block a11y rule
fhlavac 789eafd
Make the Toolbar consume pagination node
fhlavac File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,133 +1,38 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
lerna-debug.log* | ||
.pnpm-debug.log* | ||
|
||
# Diagnostic reports (https://nodejs.org/api/report.html) | ||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
# Javascript builds | ||
node_modules | ||
dist | ||
tsc_out | ||
.out | ||
.changelog | ||
.DS_Store | ||
coverage | ||
*.lcov | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# Snowpack dependency directory (https://snowpack.dev/) | ||
web_modules/ | ||
|
||
# TypeScript cache | ||
*.tsbuildinfo | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.cache | ||
results | ||
.tmp | ||
.eslintcache | ||
generated | ||
|
||
# Cypress cache | ||
.cypress-cache | ||
|
||
# Optional stylelint cache | ||
.stylelintcache | ||
|
||
# Microbundle cache | ||
.rpt2_cache/ | ||
.rts2_cache_cjs/ | ||
.rts2_cache_es/ | ||
.rts2_cache_umd/ | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variable files | ||
.env | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
.env.local | ||
|
||
# parcel-bundler cache (https://parceljs.org/) | ||
.cache | ||
.parcel-cache | ||
|
||
# Next.js build output | ||
.next | ||
out | ||
|
||
# Nuxt.js build / generate output | ||
.nuxt | ||
dist | ||
|
||
# Gatsby files | ||
.cache/ | ||
# Comment in the public line in if your project uses Gatsby and not Next.js | ||
# https://nextjs.org/blog/next-9-1#public-directory-support | ||
# public | ||
|
||
# vuepress build output | ||
.vuepress/dist | ||
|
||
# vuepress v2.x temp and cache directory | ||
.temp | ||
.cache | ||
|
||
# Docusaurus cache and generated files | ||
.docusaurus | ||
|
||
# Serverless directories | ||
.serverless/ | ||
|
||
# FuseBox cache | ||
.fusebox/ | ||
|
||
# DynamoDB Local files | ||
.dynamodb/ | ||
|
||
# TernJS port file | ||
.tern-port | ||
|
||
# Stores VSCode versions used for testing VSCode extensions | ||
.vscode-test | ||
|
||
# yarn v2 | ||
.yarn/cache | ||
.yarn/unplugged | ||
.yarn/build-state.yml | ||
.yarn/install-state.gz | ||
.pnp.* | ||
# package managers | ||
lerna-debug.log | ||
|
||
# IDEs and editors | ||
.idea | ||
.project | ||
.classpath | ||
.c9 | ||
*.launch | ||
.settings | ||
*.sublime-workspace | ||
.history | ||
.vscode | ||
.yo-rc.json | ||
|
||
# IDE - VSCode | ||
.vscode | ||
# For vim | ||
*.swp | ||
|
||
public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,29 @@ | ||
import React from 'react'; | ||
import { Pagination } from '@patternfly/react-core'; | ||
import DataView from '../../packages/module/dist/dynamic/DataView'; | ||
import DataViewToolbar from '../../packages/module/dist/esm/DataViewToolbar'; | ||
|
||
const PAGINATION = { | ||
page: 1, | ||
perPage: 1 | ||
} | ||
|
||
describe('DataView', () => { | ||
it('renders data view', () => { | ||
cy.mount(<div id="test">Some text</div>); | ||
it('renders the data view layout', () => { | ||
cy.mount(<DataView><>Data view content</></DataView>) | ||
cy.get('[data-ouia-component-id="DataView-stack-item-0"]').contains('Data view content'); | ||
}); | ||
|
||
cy.get('[id="test"]').should('contain', 'Some text'); | ||
}) | ||
}) | ||
it('renders the data view with toolbar, data section and footer', () => { | ||
cy.mount( | ||
<DataView> | ||
<DataViewToolbar pagination={<Pagination {...PAGINATION} ouiaId="DataViewToolbar-pagination" />} /> | ||
<>Data section</> | ||
<DataViewToolbar pagination={<Pagination isCompact {...PAGINATION} ouiaId="DataViewFooter-pagination" />} ouiaId="DataViewFooter" /> | ||
</DataView> | ||
); | ||
cy.get('[data-ouia-component-id="DataViewToolbar-pagination"]').should('exist'); | ||
cy.get('[data-ouia-component-id="DataView-stack-item-1"]').contains('Data section'); | ||
cy.get('[data-ouia-component-id="DataViewFooter-pagination"]').should('exist'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from 'react'; | ||
import { Pagination } from '@patternfly/react-core'; | ||
import DataViewToolbar from '../../packages/module/dist/dynamic/DataViewToolbar'; | ||
|
||
describe('DataViewToolbar', () => { | ||
it('renders the data view toolbar', () => { | ||
cy.mount(<DataViewToolbar pagination={<Pagination page={1} perPage={10} ouiaId="DataViewToolbar-pagination" />} />) | ||
cy.get('[data-ouia-component-id="DataViewToolbar"]').should('exist'); | ||
cy.get('[data-ouia-component-id="DataViewToolbar-pagination"]').should('exist'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
describe('Test the Data view docs page', () => { | ||
|
||
it('renders the docs', () => { | ||
it.skip('renders the docs', () => { | ||
cy.visit('http://localhost:8006/extensions/data-view/data-view'); | ||
}) | ||
}) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 0 additions & 6 deletions
6
...module/patternfly-docs/content/extensions/data-view/examples/DataView/DataViewExample.tsx
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
.../patternfly-docs/content/extensions/data-view/examples/DataView/DataViewLayoutExample.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from 'react'; | ||
import DataView from '@patternfly/react-data-view/dist/dynamic/DataView'; | ||
|
||
const layoutItemStyling = { | ||
width: '100%', | ||
height: '5rem', | ||
padding: 'var(--pf-t--global--spacer--md)', | ||
border: 'var(--pf-t--global--border--width--box--default) dashed var(--pf-t--global--border--color--default)' | ||
}; | ||
|
||
export const BasicExample: React.FunctionComponent = () => ( | ||
<DataView> | ||
<div style={layoutItemStyling}>Header</div> | ||
<div style={layoutItemStyling}>Data representation</div> | ||
<div style={layoutItemStyling}>Footer</div> | ||
</DataView> | ||
) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nicolethoen I also see the a11y tests failing there with
link-in-text-block
. The link is added the same way as in the older docs framework version. Did anything change with v6?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are not the only person who's run into this error during the migration to the v6 alphas. I will have to investigate how others have resolved this issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the recommended solution (since the rule being flagged by the a11y tests is a 'new experimental rule') is to ignore it.
You can see that being done in another extension here: patternfly/react-catalog-view@bd81ee6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, thank you 🙂