-
-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
V4 edit cycle: Review and Deploy modal [1/n] (#4440)
- Loading branch information
1 parent
f3fc0a8
commit ece5353
Showing
42 changed files
with
1,476 additions
and
18 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...dingCycleDetails/FundingCycleListItem.tsx → src/components/FundingCycleListItem.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
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
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
1 change: 1 addition & 0 deletions
1
...oject/V2V3FundingCycleSection/FundingCycleDetails/FundingCycleListItems/DurationValue.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
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
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
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
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
2 changes: 1 addition & 1 deletion
2
...Project/V2V3ProjectSettings/pages/EditCyclePage/ReviewConfirmModal/DetailsSectionDiff.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
2 changes: 1 addition & 1 deletion
2
...Project/V2V3ProjectSettings/pages/EditCyclePage/ReviewConfirmModal/PayoutsSectionDiff.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
2 changes: 1 addition & 1 deletion
2
...3Project/V2V3ProjectSettings/pages/EditCyclePage/ReviewConfirmModal/TokensSectionDiff.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
2 changes: 1 addition & 1 deletion
2
...ages/v2v3/components/shared/DiffedSplits/DiffedSplitFields/DiffedJBProjectBeneficiary.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
2 changes: 1 addition & 1 deletion
2
src/packages/v2v3/components/shared/DiffedSplits/DiffedSplitFields/DiffedLockedUntil.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
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
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
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
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
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
145 changes: 145 additions & 0 deletions
145
...ckages/v4/views/V4ProjectSettings/EditCyclePage/ReviewConfirmModal/DetailsSectionDiff.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,145 @@ | ||
import { Trans, t } from '@lingui/macro' | ||
|
||
import { FundingCycleListItem } from 'components/FundingCycleListItem' | ||
import { DiffSection } from './DiffSection' | ||
import { ApprovalStrategyValue } from './FormattedRulesetValues/DetailsSection/ApprovalStrategyValue' | ||
import { DurationValue } from './FormattedRulesetValues/DetailsSection/DurationValue' | ||
import { useDetailsSectionValues } from './hooks/useDetailsSectionValues' | ||
|
||
export const emptySectionClasses = 'text-sm text-secondary pt-2 pb-3' | ||
|
||
export function DetailsSectionDiff() { | ||
const { | ||
advancedOptionsHasDiff, | ||
sectionHasDiff, | ||
|
||
currentDuration, | ||
newDuration, | ||
durationHasDiff, | ||
|
||
currentBallot, | ||
newBallot, | ||
ballotHasDiff, | ||
|
||
newPausePay, | ||
currentPausePay, | ||
pausePayHasDiff, | ||
|
||
newSetTerminals, | ||
currentSetTerminals, | ||
allowSetTerminalsHasDiff, | ||
|
||
newAllowTerminalMigration, | ||
currentAllowTerminalMigration, | ||
allowTerminalMigrationHasDiff, | ||
|
||
newSetController, | ||
currentSetController, | ||
allowSetControllerHasDiff, | ||
} = useDetailsSectionValues() | ||
|
||
if (!sectionHasDiff) { | ||
return ( | ||
<div className={emptySectionClasses}> | ||
<Trans>No edits were made to cycle details for this cycle.</Trans> | ||
</div> | ||
) | ||
} | ||
|
||
return ( | ||
<DiffSection | ||
content={ | ||
<> | ||
{durationHasDiff && ( | ||
<FundingCycleListItem | ||
name={t`Duration`} | ||
value={<DurationValue duration={newDuration} />} | ||
oldValue={<DurationValue duration={currentDuration} />} | ||
/> | ||
)} | ||
{ballotHasDiff && currentBallot && ( | ||
<FundingCycleListItem | ||
name={t`Edit deadline`} | ||
value={ | ||
<ApprovalStrategyValue | ||
approvalStrategy={newBallot} | ||
warningText={undefined} | ||
/> | ||
} | ||
oldValue={ | ||
<ApprovalStrategyValue | ||
approvalStrategy={currentBallot} | ||
warningText={undefined} | ||
/> | ||
} | ||
/> | ||
)} | ||
</> | ||
} | ||
advancedOptions={ | ||
advancedOptionsHasDiff && ( | ||
<> | ||
{pausePayHasDiff && ( | ||
<FundingCycleListItem | ||
name={t`Payments disabled`} | ||
value={ | ||
<span className="capitalize">{newPausePay.toString()}</span> | ||
} | ||
oldValue={ | ||
<span className="capitalize"> | ||
{currentPausePay.toString()} | ||
</span> | ||
} | ||
/> | ||
)} | ||
{allowSetTerminalsHasDiff && ( | ||
<FundingCycleListItem | ||
name={t`Enable payment terminal config`} | ||
value={ | ||
<span className="capitalize"> | ||
{newSetTerminals.toString()} | ||
</span> | ||
} | ||
oldValue={ | ||
<span className="capitalize"> | ||
{currentSetTerminals.toString()} | ||
</span> | ||
} | ||
/> | ||
)} | ||
{allowTerminalMigrationHasDiff && ( | ||
<FundingCycleListItem | ||
name={t`Enable payment terminal migrations`} | ||
value={ | ||
<span className="capitalize"> | ||
{newAllowTerminalMigration.toString()} | ||
</span> | ||
} | ||
oldValue={ | ||
<span className="capitalize"> | ||
{currentAllowTerminalMigration.toString()} | ||
</span> | ||
} | ||
/> | ||
)} | ||
{allowSetControllerHasDiff && ( | ||
<FundingCycleListItem | ||
name={t`Enable controller config`} | ||
value={ | ||
<span className="capitalize"> | ||
{newSetController.toString()} | ||
</span> | ||
} | ||
oldValue={ | ||
<span className="capitalize"> | ||
{currentSetController.toString()} | ||
</span> | ||
} | ||
/> | ||
)} | ||
</> | ||
) | ||
} | ||
/> | ||
) | ||
} |
23 changes: 23 additions & 0 deletions
23
src/packages/v4/views/V4ProjectSettings/EditCyclePage/ReviewConfirmModal/DiffSection.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,23 @@ | ||
import { Trans } from '@lingui/macro' | ||
|
||
export function DiffSection({ | ||
content, | ||
advancedOptions, | ||
}: { | ||
content: React.ReactNode | ||
advancedOptions?: React.ReactNode | ||
}) { | ||
return ( | ||
<div className="flex flex-col gap-1 pt-1 text-sm"> | ||
{content} | ||
{advancedOptions ? ( | ||
<> | ||
<div className="py-3 font-semibold"> | ||
<Trans>Advanced options:</Trans> | ||
</div> | ||
{advancedOptions} | ||
</> | ||
) : null} | ||
</div> | ||
) | ||
} |
Oops, something went wrong.