-
Notifications
You must be signed in to change notification settings - Fork 29
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
Render operations by type, improve render blocks #1096
Conversation
<div className="Operations__pair" data-testid="OperationKeyVal"> | ||
<div> | ||
{operationKey} | ||
{operationKey ? ":" : null} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this always be true? Or is operationKey
optional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I'm not sure why that check exists, maybe it used to be optional? It's not now so I removed it in 8ee4bf0
/> | ||
); | ||
} | ||
if ("sha256Hash" in signer) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: space above this if
statement. The other ones have it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/> | ||
); | ||
} | ||
if ("sha256Hash" in signer) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nite: same as above about the space. 👮♀️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -78,6 +78,7 @@ export const SignTransaction = () => { | |||
isHttpsDomain, | |||
flaggedKeys, | |||
} = tx; | |||
console.log(Trans, isHttpsDomain); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this console.log
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh nope, forgotten debug and removed in https://stellarfoundation.slack.com/archives/C06GA82KU2H/p1707081896826859?thread_ts=1706810112.655399&cid=C06GA82KU2H
// if (!isHttpsDomain && !isExperimentalModeEnabled) { | ||
// return ( | ||
// <WarningMessage | ||
// handleCloseClick={() => window.close()} | ||
// isActive | ||
// variant={WarningMessageVariant.warning} | ||
// header={t("WEBSITE CONNECTION IS NOT SECURE")} | ||
// > | ||
// <p> | ||
// <Trans domain={domain}> | ||
// The website <strong>{{ domain }}</strong> does not use an SSL | ||
// certificate. For additional safety Freighter only works with | ||
// websites that provide an SSL certificate. | ||
// </Trans> | ||
// </p> | ||
// </WarningMessage> | ||
// ); | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we remove this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoops! This was commented out to test an API path locally, commented back in https://stellarfoundation.slack.com/archives/C06GA82KU2H/p1707081896826859?thread_ts=1706810112.655399&cid=C06GA82KU2H
…emoves uneeded key check in KeyValueList
* Render operations by type, improve render blocks (#1096) * renders operation by op type * adds key val renderer for signer by type * adds key val renderer for line by type * adds key val renderer for claimants, signer options * uses DestinationWarning for any destination accounts * adds invokeHostFn renderer and supporting helper components * adds remaining key val renderers by type * Added translations * tweaks to invoke host fn preview, optionally show source * Added translations * fixes typos in added op types * fixes revoke sponsorship cases for missing op type in enum * adds comment for stellar-base type issue * reverts commented out warning for dev testing, fixes formatting and removes uneeded key check in KeyValueList * Constrain token payment (#1095) * adds token simulation redux state * moves token simualtion action into redux slice, adds send settings simulation rejection error * reorganize imports in SettingsFail * Feature/improve sign preview (#1100) * adds warning for token transfers in auth, adds better invocation rendering * Added translations * adds transfer index to title, adds token details per transfer * adds error modal in sign auth entry for bad entry format * tweaks settings fail error message alignment, updates comment in history item
Motivation:
Previously we displayed operations by digging into their private fields and conditionally rendering all fields that could be on any op type. This caused us to drop the operation type and made it difficult to know how any 1 operation would be rendered. It also made it more difficult to get into the auth tree and sub-invocations.
Changes:
Splits rendering by operation type.
Extracts all KeyVals into a new file, adds new KeyVals for missing types.
Adds missing fields, and fixes rendering bugs for a few types.