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

Update Splice main to version 0.3.6-snapshot.20250116.8048.0.vcd38ccef (automatic PR) #258

Merged
merged 1 commit into from
Jan 24, 2025
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
2 changes: 1 addition & 1 deletion .circleci/canton-scripts/check-sbt-output.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ read_sbt_output() {
}

filter_errors() {
grep -i -w -e error -e severe -e warn -e warning -e exception -e critical -e fatal || true
grep -i -e error -e severe -e warn -e warning -e exception -e critical -e fatal || true
}

# Read ignore patterns
Expand Down
43 changes: 18 additions & 25 deletions apps/sv/frontend/src/components/votes/VoteRequest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const CreateVoteRequest: React.FC = () => {
const [actionName, setActionName] = useState('SRARC_OffboardSv');
const [summary, setSummary] = useState<string>('');
const [url, setUrl] = useState<string>('');
const [expiration, setExpiration] = useState<Dayjs | null>(null);
const [expiration, setExpiration] = useState<Dayjs>(dayjs());
const [confirmDialogOpen, setConfirmDialogOpen] = useState(false);

// States related to constraints from vote requests
Expand All @@ -79,34 +79,28 @@ export const CreateVoteRequest: React.FC = () => {
const dsoInfosQuery = useDsoInfos();
const listVoteRequestsQuery = useListDsoRulesVoteRequests();

function getDefaultExpiration(): Dayjs {
switch (actionName) {
case 'CRARC_RemoveFutureAmuletConfigSchedule':
case 'CRARC_UpdateFutureAmuletConfigSchedule':
case 'CRARC_AddFutureAmuletConfigSchedule': {
return dayjs();
}
default: {
const microseconds =
parseInt(dsoInfosQuery.data?.dsoRules.payload.config.voteRequestTimeout.microseconds!) /
1000;
return dayjs().add(Math.floor(microseconds), 'milliseconds');
}
}
}
const expirationFromVoteRequestTimeout = dayjs().add(
Math.floor(
parseInt(dsoInfosQuery.data?.dsoRules.payload.config.voteRequestTimeout.microseconds!) / 1000
),
'milliseconds'
);

useEffect(() => {
setExpiration(getDefaultExpiration);
setExpiration(expirationFromVoteRequestTimeout);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [dsoInfosQuery.isSuccess]);
}, [dsoInfosQuery.isInitialLoading]);

useEffect(() => {
setExpiration(getDefaultExpiration);
const handleExpirationDateChange = (newDate: Dayjs | null) => {
setExpiration(newDate ?? dayjs());
};

const handleActionNameChange = (newActionName: string) => {
setMaxDateTimeIfAddFutureAmuletConfigSchedule(undefined);
setUrl('');
setSummary('');
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [actionName, setActionName]); // same than above
setActionName(newActionName);
};

const actionNameOptions = [
{ name: 'Offboard Member', value: 'SRARC_OffboardSv' },
Expand Down Expand Up @@ -223,7 +217,6 @@ export const CreateVoteRequest: React.FC = () => {
.then(() => setSummary(''))
.then(() => setActionName('SRARC_OffboardSv'))
.then(() => setAction(undefined))
.then(() => setExpiration(getDefaultExpiration))
.then(() => setMaxDateTimeIfAddFutureAmuletConfigSchedule(undefined))
.then(() => setAlertMessage({}));
}
Expand Down Expand Up @@ -267,7 +260,7 @@ export const CreateVoteRequest: React.FC = () => {
'data-testid': 'display-actions',
}}
value={actionName}
onChange={e => setActionName(e.target.value)}
onChange={e => handleActionNameChange(e.target.value)}
>
{actionNameOptions.map((actionName, index) => (
<option key={'action-option-' + index} value={actionName.value}>
Expand All @@ -289,7 +282,7 @@ export const CreateVoteRequest: React.FC = () => {
minDateTime={dayjs()}
maxDateTime={maxDateTimeIfAddFutureAmuletConfigSchedule}
readOnly={false}
onChange={(newValue: Dayjs | null) => setExpiration(newValue)}
onChange={d => handleExpirationDateChange(d)}
slotProps={{
textField: {
id: 'datetime-picker-vote-request-expiration',
Expand Down
3 changes: 3 additions & 0 deletions project/ignore-patterns/sbt-output.ignore.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,8 @@ You are using an unreleased and unstable version of damml3. This will break with

# output by the compose validator in DockerComposeFullNetworkFrontendIntegrationTest
curl.*The requested URL returned error
WARNING: Failed to fetch secret, retrying in 10 seconds

.*Condition \[isDefined\("LOG_LAST_ERRORS"\)\] evaluated.*

# Make sure to have a trailing newline