diff --git a/src/components/Contribute/Knowledge/ReviewSubmission/index.tsx b/src/components/Contribute/Knowledge/ReviewSubmission/index.tsx index b634462a..f11628c5 100644 --- a/src/components/Contribute/Knowledge/ReviewSubmission/index.tsx +++ b/src/components/Contribute/Knowledge/ReviewSubmission/index.tsx @@ -1,7 +1,8 @@ // src/components/Contribute/Knowledge/ReviewSubmission/ReviewSubmission.tsx import { KnowledgeFormData } from '@/types'; -import { Content, ContentVariants, Form } from '@patternfly/react-core'; +import { Content, ContentVariants, Form, Accordion, AccordionContent, AccordionItem, AccordionToggle } from '@patternfly/react-core'; import React from 'react'; +import '../../Skill/ReviewSubmission/submission.css'; interface ReviewSubmissionProps { knowledgeFormData: KnowledgeFormData; @@ -9,107 +10,168 @@ interface ReviewSubmissionProps { } export const ReviewSubmission: React.FC = ({ knowledgeFormData, isGithubMode }) => { + const [expanded, setExpanded] = React.useState<{ [key: string]: boolean }>({}); + + const onToggle = (id: number) => { + setExpanded((prevState) => ({ + ...prevState, + [id]: !prevState[id] + })); + }; + return ( -
- Review Submission - {/* Author Information */} -

- Author Information -

-

- Name: {knowledgeFormData.name} -

-

- Email: {knowledgeFormData.email} -

+ <> + +
+ Review + + Review the information below and click finish to submit your skill contribution. Use the back button to make changes. + + {/* Author Information */} +
+
+ + Contributor Information + + + Information required for a Github Developer Certificate of Origin (DCO) sign-off. + +
- {/* Knowledge Information */} -

Knowledge Information

-

- Knowledge Information -

-

- Submission Summary: {knowledgeFormData.submissionSummary} -

-

- Domain: {knowledgeFormData.domain} -

-

- Document Outline: {knowledgeFormData.documentOutline} -

+
+ + Contributors + + {knowledgeFormData.name} + {knowledgeFormData.email} +
+
+ + {/* Knowledge Information */} +
+
+ + Knowledge Information + + + Brief information about the Knowledge and the directory path for the QnA and Attribution files. + +
- {/* File Path Information */} -

- File Path Information -

+ + Submission summary + + {knowledgeFormData.submissionSummary} + + Domain + + {knowledgeFormData.domain} + + Document Outline + + {knowledgeFormData.documentOutline} +
-

- File Path: {knowledgeFormData.filePath} -

+
+ {/* Directory path */} + + Directory path + - {/* Seed Examples */} -

- Seed Examples -

+ {knowledgeFormData.filePath} +
- {knowledgeFormData.seedExamples.map((seedExample, index) => ( -
- Seed Example {index + 1} -

- Context: {seedExample.context} -

- {seedExample.questionAndAnswers.map((qa, qaIndex) => ( -
-

- Question {qaIndex + 1}: {qa.question} -

-

- Answer {qaIndex + 1}: {qa.answer} -

+ {/* Seed Examples */} +
+
+ Seed Examples + + Data that will be used to start teaching your model. +
- ))} -
- ))} - {/* Document Information */} -

- Document Information -

+ {knowledgeFormData.seedExamples?.map((seedExample, index) => ( + + + onToggle(index)} id={`seed-example-toggle-${index}`} className="accordion-toggle-item"> + Sample {index + 1} + + +
+ + Context: + {' '} + {seedExample.context} +
+ {seedExample.questionAndAnswers.map((qa, qaIndex) => ( + +
+ + Question: + {' '} + {qa.question} +
+
+ + Answer: + {' '} + {qa.answer} +
+
+ ))} +
+
+
+ ))} + -

- Repository URL: {knowledgeFormData.knowledgeDocumentRepositoryUrl} -

