Skip to content

Port components to ts 5 #2724

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

Merged
merged 9 commits into from
May 28, 2025
Merged

Port components to ts 5 #2724

merged 9 commits into from
May 28, 2025

Conversation

RoyEJohnson
Copy link
Contributor

@RoyEJohnson RoyEJohnson commented Apr 10, 2025

CORE-870
This is based on #2723 which should be merged before reviewing this.

@RoyEJohnson RoyEJohnson force-pushed the port-components-to-ts-5 branch from 6459baf to f9bb84d Compare April 10, 2025 15:32
@@ -220,7 +220,6 @@ function ShareButtons() {
message={encodeURIComponent(
'Check out this OpenStax blog article!'
)}
minimal={true}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The share component is only being used in in this place, which used the minimal option, so I made it not an option.

justify-content: center;
margin: 1rem 0;

&:not(.minimal) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The minimal option is the only way it was being called, so I got rid of the non-minimal configuration

@@ -19,37 +24,39 @@ function RenderItem({item, current, onMouseEnter, onClick}) {
onMouseEnter={onMouseEnter}
onClick={onClick}
>
{item.label || item.text}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Everything that uses it now has label, not text.

@RoyEJohnson RoyEJohnson force-pushed the port-components-to-ts-5 branch 5 times, most recently from f1ec16a to 7460bbe Compare April 10, 2025 16:35
const [listening, setListening] = React.useState(false);
const {webtocaseUrl, debug, oid} = useSalesforceContext();
Copy link
Contributor Author

@RoyEJohnson RoyEJohnson Apr 10, 2025

Choose a reason for hiding this comment

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

Nothing uses webtocaseUrl anymore (postTo is always supplied)

@@ -1,35 +1,21 @@
import React from 'react';
import useSalesforceContext from '~/contexts/salesforce';

export function HiddenFields({leadSource}) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nothing uses HiddenFields anymore

@@ -0,0 +1,21 @@
import React from 'react';
Copy link
Contributor Author

@RoyEJohnson RoyEJohnson Apr 10, 2025

Choose a reason for hiding this comment

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

This was moved from being its own component to being part of body-units, since nothing else used it. Also simplified it a bit, since there was an image feature that wasn't being used, and with that gone, the quote-bucket wrapper wasn't needed.

@@ -1,17 +1,12 @@
import React from 'react';
import './progress-ring.scss';

function Circle({basicProps, className, strokeDashoffset=0}) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wasn't abstracting anything! It was a useless layer of component.

return activeButton.textContent;
}

describe('paginator', () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Didn't have a describe wrapper on it before, so it updates all the lines. Only had one test before; now two, so not a big file anyway.

@RoyEJohnson RoyEJohnson force-pushed the port-components-to-ts-5 branch from 7460bbe to a72dc4c Compare May 1, 2025 22:15
@RoyEJohnson RoyEJohnson force-pushed the port-components-to-ts-5 branch 3 times, most recently from 2097359 to b509866 Compare May 15, 2025 19:55
@RoyEJohnson RoyEJohnson requested a review from jivey May 15, 2025 19:58
Copy link
Member

@jivey jivey left a comment

Choose a reason for hiding this comment

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

Seems good just some small questions

@@ -73,16 +73,13 @@ function GatedContentBody({
function SubjectSelector() {
const {subjectSnippet: data} = useBlogContext();
const options = React.useMemo(
() =>
camelCaseKeys(
Copy link
Member

Choose a reason for hiding this comment

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

Is this transformation happening somewhere else now?

Copy link
Contributor Author

@RoyEJohnson RoyEJohnson May 23, 2025

Choose a reason for hiding this comment

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

I realized that camelCaseKeys has no effect, since the keys are all known here (label and value). The value for name is a string, not an object, so there's no recursive structure.

js.src = '//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.8';
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
/* eslint-enable */
Copy link
Member

Choose a reason for hiding this comment

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

I don't see this being used in the PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's imported by the "share" component.

@RoyEJohnson RoyEJohnson requested a review from jivey May 23, 2025 20:49
@RoyEJohnson RoyEJohnson force-pushed the port-components-to-ts-5 branch from b509866 to 77d566c Compare May 28, 2025 17:25
@RoyEJohnson RoyEJohnson merged commit ef76bf2 into main May 28, 2025
1 check passed
@RoyEJohnson RoyEJohnson deleted the port-components-to-ts-5 branch May 28, 2025 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants