-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Add search toolbar and "all questions" tab to questionnaire view pa…
…ge, clean up layout (#1313) Resolves #1293. We determined we don't need the filter dropdown (at least for now), just the search bar. * Cleans up some layout issues on the page. * Adds an "All questions" tab above the section tabs. When viewing this tab, the questions table has a "Section" column so you can still tell the sections apart when they are viewed together. * Adds the total number of questions under each tab title. When the search bar is used, a badge appears next to this to show how many questions match the search. * Adds an empty state to the table if there are no questions matching your search. <img width="1500" alt="Screenshot 2023-08-25 at 2 24 18 PM" src="https://github.com/konveyor/tackle2-ui/assets/811963/c655ba4e-4a18-493a-87ad-ff1e3c926da3"> ![U4kHZuOvzh](https://github.com/konveyor/tackle2-ui/assets/811963/3698dc9e-5841-44e4-9fee-40752b4def86) <img width="1501" alt="Screenshot 2023-08-25 at 2 31 19 PM" src="https://github.com/konveyor/tackle2-ui/assets/811963/27e547c8-76dc-4398-9a2f-84cd9da64e8c"> --------- Signed-off-by: Mike Turley <mike.turley@alum.cs.umass.edu>
- Loading branch information
Showing
5 changed files
with
237 additions
and
86 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
32 changes: 32 additions & 0 deletions
32
.../pages/assessment-management/questionnaire/components/questionnaire-section-tab-title.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,32 @@ | ||
import React from "react"; | ||
import { TabTitleText, Badge } from "@patternfly/react-core"; | ||
import spacing from "@patternfly/react-styles/css/utilities/Spacing/spacing"; | ||
import { CustomYamlAssessmentQuestion } from "@app/api/models"; | ||
|
||
const QuestionnaireSectionTabTitle: React.FC<{ | ||
isSearching: boolean; | ||
sectionName: string; | ||
unfilteredQuestions: CustomYamlAssessmentQuestion[]; | ||
filteredQuestions: CustomYamlAssessmentQuestion[]; | ||
}> = ({ isSearching, sectionName, unfilteredQuestions, filteredQuestions }) => ( | ||
<TabTitleText aria-label="vertical" role="region"> | ||
{sectionName} | ||
<br /> | ||
<small> | ||
{unfilteredQuestions.length} questions | ||
{isSearching ? ( | ||
<Badge | ||
screenReaderText="Questions matching search" | ||
className={spacing.mlSm} | ||
isRead={filteredQuestions.length === 0} | ||
> | ||
{`${filteredQuestions.length} match${ | ||
filteredQuestions.length === 1 ? "" : "es" | ||
}`} | ||
</Badge> | ||
) : null} | ||
</small> | ||
</TabTitleText> | ||
); | ||
|
||
export default QuestionnaireSectionTabTitle; |
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
11 changes: 8 additions & 3 deletions
11
client/src/app/pages/assessment-management/questionnaire/questionnaire-page.css
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,11 @@ | ||
.tabs-vertical-container { | ||
width: 20em; | ||
display: flex; | ||
} | ||
.tab-content-container { | ||
width: 80em; | ||
|
||
.tabs-vertical-container .pf-v5-c-tabs { | ||
width: 20%; | ||
} | ||
|
||
.tabs-vertical-container .pf-v5-c-tab-content { | ||
width: 80%; | ||
} |
Oops, something went wrong.