Skip to content
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

Styling/layout improvements #473

Merged
merged 3 commits into from
Jan 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/components/cipp/CippDatatable.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ export default function CippDatatable({
sortFocus: {
default: 'var(--cipp-table-sort-focus-bg)',
},
highlightOnHover: {
default: 'var(--cipp-table-highlight-on-hover-bg)',
text: 'var(--cipp-table-highlight-on-hover-color)',
},
striped: {
default: 'var(--cipp-table-striped-bg)',
text: 'var(--cipp-table-striped-color)',
Expand Down
6 changes: 4 additions & 2 deletions src/components/cipp/PdfButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { CButton } from '@coreui/react'
import jsPDF from 'jspdf'
import 'jspdf-autotable'
import PropTypes from 'prop-types'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faFilePdf } from '@fortawesome/free-solid-svg-icons'

function ExportPDFButton(props) {
const exportPDF = (pdfData, pdfHeaders, pdfSize = 'A4', reportName) => {
Expand Down Expand Up @@ -40,10 +42,10 @@ function ExportPDFButton(props) {
return (
<CButton
size="sm"
className="text-white m-1"
className="m-1"
onClick={() => exportPDF(props.pdfData, props.pdfHeaders, props.pdfSize, props.reportName)}
>
PDF
<FontAwesomeIcon icon={faFilePdf} className='pe-1' size='lg' />PDF
</CButton>
)
}
Expand Down
39 changes: 30 additions & 9 deletions src/components/cipp/StatusIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,41 @@ const IconWarning = () => (
)

function StatusIcon(props) {
const finalState = props.finalState
if (finalState === 'Pass') {
return <IconGreenCheck />
} else if (finalState === 'Fail') {
return <IconRedX />
} else if (finalState === 'Warn') {
return <IconWarning />
} else {
return ''
if (props.type === 'finalstate') {
const finalState = props.finalState
if (finalState === 'Pass') {
return <IconGreenCheck />
} else if (finalState === 'Fail') {
return <IconRedX />
} else if (finalState === 'Warn') {
return <IconWarning />
} else {
return ''
}
} else if (props.type === 'boolean') {
const status = props.status
if (status === true) {
return <IconGreenCheck />
} else if (status === false) {
return <IconRedX />
} else {
return ''
}
} else if (props.type === 'negatedboolean') {
const status = props.status
if (status === false) {
return <IconGreenCheck />
} else if (status === true) {
return <IconRedX />
} else {
return ''
}
}
}

export default StatusIcon

StatusIcon.propTypes = {
finalState: PropTypes.string,
status: PropTypes.bool,
}
Loading