Skip to content

Commit

Permalink
refactor(renterd): remove contract sets
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfreska committed Nov 8, 2024
1 parent 8d952c6 commit bc754ff
Show file tree
Hide file tree
Showing 34 changed files with 57 additions and 871 deletions.
2 changes: 0 additions & 2 deletions apps/renterd-e2e/src/fixtures/configResetSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export const configResetAllSettings = step(
await fillTextInputByName(page, 'periodWeeks', '6')
await fillTextInputByName(page, 'renewWindowWeeks', '2')
await fillTextInputByName(page, 'amountHosts', '3')
await fillTextInputByName(page, 'autopilotContractSet', 'autopilot')
await setSwitchByLabel(page, 'prune', false)

// hosts
Expand All @@ -37,7 +36,6 @@ export const configResetAllSettings = step(
await fillTextInputByName(page, 'minProtocolVersion', '1.6.0')

// contracts
await fillTextInputByName(page, 'defaultContractSet', 'autopilot')
await setSwitchByLabel(page, 'uploadPackingEnabled', true)

// gouging
Expand Down
47 changes: 3 additions & 44 deletions apps/renterd/components/Config/ConfigActions.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,12 @@
import {
Text,
Button,
Switch,
ControlGroup,
Popover,
Label,
Paragraph,
} from '@siafoundation/design-system'
import { Reset16, Save16, Settings16 } from '@siafoundation/react-icons'
import { Text, Button, ControlGroup } from '@siafoundation/design-system'
import { Reset16, Save16 } from '@siafoundation/react-icons'
import { useConfig } from '../../contexts/config'
import { ConfigContextMenu } from './ConfigContextMenu'
import { ConfigViewDropdownMenu } from './ConfigViewDropdownMenu'
import { pluralize } from '@siafoundation/units'

export function ConfigActions() {
const {
onSubmit,
changeCount,
shouldSyncDefaultContractSet,
setShouldSyncDefaultContractSet,
revalidateAndResetForm,
form,
} = useConfig()
const { onSubmit, changeCount, revalidateAndResetForm, form } = useConfig()

return (
<div className="flex items-center gap-2">
Expand All @@ -48,32 +33,6 @@ export function ConfigActions() {
<Save16 />
Save changes
</Button>
<Popover
contentProps={{
align: 'end',
}}
trigger={
<Button variant="accent" icon="hover">
<Settings16 />
</Button>
}
>
<div className="px-1">
<Label>Options</Label>
<div>
<Switch
checked={shouldSyncDefaultContractSet}
onCheckedChange={(val) => setShouldSyncDefaultContractSet(val)}
>
sync default contract set
</Switch>
<Paragraph size="12">
Automatically update the default contract set to be the same as
the autopilot contract set when changes are saved.
</Paragraph>
</div>
</div>
</Popover>
</ControlGroup>
<ConfigContextMenu />
<ConfigViewDropdownMenu />
Expand Down
12 changes: 0 additions & 12 deletions apps/renterd/components/Config/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,6 @@ export function Config() {
form={form}
fields={fields}
/>
<ConfigurationPanelSetting
autoVisibility
form={form}
fields={fields}
name="autopilotContractSet"
/>
<ConfigurationPanelSetting
autoVisibility
form={form}
Expand Down Expand Up @@ -240,12 +234,6 @@ export function Config() {
fields={fields}
form={form}
/>
<ConfigurationPanel
title="Contracts"
category="contractset"
fields={fields}
form={form}
/>
<ConfigurationPanel
title="Uploads"
category="uploadpacking"
Expand Down
12 changes: 0 additions & 12 deletions apps/renterd/components/Contracts/ContractMetrics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export function ContractMetrics() {
selectedContract,
allContractsSpendingMetrics,
selectedContractSpendingMetrics,
contractSetCountMetrics,
graphMode,
setGraphMode,
} = useContracts()
Expand Down Expand Up @@ -66,17 +65,6 @@ export function ContractMetrics() {
emptyState={<StateNoData />}
/>
)}
{graphMode === 'count' && !selectedContract && (
<ChartXY
id="renterd/v0/contracts/graphs/count"
height="100%"
data={contractSetCountMetrics.data}
config={contractSetCountMetrics.config}
isLoading={contractSetCountMetrics.isLoading}
actionsLeft={tabsEl}
emptyState={<StateNoData />}
/>
)}
</div>
)
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { RenewCmdGroup } from './Renew'
import { Page } from '../../../../CmdRoot/types'
import { AddressCmdGroup } from './Address'
import { PublicKeyCmdGroup } from './PublicKey'
import { ContractSetCmdGroup } from './ContractSet'

type Props = {
currentPage: Page
Expand All @@ -16,7 +15,6 @@ export function ContractFilterCmdGroups({ currentPage, select }: Props) {
<>
<AddressCmdGroup currentPage={currentPage} select={select} />
<PublicKeyCmdGroup currentPage={currentPage} select={select} />
<ContractSetCmdGroup currentPage={currentPage} select={select} />
<ExpiryCmdGroup currentPage={currentPage} select={select} />
<FormationCmdGroup currentPage={currentPage} select={select} />
<RenewCmdGroup currentPage={currentPage} select={select} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { contractFilterRenewPage } from '../ContractFilterCmdGroups/Renew'
import { Page } from '../../../../CmdRoot/types'
import { AddressCmdNav } from '../ContractFilterCmdGroups/Address'
import { PublicKeyCmdNav } from '../ContractFilterCmdGroups/PublicKey'
import { ContractSetCmdNav } from '../ContractFilterCmdGroups/ContractSet'

export const commandPage = {
namespace: 'contracts',
Expand Down Expand Up @@ -39,12 +38,6 @@ export function ContractFilterNav({
commandPage={commandPage}
select={select}
/>
<ContractSetCmdNav
currentPage={currentPage}
parentPage={parentPage}
commandPage={commandPage}
select={select}
/>
<CommandItemNav
currentPage={currentPage}
parentPage={parentPage}
Expand Down
115 changes: 0 additions & 115 deletions apps/renterd/components/Contracts/ContractsFilterContractSetDialog.tsx

This file was deleted.

Loading

0 comments on commit bc754ff

Please sign in to comment.