-
-
Notifications
You must be signed in to change notification settings - Fork 197
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 sdk to v2 #3207
Update sdk to v2 #3207
Conversation
🦋 Changeset detectedLatest commit: 9a748e3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
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.
ESLint found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
packages/tokens-studio-for-figma/src/app/components/StorageItemForm/TokensStudioForm.tsx
Fixed
Show fixed
Hide fixed
packages/tokens-studio-for-figma/src/app/components/StorageItemForm/TokensStudioForm.tsx
Fixed
Show fixed
Hide fixed
packages/tokens-studio-for-figma/src/app/components/StorageItemForm/TokensStudioForm.tsx
Fixed
Show fixed
Hide fixed
packages/tokens-studio-for-figma/src/app/components/modals/DuplicateTokenGroupModal.test.tsx
Fixed
Show fixed
Hide fixed
packages/tokens-studio-for-figma/src/app/components/modals/RenameTokenGroupModal.test.tsx
Fixed
Show fixed
Hide fixed
successCallback?.(); | ||
} catch (e) { | ||
Sentry.captureException(e); | ||
console.error('Error updating token set order in Tokens Studio', e); |
Check warning
Code scanning / ESLint
disallow the use of `console`
successCallback?.(); | ||
} catch (e) { | ||
Sentry.captureException(e); | ||
console.error('Error creating theme group in Tokens Studio', e); |
Check warning
Code scanning / ESLint
disallow the use of `console`
successCallback?.(); | ||
} catch (e) { | ||
Sentry.captureException(e); | ||
console.error('Error updating theme group in Tokens Studio', e); |
Check warning
Code scanning / ESLint
disallow the use of `console`
successCallback?.(); | ||
} catch (e) { | ||
Sentry.captureException(e); | ||
console.error('Error deleting theme group in Tokens Studio', e); |
Check warning
Code scanning / ESLint
disallow the use of `console`
packages/tokens-studio-for-figma/src/app/components/StorageItemForm/TokensStudioForm.tsx
Fixed
Show fixed
Hide fixed
packages/tokens-studio-for-figma/src/app/components/StorageItemForm/TokensStudioForm.tsx
Fixed
Show fixed
Hide fixed
Commit SHA:8e3bc5ae9affbddb72787a2846501cfe2d5072c9 Test coverage results 🧪
|
Commit SHA:8e3bc5ae9affbddb72787a2846501cfe2d5072c9 |
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.
It'd have been easier if formatting changes were not part of that PR. Also, it had gotten super big, it might have made sense to break it down in smaller PRs.
const fetchOrgData = React.useCallback(async () => { | ||
try { | ||
const client = create({ | ||
host: process.env.API_HOST || 'localhost:4200', |
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.
Is this the Studio API? Lets change the name of the env variable then to Studio
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.
changed
setOrgData(result.data.organizations.data as Organization[]); | ||
} | ||
} catch (error) { | ||
setFetchOrgsError('Error fetching organization data. Please check your PAT.'); |
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.
Lets write the full name not PAT
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.
sure
@@ -7,7 +7,7 @@ export function renameVariableNamesToThemes(state: TokenState, tokensToRename: T | |||
return acc; | |||
}, {}); | |||
const newThemes = state.themes.map((theme) => { | |||
const updatedTokens = theme.$figmaVariableReferences; | |||
const updatedTokens = { ...theme.$figmaVariableReferences }; |
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.
Why are we doing it that way?
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.
reverted this change as it was causing issues with tests.
|
||
expect(updatedTokens).toEqual(expectedTokens); | ||
expect(newTokens).toEqual(expectedTokens); |
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.
Is this on purpose?
|
||
expect(updatedTokens).toEqual(expectedTokens); | ||
expect(newTokens).toEqual(expectedTokens); |
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.
Is this on purpose? We used to check for updated tokens now were doing new tokens?
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.
just renamed it, but reverted back. updatedTokens is better.
acc.splice(parentIndex + childrenLength + 1, 0, { | ||
isLeaf: true, | ||
value: curr, | ||
key: curr.id, | ||
key: curr.name, |
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.
Is this a fn just used by Studio?
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.
it's used by the manage themes modal
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.
i think same as before, name is not unique
|
||
export function getOverallConfig(themes: ThemeObject[], selectedThemes: string[]) { | ||
return selectedThemes.reduce((acc, themeId) => { | ||
const currentTheme = themes.find((theme) => theme.id === themeId); | ||
const currentTheme = themes.find((theme) => theme.name === themeId); |
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.
Why are we switching from id to name?
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.
this was done before we moved everything to postgres . The idea was that gitea would be name based. Most of the studio stuff is the same. everything is based on name, except project and org.
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.
@roppazvan i think we cannot compare name.. there could be multiple themes with the same name (under different groups), lets keep to id
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.
approving code-side, @rbosker @keeganedwin can you do functional testing?
|
Why does this PR exist?
This updates the studio sync provider to use the latest SDK version.
What does this pull request do?
Testing this change
Run graphql locally. Add the local endpoint in the plugin env variables.
Additional Notes (if any)