-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(docs): Updated development documentation.
chore(docs): updated examples with explainations. chore(docs): updated examples with explainations. chore(docs): Added async example. chore(docs): reverted yarn.lock file. chore(docs): Updated with fake forms. chore(docs): Updated with fake forms. chore(docs): Updated with review comments. Review updates. Fixed bad link.
- Loading branch information
Showing
14 changed files
with
361 additions
and
64 deletions.
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
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
35 changes: 35 additions & 0 deletions
35
packages/module/patternfly-docs/content/examples/Async.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,35 @@ | ||
/* eslint-disable no-console */ | ||
import React from 'react'; | ||
import { FeedbackModal} from '@patternfly/react-user-feedback'; | ||
import { Button } from '@patternfly/react-core'; | ||
|
||
export const AsyncExample: React.FunctionComponent = () => { | ||
const [isOpen, setIsOpen] = React.useState<boolean>(false); | ||
|
||
const fakeNetworkCall = (email:string, feedback:string, bug:string) => new Promise<boolean>(resolve => { | ||
setTimeout(() => { | ||
console.log(`Email Address: ${email} Feedback: ${feedback} Bug: ${bug}`); | ||
console.log('Network call complete successfully so return true'); | ||
resolve(true); | ||
}, 2000); | ||
}) | ||
|
||
const simulatedAsyncCall = async (email='', feedback='', bug='') => { | ||
console.log('simulatedAsyncCall'); | ||
const result = await fakeNetworkCall(email, feedback, bug); | ||
return result; | ||
} | ||
|
||
|
||
const handleButtonClicked = () => {setIsOpen(true)}; | ||
return <> | ||
<Button onClick={handleButtonClicked}>Show Modal</Button> | ||
<FeedbackModal | ||
onShareFeedback={(email:string, feedback:string)=>simulatedAsyncCall(email, feedback)} | ||
onJoinMailingList={(email:string)=>simulatedAsyncCall(email)} | ||
onOpenSupportCase='https://pf-user-feedback-extension-form-demos.surge.sh/requestSupport.html' | ||
onReportABug={(email:string, bug:string)=>simulatedAsyncCall(email, '', bug)} | ||
isOpen={isOpen} | ||
onClose={()=>setIsOpen(false)}/> | ||
</> | ||
} |
16 changes: 0 additions & 16 deletions
16
packages/module/patternfly-docs/content/examples/Basic.tsx
This file was deleted.
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
33 changes: 33 additions & 0 deletions
33
packages/module/patternfly-docs/content/examples/forms/joinMailingList.html
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,33 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<link rel="stylesheet" href="https://unpkg.com/@patternfly/patternfly/patternfly.min.css"> | ||
</head> | ||
|
||
<body style="margin: 4rem; height: 80vh;"> | ||
<div class="pf-l-stack pf-m-gutter"> | ||
<div class="pf-l-stack__item"> | ||
<div class="pf-c-title pf-m-2xl">Join Mailing List Example </div> | ||
</div> | ||
<div class="pf-l-stack__item"> | ||
<form class="pf-c-form pf-m-horizontal" novalidate> | ||
<div class="pf-c-form__group"> | ||
<div class="pf-c-form__group-label"><label class="pf-c-form__label" for="form-horizontal-name"> | ||
<span class="pf-c-form__label-text">Email</span> <span class="pf-c-form__label-required" | ||
aria-hidden="true">*</span></label> | ||
</div> | ||
<div class="pf-c-form__group-control"> | ||
<input class="pf-c-form-control" type="text" id="form-horizontal-name" | ||
name="form-horizontal-name" required /> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
<div class="pf-l-stack__item"> | ||
<button class="pf-c-button pf-m-primary" style="width: fit-content;" type="button">Submit</button> | ||
<button class="pf-c-button pf-m-secondary" style="width: fit-content" type="button">Cancel</button> | ||
</div> | ||
</div> | ||
|
||
</html> |
45 changes: 45 additions & 0 deletions
45
packages/module/patternfly-docs/content/examples/forms/reportBug.html
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,45 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<link rel="stylesheet" href="https://unpkg.com/@patternfly/patternfly/patternfly.min.css"> | ||
</head> | ||
|
||
<body style="margin: 4rem; height: 80vh;"> | ||
<div class="pf-l-stack pf-m-gutter"> | ||
<div class="pf-l-stack__item"> | ||
<div class="pf-c-title pf-m-2xl">Report A Bug Example </div> | ||
</div> | ||
<div class="pf-l-stack__item"> | ||
<form class="pf-c-form pf-m-horizontal" novalidate> | ||
<div class="pf-c-form__group"> | ||
<div class="pf-c-form__group-label"><label class="pf-c-form__label" for="form-horizontal-name"> | ||
<span class="pf-c-form__label-text">Email</span> <span class="pf-c-form__label-required" | ||
aria-hidden="true">*</span></label> | ||
</div> | ||
<div class="pf-c-form__group-control"> | ||
<input class="pf-c-form-control" type="text" id="form-horizontal-name" | ||
name="form-horizontal-name" required /> | ||
</div> | ||
</div> | ||
<div class="pf-c-form__group"> | ||
<div class="pf-c-form__group-label"><label class="pf-c-form__label" for="form-horizontal-info"> | ||
<span class="pf-c-form__label-text">Bug</span></label> <span | ||
class="pf-c-form__group-label-help" aria-label="More information for information field" | ||
aria-describedby="form-horizontal-info" role="button" type="button" tabindex="0"><i | ||
class="pficon pf-icon-help" aria-hidden="true"></i></span> | ||
</div> | ||
<div class="pf-c-form__group-control"> | ||
<textarea class="pf-c-form-control" type="text" id="form-horizontal-info" | ||
name="form-horizontal-info" aria-label="Textarea example"></textarea> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
<div class="pf-l-stack__item"> | ||
<button class="pf-c-button pf-m-primary" style="width: fit-content;" type="button">Submit</button> | ||
<button class="pf-c-button pf-m-secondary" style="width: fit-content" type="button">Cancel</button> | ||
</div> | ||
</div> | ||
|
||
</html> |
86 changes: 86 additions & 0 deletions
86
packages/module/patternfly-docs/content/examples/forms/requestSupport.html
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,86 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<link rel="stylesheet" href="https://unpkg.com/@patternfly/patternfly/patternfly.min.css"> | ||
</head> | ||
|
||
<body style="margin: 4rem; height: 80vh;"> | ||
<div class="pf-l-stack pf-m-gutter"> | ||
<div class="pf-l-stack__item"> | ||
<div class="pf-c-title pf-m-2xl">Request Support Example </div> | ||
</div> | ||
<div class="pf-l-stack__item"> | ||
<form class="pf-c-form pf-m-horizontal" novalidate> | ||
<div class="pf-c-form__group"> | ||
<div class="pf-c-form__group-label"><label class="pf-c-form__label" for="form-horizontal-name"> | ||
<span class="pf-c-form__label-text">Email</span> <span class="pf-c-form__label-required" | ||
aria-hidden="true">*</span></label> | ||
</div> | ||
<div class="pf-c-form__group-control"> | ||
<input class="pf-c-form-control" type="text" id="form-horizontal-name" | ||
name="form-horizontal-name" required /> | ||
</div> | ||
</div> | ||
<div class="pf-c-form__group"> | ||
<div class="pf-c-form__group-label"><label class="pf-c-form__label" for="form-horizontal-info"> | ||
<span class="pf-c-form__label-text">Issue</span></label> <span | ||
class="pf-c-form__group-label-help" aria-label="More information for information field" | ||
aria-describedby="form-horizontal-info" role="button" type="button" tabindex="0"><i | ||
class="pficon pf-icon-help" aria-hidden="true"></i></span> | ||
</div> | ||
<div class="pf-c-form__group-control"> | ||
<textarea class="pf-c-form-control" type="text" id="form-horizontal-info" | ||
name="form-horizontal-info" aria-label="Textarea example"></textarea> | ||
</div> | ||
</div> | ||
<div class="pf-c-form__group" role="group" aria-labelledby="form-horizontal-checkbox-legend"> | ||
<div class="pf-c-form__group-label pf-m-no-padding-top" id="form-horizontal-checkbox-legend"><span | ||
class="pf-c-form__label"> | ||
<span class="pf-c-form__label-text">Department</span></span> <span | ||
class="pf-c-form__group-label-help" aria-label="More information for label field" | ||
aria-describedby="form-horizontal-checkbox-legend" role="button" type="button" | ||
tabindex="0"><i class="pficon pf-icon-help" aria-hidden="true"></i></span> | ||
</div> | ||
<div class="pf-c-form__group-control pf-m-stack"> | ||
<div class="pf-c-check"> | ||
<input class="pf-c-check__input" type="checkbox" id="form-horizontal-checkbox" | ||
name="form-horizontal-checkbox" /> | ||
|
||
<label class="pf-c-check__label" for="form-horizontal-checkbox">Administration</label> | ||
</div> | ||
<div class="pf-c-check"> | ||
<input class="pf-c-check__input" type="checkbox" id="form-horizontal-checkbox2" | ||
name="form-horizontal-checkbox2" /> | ||
|
||
<label class="pf-c-check__label" for="form-horizontal-checkbox2">Engineering</label> | ||
</div> | ||
<div class="pf-c-check"> | ||
<input class="pf-c-check__input" type="checkbox" id="form-horizontal-checkbox2" | ||
name="form-horizontal-checkbox2" /> | ||
|
||
<label class="pf-c-check__label" for="form-horizontal-checkbox2">IT</label> | ||
</div> | ||
<div class="pf-c-check"> | ||
<input class="pf-c-check__input" type="checkbox" id="form-horizontal-checkbox2" | ||
name="form-horizontal-checkbox2" /> | ||
|
||
<label class="pf-c-check__label" for="form-horizontal-checkbox2">HR</label> | ||
</div> | ||
<div class="pf-c-check"> | ||
<input class="pf-c-check__input" type="checkbox" id="form-horizontal-checkbox2" | ||
name="form-horizontal-checkbox2" /> | ||
|
||
<label class="pf-c-check__label" for="form-horizontal-checkbox2">Security</label> | ||
</div> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
<div class="pf-l-stack__item"> | ||
<button class="pf-c-button pf-m-primary" style="width: fit-content;" type="button">Submit</button> | ||
<button class="pf-c-button pf-m-secondary" style="width: fit-content" type="button">Cancel</button> | ||
</div> | ||
</div> | ||
|
||
</html> |
45 changes: 45 additions & 0 deletions
45
packages/module/patternfly-docs/content/examples/forms/submitFeedback.html
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,45 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<link rel="stylesheet" href="https://unpkg.com/@patternfly/patternfly/patternfly.min.css"> | ||
</head> | ||
|
||
<body style="margin: 4rem; height: 80vh;"> | ||
<div class="pf-l-stack pf-m-gutter"> | ||
<div class="pf-l-stack__item"> | ||
<div class="pf-c-title pf-m-2xl">Submit Feedback Example </div> | ||
</div> | ||
<div class="pf-l-stack__item"> | ||
<form class="pf-c-form pf-m-horizontal" novalidate> | ||
<div class="pf-c-form__group"> | ||
<div class="pf-c-form__group-label"><label class="pf-c-form__label" for="form-horizontal-name"> | ||
<span class="pf-c-form__label-text">Email</span> <span class="pf-c-form__label-required" | ||
aria-hidden="true">*</span></label> | ||
</div> | ||
<div class="pf-c-form__group-control"> | ||
<input class="pf-c-form-control" type="text" id="form-horizontal-name" | ||
name="form-horizontal-name" required /> | ||
</div> | ||
</div> | ||
<div class="pf-c-form__group"> | ||
<div class="pf-c-form__group-label"><label class="pf-c-form__label" for="form-horizontal-info"> | ||
<span class="pf-c-form__label-text">Feedback</span></label> <span | ||
class="pf-c-form__group-label-help" aria-label="More information for information field" | ||
aria-describedby="form-horizontal-info" role="button" type="button" tabindex="0"><i | ||
class="pficon pf-icon-help" aria-hidden="true"></i></span> | ||
</div> | ||
<div class="pf-c-form__group-control"> | ||
<textarea class="pf-c-form-control" type="text" id="form-horizontal-info" | ||
name="form-horizontal-info" aria-label="Textarea example"></textarea> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
<div class="pf-l-stack__item"> | ||
<button class="pf-c-button pf-m-primary" style="width: fit-content;" type="button">Submit</button> | ||
<button class="pf-c-button pf-m-secondary" style="width: fit-content" type="button">Cancel</button> | ||
</div> | ||
</div> | ||
|
||
</html> |
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
Oops, something went wrong.