Skip to content
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
7 changes: 7 additions & 0 deletions localization/TranscriberAdmin-en-1.2.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -9414,6 +9414,13 @@
<context context-type="sourcefile">StepItem.tsx</context>
</context-group>
</trans-unit>
<trans-unit id="stepEditor.settingsFor">
<source>Settings for {0} of {1}</source>
<target/>
<context-group>
<context context-type="sourcefile">StepEditor.tsx</context>
</context-group>
</trans-unit>
<trans-unit id="stepEditor.show">
<source>Show</source>
<target/>
Expand Down
6 changes: 6 additions & 0 deletions localization/TranscriberAdmin-en.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -8068,6 +8068,12 @@
<target/>
</segment>
</unit>
<unit id="stepEditor.settingsFor">
<segment>
<source>Settings for {0} of {1}</source>
<target/>
</segment>
</unit>
<unit id="stepEditor.show">
<segment>
<source>Show</source>
Expand Down
1 change: 1 addition & 0 deletions src/renderer/public/localization/strings2ecd8049.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion src/renderer/public/localization/strings59ed000e.json

This file was deleted.

8 changes: 6 additions & 2 deletions src/renderer/src/components/MediaRecord.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ function MediaRecord(props: IProps) {
isSaveDisabled,
} = props;
const context = usePassageDetailContext();
const simplified = Boolean(context?.isBoldWorkflow);
const effectiveOneTryOnly = oneTryOnly || simplified;
const effectiveIsStopLogic = isStopLogic || simplified;
const { settings: toolSettings } = useStepTool(context?.currentstep || '');
const captureAudioProcessing = useMemo(
() => parseRecordCaptureAudioProcessing(toolSettings),
Expand Down Expand Up @@ -573,7 +576,7 @@ function MediaRecord(props: IProps) {
loading={loading}
allowZoom={allowZoom}
allowDeltaVoice={allowDeltaVoice}
oneTryOnly={oneTryOnly}
oneTryOnly={effectiveOneTryOnly}
width={width}
height={height || 300}
mediaId={mediaId}
Expand All @@ -598,7 +601,8 @@ function MediaRecord(props: IProps) {
captureNoiseSuppression={captureAudioProcessing.noiseSuppression}
keepItSmall={keepItSmall}
hasRecording={hasRecording ?? false}
isStopLogic={isStopLogic ?? false}
isStopLogic={effectiveIsStopLogic}
hideWaveformEditTools={simplified}
isRecordingRights={isRecordingRights}
handleUpload={handleUpload}
rightsLeftActions={rightsLeftActions}
Expand Down
31 changes: 17 additions & 14 deletions src/renderer/src/components/PassageDetail/PassageDetailGrids.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ const PassageDetailGrids = () => {

const [memory] = useGlobal('memory');
const ctx = useContext(PassageDetailContext);
const { currentstep, orgWorkflowSteps, mediafileId, sectionArr } = ctx.state;
const { currentstep, orgWorkflowSteps, mediafileId, sectionArr, isBoldWorkflow } =
ctx.state;

const { tool, settings } = useStepTool(currentstep);
const { slugFromId } = useArtifactType();
Expand Down Expand Up @@ -231,19 +232,21 @@ const PassageDetailGrids = () => {
? addPt(t.getString(tool))
: tool}
</Grid>
<Grid
id="stepcomplete"
sx={{
display: 'flex',
justifyContent: 'flex-end',
minWidth: 0,
flexShrink: 0,
ml: 'auto',
}}
size={{ xs: 'auto' }}
>
<PassageDetailStepComplete />
</Grid>
{!isBoldWorkflow && (
<Grid
id="stepcomplete"
sx={{
display: 'flex',
justifyContent: 'flex-end',
minWidth: 0,
flexShrink: 0,
ml: 'auto',
}}
size={{ xs: 'auto' }}
>
<PassageDetailStepComplete />
</Grid>
)}
</Grid>
<Grid
sx={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const PassageDetailStepComplete = () => {
section,
passage,
recording,
isBoldWorkflow,
} = usePassageDetailContext();
const { canDoSectionStep, canAlwaysDoStep } = useStepPermissions();
const { pathname } = useLocation();
Expand Down Expand Up @@ -71,6 +72,8 @@ export const PassageDetailStepComplete = () => {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [pathname]);

if (isBoldWorkflow) return null;

return (
<Box
sx={{ display: 'flex', alignItems: 'center', minWidth: 0, flexShrink: 1 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,14 @@ const mountMobileStepComplete = ({
recording = false,
remoteBusy = false,
importexportBusy = false,
isBoldWorkflow = false,
}: {
hasPermission?: boolean;
complete?: boolean;
recording?: boolean;
remoteBusy?: boolean;
importexportBusy?: boolean;
isBoldWorkflow?: boolean;
} = {}) => {
const setStepComplete = cy.stub().as('setStepComplete').resolves();
const gotoNextStep = cy.stub().as('gotoNextStep');
Expand Down Expand Up @@ -199,6 +201,7 @@ const mountMobileStepComplete = ({
stepComplete,
setStepComplete,
gotoNextStep,
isBoldWorkflow,
});
const initialState = createInitialState({
remoteBusy,
Expand Down Expand Up @@ -279,4 +282,11 @@ describe('MobileStepComplete', () => {

cy.get('#mobile-complete').should('be.disabled');
});

it('renders nothing for BOLD workflow', () => {
mountMobileStepComplete({ isBoldWorkflow: true });

cy.get('#mobile-complete').should('not.exist');
cy.contains('Complete').should('not.exist');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export default function MobileStepComplete() {
section,
passage,
recording,
isBoldWorkflow,
} = usePassageDetailContext();
const { canDoSectionStep } = useStepPermissions();
const [busy] = useGlobal('remoteBusy');
Expand All @@ -43,6 +44,8 @@ export default function MobileStepComplete() {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [complete, currentstep, passage, section]);

if (isBoldWorkflow) return null;

return (
<Box
sx={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,4 +376,41 @@ describe('PassageDetailMobileFooter', () => {
cy.contains('button', 'Record').click();
cy.get('@setCurrentStep').should('have.been.calledWith', 'step-2');
});

it('in BOLD workflow uses step progression and hides step complete', () => {
const passages = [
createPassage('passage-1', 1, 'remote-1'),
createPassage('passage-2', 2, 'remote-2'),
];
const orgWorkflowSteps = [
{
id: 'step-1',
type: 'orgworkflowstep' as const,
attributes: { name: 'Discuss', tool: '{}', sequencenum: 1 },
},
{
id: 'step-2',
type: 'orgworkflowstep' as const,
attributes: { name: 'Record', tool: '{}', sequencenum: 2 },
},
];

mountFooter({
passages,
currentPassageId: 'passage-1',
passageDetailOverrides: {
isBoldWorkflow: true,
currentstep: 'step-1',
orgWorkflowSteps:
orgWorkflowSteps as PassageDetailState['orgWorkflowSteps'],
},
});

cy.get('#mobile-complete').should('not.exist');
cy.contains('button', '2:2').should('not.exist');
cy.contains('button', 'Record').should('be.visible');
cy.contains('button', 'Record').click();
cy.get('@setCurrentStep').should('have.been.calledWith', 'step-2');
cy.get('[data-cy="location"]').should('have.text', '/detail/project-1/remote-1');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export default function PassageDetailMobileFooter() {
setCurrentStep,
currentstep,
orgWorkflowSteps = [],
isBoldWorkflow,
} = usePassageDetailContext();
const t: IMobileStrings = useSelector(mobileSelector, shallowEqual);
const [memory] = useGlobal('memory');
Expand All @@ -63,6 +64,7 @@ export default function PassageDetailMobileFooter() {
const { localizedWorkStepFromId } = useOrgWorkflowSteps();

const isStepProgression =
isBoldWorkflow ||
getOrgDefault(orgDefaultWorkflowProgression) === 'step';

const sortedSteps = useMemo(
Expand Down Expand Up @@ -133,7 +135,9 @@ export default function PassageDetailMobileFooter() {
<Box
sx={{
display: 'grid',
gridTemplateColumns: 'minmax(0, 1fr) auto minmax(0, 1fr)',
gridTemplateColumns: isBoldWorkflow
? 'minmax(0, 1fr) minmax(0, 1fr)'
: 'minmax(0, 1fr) auto minmax(0, 1fr)',
alignItems: 'center',
gap: 0.5,
width: '100%',
Expand All @@ -159,16 +163,18 @@ export default function PassageDetailMobileFooter() {
/>
</Button>
</Box>
<Box
sx={{
flexShrink: 0,
display: 'flex',
justifyContent: 'center',
minWidth: 'min-content',
}}
>
<MobileStepComplete />
</Box>
{!isBoldWorkflow && (
<Box
sx={{
flexShrink: 0,
display: 'flex',
justifyContent: 'center',
minWidth: 'min-content',
}}
>
<MobileStepComplete />
</Box>
)}
<Box sx={{ minWidth: 0, display: 'flex', justifyContent: 'flex-end' }}>
<Button
size="small"
Expand Down
24 changes: 16 additions & 8 deletions src/renderer/src/components/StepEditor/StepEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -455,17 +455,25 @@ export const StepEditor = ({ process, org }: IProps) => {
const prettySettings = (tool: string, settings: string) => {
const json = settings ? JSON.parse(settings) : undefined;
switch (tool as ToolSlug) {
case ToolSlug.Record:
case ToolSlug.Transcribe:
case ToolSlug.Paratext:
if (json)
return localizedArtifactTypeFromId(
remoteIdGuid(
'artifacttype',
json.artifactTypeId,
memory?.keyMap as RecordKeyMap
) ?? json.artifactTypeId
);
return localizedArtifactTypeFromId(VernacularTag);
return se.settingsFor
.replace('{0}', st.getString(tool as keyof typeof se))
.replace(
'{1}',
localizedArtifactTypeFromId(
remoteIdGuid(
'artifacttype',
json.artifactTypeId,
memory?.keyMap as RecordKeyMap
) ?? json.artifactTypeId
)
);
return se.settingsFor
.replace('{0}', st.getString(tool as keyof typeof se))
.replace('{1}', localizedArtifactTypeFromId(VernacularTag));
default:
return '';
}
Expand Down
15 changes: 12 additions & 3 deletions src/renderer/src/components/WSAudioPlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ interface IProps {
onAutoSegment?: () => void;
hasRecording?: boolean;
isStopLogic?: boolean;
/** When true, hide undo and scissors (region delete) waveform edit tools. */
hideWaveformEditTools?: boolean;
hasSegmentUndo?: boolean;
onSegmentUndo?: () => void;
isRecordingRights?: boolean;
Expand Down Expand Up @@ -294,6 +296,7 @@ function WSAudioPlayer(props: IProps) {
onAutoSegment,
hasRecording,
isStopLogic,
hideWaveformEditTools,
hasSegmentUndo,
onSegmentUndo,
isRecordingRights,
Expand Down Expand Up @@ -1732,16 +1735,22 @@ function WSAudioPlayer(props: IProps) {
waitingForAI ||
Boolean(loading) ||
Boolean(busy) ||
(Boolean(myMediaId) && !ready && !recording && !waitingForAI)
(Boolean(myMediaId) && !ready && !recording && !waitingForAI) ||
(Boolean(oneTryOnly) && oneShotUsed && !recording)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be effectiveOneTryOnly? If not, maybe a comment why not?

}
tooltipTitle={recordTooltipTitle}
hasRecording={hasRecording ?? false}
isStopLogic={isStopLogic ?? false}
oneShotUsed={oneShotUsed}
{...opts}
/>
);

const deleteRegionNode = hasRegion !== 0 && !oneShotUsed && !isMobileView && (
const deleteRegionNode =
!hideWaveformEditTools &&
hasRegion !== 0 &&
!oneShotUsed &&
!isMobileView && (
<LightTooltip id="wsAudioDeleteRegionTip" title={t.deleteRegion}>
<span>
<IconButton
Expand All @@ -1755,7 +1764,7 @@ function WSAudioPlayer(props: IProps) {
</LightTooltip>
);

const undoNode = canUndo && !oneShotUsed && (
const undoNode = !hideWaveformEditTools && canUndo && !oneShotUsed && (
<LightTooltip id="wsUndoTip" title={t.undoTip}>
<span>
<IconButton
Expand Down
9 changes: 9 additions & 0 deletions src/renderer/src/context/PassageDetailContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ import { BlobStatus, useFetchMediaBlob } from '../crud/useFetchMediaBlob';
import { useFilteredSteps } from '../crud/useFilteredSteps';
import { useOrgDefaults } from '../crud/useOrgDefaults';
import { useOrgWorkflowSteps } from '../crud/useOrgWorkflowSteps';
import {
BOLD_WORKFLOW_PROCESS,
useTeamWorkflowProcess,
} from '../crud/useTeamWorkflowProcess';
import StickyRedirect from '../components/StickyRedirect';
import {
infoMsg,
Expand Down Expand Up @@ -202,6 +206,7 @@ const initState = {
canPublish: false,
discussOpen: false,
setDiscussOpen: (_discussOpen: boolean) => {},
isBoldWorkflow: false,
};

export type ICtxState = typeof initState;
Expand Down Expand Up @@ -283,6 +288,8 @@ const PassageDetailProvider = (props: IProps) => {
const { getOrgDefault } = useOrgDefaults();
const getGlobal = useGetGlobal();
const { canPublish } = useProjectPermissions();
const teamWorkflowProcess = useTeamWorkflowProcess(org);
const isBoldWorkflow = teamWorkflowProcess === BOLD_WORKFLOW_PROCESS;

const setCurrentStep = (stepId: string) => {
if (getGlobal('changed')) {
Expand Down Expand Up @@ -544,6 +551,7 @@ const PassageDetailProvider = (props: IProps) => {

const gotoNextStep = () => {
const gotoNextPassage =
!isBoldWorkflow &&
getOrgDefault(orgDefaultWorkflowProgression) !== 'step';
const nextpsg = gotoNextPassage
? nextPasId(state.section, state.passage.id, memory)
Expand Down Expand Up @@ -1139,6 +1147,7 @@ const PassageDetailProvider = (props: IProps) => {
handleHighlightDiscussion,
forceRefresh,
setDiscussOpen,
isBoldWorkflow,
sectionArr: (getProjectDefault(projDefSectionMap) ??
[]) as SectionArray,
},
Expand Down
Loading
Loading