-

- Commit: {knowledgeFormData.knowledgeDocumentCommit} -

-

- Document Name: {knowledgeFormData.documentName} -

+ {/* Document Information */} +
+ + Document Information + + + Repository URL + + {knowledgeFormData.knowledgeDocumentRepositoryUrl} + + Commit + + {knowledgeFormData.knowledgeDocumentCommit} + + Name + + {knowledgeFormData.documentName} +
- {/* Attribution Information */} - {isGithubMode && ( -
-

- Attribution Information -

-

- Title of Work: {knowledgeFormData.titleWork} -

-

- Link to Work: {knowledgeFormData.linkWork} -

-

- Revision: {knowledgeFormData.revision} -

-

- License of Work: {knowledgeFormData.licenseWork} -

-

- Creators: {knowledgeFormData.creators} -

-
- )} - +
+ {/* Attribution Information */} + {isGithubMode && ( +
+ + Attribution Information + + + Title of Work: {knowledgeFormData.titleWork} + + + Link to Work: {knowledgeFormData.linkWork} + + + Revision: {knowledgeFormData.revision} + + + License of Work: {knowledgeFormData.licenseWork} + + + Creators: {knowledgeFormData.creators} + +
+ )} +
+
+ + ); }; diff --git a/src/components/Contribute/Skill/Github/index.tsx b/src/components/Contribute/Skill/Github/index.tsx index 5379324c..3da682c5 100644 --- a/src/components/Contribute/Skill/Github/index.tsx +++ b/src/components/Contribute/Skill/Github/index.tsx @@ -437,7 +437,7 @@ export const SkillFormGithub: React.FunctionComponent = ({ skill Dashboard - Skill Contribution + Create Skill Contribution @@ -445,7 +445,7 @@ export const SkillFormGithub: React.FunctionComponent = ({ skill - Skill Contribution + Create Skill Contribution diff --git a/src/components/Contribute/Skill/Native/index.tsx b/src/components/Contribute/Skill/Native/index.tsx index 16ef9b5e..1b497f11 100644 --- a/src/components/Contribute/Skill/Native/index.tsx +++ b/src/components/Contribute/Skill/Native/index.tsx @@ -385,7 +385,7 @@ export const SkillFormNative: React.FunctionComponent = ({ skill Dashboard - Skill Contribution + Create Skill Contribution @@ -393,7 +393,7 @@ export const SkillFormNative: React.FunctionComponent = ({ skill - Skill Contribution + Create Skill Contribution diff --git a/src/components/Contribute/Skill/ReviewSubmission/index.tsx b/src/components/Contribute/Skill/ReviewSubmission/index.tsx index a139ef61..73b8a852 100644 --- a/src/components/Contribute/Skill/ReviewSubmission/index.tsx +++ b/src/components/Contribute/Skill/ReviewSubmission/index.tsx @@ -1,7 +1,8 @@ // src/components/Contribute/Skill/ReviewSubmission/ReviewSubmission.tsx import { SkillFormData } from '@/types'; -import { Content, ContentVariants } from '@patternfly/react-core'; import React from 'react'; +import './submission.css'; +import { Content, ContentVariants, Accordion, AccordionContent, AccordionItem, AccordionToggle } from '@patternfly/react-core'; interface ReviewSubmissionProps { skillFormData: SkillFormData; @@ -9,78 +10,125 @@ interface ReviewSubmissionProps { } export const ReviewSubmission: React.FC = ({ skillFormData, isGithubMode }) => { + const [expanded, setExpanded] = React.useState<{ [key: string]: boolean }>({}); + + const onToggle = (id: number) => { + setExpanded((prevState) => ({ + ...prevState, + [id]: !prevState[id] + })); + }; + return ( -
- Review Submission - {/* Author Information */} -

- Author Information -

-

- Name: {skillFormData.name} -

-

- Email: {skillFormData.email} -

+ <> +
+ Review + + Review the information below and click finish to submit your skill contribution. Use the back button to make changes. + + {/* Author Information */} +
+
+ + Contributor Information + + + Information required for a Github Developer Certificate of Origin (DCO) sign-off. + + +
+ + Contributors + + {skillFormData.name} + {skillFormData.email} +
+
+
+ + {/* Skill Information */} +
+
+ + Skill Information + + + Brief information about the Skill and the directory path for the QnA and Attribution files. + +
+ + + Submission summary + + {skillFormData.submissionSummary} - {/* Skill Information */} -

- Skill Information -

-

- Submission Summary: {skillFormData.submissionSummary} -

-

- Document Outline: {skillFormData.documentOutline} -

+ + Directory path + + {skillFormData.filePath} +
- {/* File Path Information */} -

- File Path Information -

-

- File Path: {skillFormData.filePath} -

+ {/* Seed Examples */} +
+
+ Seed Examples + + Data that will be used to start teaching your model. + +
- {/* Seed Examples */} -

- Seed Examples -

- {skillFormData.seedExamples.map((seedExample, index) => ( -
-

- Seed Examples {index + 1} -

-

- Context: {seedExample.context} -

-

- Question {index + 1}: {seedExample.question} -

-

- Answer {index + 1}: {seedExample.answer} -

-
- ))} + {skillFormData.seedExamples?.map((seedExample, index) => ( + + + onToggle(index)} id={`seed-example-toggle-${index}`} className="accordion-toggle-item"> + Sample {index + 1} + + +
+ + Context: + {' '} + {seedExample.context} +
+
+ + Question: + {' '} + {seedExample.question} +
+
+ + Answer: + {' '} + {seedExample.answer} +
+
+
+
+ ))} +
- {/* Attribution Information */} - {isGithubMode && ( -
-

- Attribution Information -

-

- Title of Work: {skillFormData.titleWork} -

-

- License of Work: {skillFormData.licenseWork} -

-

- Creators: {skillFormData.creators} -

-
- )} -
+
+ {/* Attribution Information */} + {isGithubMode && ( +
+ + Attribution Information + + + Title of Work: {skillFormData.titleWork} + + + License of Work: {skillFormData.licenseWork} + + + Creators: {skillFormData.creators} + +
+ )} +
+ + ); }; diff --git a/src/components/Contribute/Skill/ReviewSubmission/submission.css b/src/components/Contribute/Skill/ReviewSubmission/submission.css new file mode 100644 index 00000000..ffce5169 --- /dev/null +++ b/src/components/Contribute/Skill/ReviewSubmission/submission.css @@ -0,0 +1,49 @@ +/* using common styles for both skill and knowledge review submission forms */ +.review-submission-container { + .contributors-wrapper { + line-height: 2; + padding-top: var(--pf-t--global--spacer--md); + } + + .info-wrapper { + padding-bottom: var(--pf-t--global--spacer--md); + } + + .submission-titles { + font-size: var(--pf-t--global--font--size--sm) !important; + } + + .submission-subtitles { + line-height: 1; + font-size: var(--pf-t--global--font--size--xs) !important; + } + + .category-titles { + font-weight: var(pf-t--global--font--weight--heading); + font-size: var(--pf-t--global--font--size--xs) !important; + } + + .accordion-wrapper { + padding-bottom: var(--pf-t--global--spacer--md); + } + + .accordion-content { + padding: var(--pf-t--global--spacer--md); + } + + .accordion-content { + cursor: pointer; + line-height: 1.5; + } + + /* override patternfly colors per design recommendation */ + .pf-v6-c-accordion__toggle:is(:hover, :focus) { + background-color: #f1f1f1; + } + + .seed-category-titles { + font-weight: var(pf-t--global--font--weight--heading); + font-size: var(--pf-t--global--font--size--xs) !important; + padding-bottom: var(--pf-t--global--spacer--sm); + } +}