Merge branch 'main' into deploy-app-dev

This commit is contained in:
danfunk 2023-07-06 16:39:05 -04:00
commit 9107263f3a
8 changed files with 99 additions and 88 deletions

View File

@ -73,29 +73,20 @@ export default function InstructionsForEndUser({
return null; return null;
}; };
let instructionsShown = instructions; let className = 'markdown';
if (collapsed) { if (collapsed) {
if (wordCount(instructions) > maxWordCount) { className += ' markdown-collapsed';
instructionsShown = instructions
.split(' ')
.slice(0, maxWordCount)
.join(' ');
instructionsShown += '...';
} else if (lineCount(instructions) > maxLineCount) {
instructionsShown = instructions.split('\n').slice(0, 5).join(' ');
instructionsShown += '...';
}
} }
return ( return (
<div style={{ margin: '20px 0 20px 0' }}> <div style={{ margin: '20px 0 20px 0' }}>
<div className="markdown"> <div className={className}>
{/* {/*
https://www.npmjs.com/package/@uiw/react-md-editor switches to dark mode by default by respecting @media (prefers-color-scheme: dark) https://www.npmjs.com/package/@uiw/react-md-editor switches to dark mode by default by respecting @media (prefers-color-scheme: dark)
This makes it look like our site is broken, so until the rest of the site supports dark mode, turn off dark mode for this component. This makes it look like our site is broken, so until the rest of the site supports dark mode, turn off dark mode for this component.
*/} */}
<div data-color-mode="light"> <div data-color-mode="light">
<MDEditor.Markdown linkTarget="_blank" source={instructionsShown} /> <MDEditor.Markdown linkTarget="_blank" source={instructions} />
</div> </div>
</div> </div>
{showCollapseToggle()} {showCollapseToggle()}

View File

@ -1195,7 +1195,7 @@ export default function ProcessInstanceListTable({
); );
}); });
return ( return (
<Grid fullWidth> <Grid narrow fullWidth className="filter-buttons">
{tags} {tags}
<Column md={1} lg={1} sm={1}> <Column md={1} lg={1} sm={1}>
<Button <Button

View File

@ -180,17 +180,23 @@ h1.with-icons {
} }
dl { dl {
display: grid; display: block;
line-height: 1.2em; grid-template-columns: 35% 65%;
grid-template-columns: 25% 75%; font-size: .8rem;
line-height: 1.2rem;
} }
dt { dl dt {
display: inline-block;
font-weight: 600; font-weight: 600;
font-size: 14px; min-width: 5rem;
line-height: 18px;
color: #161616; color: #161616;
}
dl dd {
display: inline-block;
padding-left: 1rem;
color: #525252;
} }
.smaller-text { .smaller-text {
@ -398,9 +404,11 @@ td.actions-cell {
.process-instance-list-table { .process-instance-list-table {
margin: 0; margin: 0;
padding: 0; padding: 0;
width: fit-content;
} }
.process-instance-list-table button.button-tag {
max-width: calc(100% - 1rem);
}
.process-instance-table-header { .process-instance-table-header {
margin-bottom: 1em; margin-bottom: 1em;

View File

@ -23,20 +23,20 @@ main {
} }
.fixed-width-container { .fixed-width-container {
padding-left: 0px; padding-left: 0;
overflow: visible; overflow: visible;
} }
@media (min-width: 1400px) { @media (min-width: 99rem) {
.fixed-width-container { .fixed-width-container {
max-width: 1280px; max-width: 99rem;
padding-right: 0; padding-right: 0;
} }
} }
@media (min-width: 1056px) { @media (min-width: 80rem) {
.fixed-width-container { .fixed-width-container {
padding-left: 180px; padding-left: 10rem;
padding-right: 2rem; padding-right: 2rem;
} }
} }
@ -48,13 +48,27 @@ li.cds--accordion__item {
max-width: 100%; max-width: 100%;
} }
div.show-page, div.markdown, div.markdown-collapsed, div.markdown-collapsable { div.markdown {
margin: 0 auto;
max-width: 1000px; max-width: 1000px;
padding: 15px 0 15px 0; padding: 15px 0 15px 0;
overflow: visible; overflow: visible;
} }
div.markdown-collapsed {
max-height: 200px;
overflow: hidden;
--mask: linear-gradient(to bottom,
rgba(0,0,0, 1) 0, rgba(0,0,0, 1) 40%,
rgba(0,0,0, 0) 95%, rgba(0,0,0, 0) 0
) 100% 50% / 100% 100% repeat-x;
font: 2em/1.6em Arial;
-webkit-mask: var(--mask);
mask: var(--mask);
}
.cds--data-table-content { .cds--data-table-content {
width: fit-content; width: fit-content;
min-width: 100%; min-width: 100%;

View File

@ -336,7 +336,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
return ( return (
<Grid condensed fullWidth> <Grid condensed fullWidth>
<Column sm={4} md={4} lg={8}> <Column sm={4} md={4} lg={5}>
<dl> <dl>
<dt>Status:</dt> <dt>Status:</dt>
<dd> <dd>
@ -1070,59 +1070,57 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
return ( return (
<> <>
<div className="show-page"> <ProcessBreadcrumb
<ProcessBreadcrumb hotCrumbs={[
hotCrumbs={[ ['Process Groups', '/admin'],
['Process Groups', '/admin'], {
{ entityToExplode: processModelId,
entityToExplode: processModelId, entityType: 'process-model-id',
entityType: 'process-model-id', linkLastItem: true,
linkLastItem: true, },
}, [`Process Instance Id: ${processInstance.id}`],
[`Process Instance Id: ${processInstance.id}`], ]}
]} />
/> <Stack orientation="horizontal" gap={1}>
<Stack orientation="horizontal" gap={1}> <h1 className="with-icons">
<h1 className="with-icons"> Process Instance Id: {processInstance.id}
Process Instance Id: {processInstance.id} </h1>
</h1> {buttonIcons()}
{buttonIcons()} </Stack>
</Stack> {getInfoTag()}
{getInfoTag()} <ProcessInterstitial
<ProcessInterstitial processInstanceId={processInstance.id}
processInstanceId={processInstance.id} processInstanceShowPageUrl={processInstanceShowPageBaseUrl}
processInstanceShowPageUrl={processInstanceShowPageBaseUrl} allowRedirect={false}
allowRedirect={false} smallSpinner
smallSpinner collapsableInstructions
collapsableInstructions executeTasks={false}
executeTasks={false} />
/> <Grid condensed fullWidth>
<Grid condensed fullWidth> <Column md={6} lg={8} sm={4}>
<Column md={6} lg={8} sm={4}> <TaskListTable
<TaskListTable apiPath="/tasks"
apiPath="/tasks" additionalParams={`process_instance_id=${processInstance.id}`}
additionalParams={`process_instance_id=${processInstance.id}`} tableTitle="Tasks I can complete"
tableTitle="Tasks I can complete" tableDescription="These are tasks that can be completed by you, either because they were assigned to a group you are in, or because they were assigned directly to you."
tableDescription="These are tasks that can be completed by you, either because they were assigned to a group you are in, or because they were assigned directly to you." paginationClassName="with-large-bottom-margin"
paginationClassName="with-large-bottom-margin" textToShowIfEmpty="There are no tasks you can complete for this process instance."
textToShowIfEmpty="There are no tasks you can complete for this process instance." shouldPaginateTable={false}
shouldPaginateTable={false} showProcessModelIdentifier={false}
showProcessModelIdentifier={false} showProcessId={false}
showProcessId={false} showStartedBy={false}
showStartedBy={false} showTableDescriptionAsTooltip
showTableDescriptionAsTooltip showDateStarted={false}
showDateStarted={false} showLastUpdated={false}
showLastUpdated={false} hideIfNoTasks
hideIfNoTasks canCompleteAllTasks
canCompleteAllTasks />
/> </Column>
</Column> </Grid>
</Grid> {taskUpdateDisplayArea()}
{taskUpdateDisplayArea()} {processDataDisplayArea()}
{processDataDisplayArea()} <br />
<br /> {viewMostRecentStateComponent()}
{viewMostRecentStateComponent()}
</div>
{getTabs()} {getTabs()}
</> </>
); );

View File

@ -16,7 +16,7 @@ export default function ProcessInterstitialPage({ variant }: OwnProps) {
} }
return ( return (
<div className="show-page"> <>
<ProcessBreadcrumb <ProcessBreadcrumb
hotCrumbs={[ hotCrumbs={[
['Process Groups', '/admin'], ['Process Groups', '/admin'],
@ -36,6 +36,6 @@ export default function ProcessInterstitialPage({ variant }: OwnProps) {
processInstanceShowPageUrl={processInstanceShowPageUrl} processInstanceShowPageUrl={processInstanceShowPageUrl}
allowRedirect allowRedirect
/> />
</div> </>
); );
} }

View File

@ -616,7 +616,7 @@ export default function ProcessModelShow() {
if (processModel) { if (processModel) {
return ( return (
<div className="show-page"> <>
{fileUploadModal()} {fileUploadModal()}
{confirmOverwriteFileDialog()} {confirmOverwriteFileDialog()}
<ProcessBreadcrumb <ProcessBreadcrumb
@ -718,7 +718,7 @@ export default function ProcessModelShow() {
/> />
<span data-qa="process-model-show-permissions-loaded" /> <span data-qa="process-model-show-permissions-loaded" />
</Can> </Can>
</div> </>
); );
} }
return null; return null;

View File

@ -502,7 +502,7 @@ export default function TaskShow() {
} }
return ( return (
<div className="show-page"> <>
<ProcessBreadcrumb <ProcessBreadcrumb
hotCrumbs={[ hotCrumbs={[
[ [
@ -521,7 +521,7 @@ export default function TaskShow() {
</h3> </h3>
<InstructionsForEndUser task={task} /> <InstructionsForEndUser task={task} />
{formElement()} {formElement()}
</div> </>
); );
} }