generated from openmcp-project/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Feature/display resource yaml #81
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
Changes from 53 commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
ff122a3
yaml
lucasgoral a8469a2
initialize
lucasgoral 7c5dc82
improvements
lucasgoral 57632d2
npm
lucasgoral f552855
fixes
lucasgoral d63dd7a
fixes
lucasgoral 99ddbdb
refactor
lucasgoral 6890ece
Merge branch 'main' into feature/display-resource-yaml
lucasgoral 7221234
Update package-lock.json
lucasgoral f4226e2
Update tsconfig.json
lucasgoral d069cc5
graphql
lucasgoral 5a67fb4
Update YamlViewer.tsx
lucasgoral 49c9ce1
refactor
lucasgoral 794967d
refactor
lucasgoral 9e58f60
refactor
lucasgoral 567154c
Update ControlPlaneListWorkspaceGridTile.tsx
lucasgoral 60d9100
Update ConnectButton.tsx
lucasgoral bf417c3
fixes
lucasgoral a90d9f1
Merge branch 'main' into feature/display-resource-yaml
lucasgoral 4d832ce
Update package-lock.json
lucasgoral 06dbcae
Update ControlPlaneView.tsx
lucasgoral 41354fe
fixes
lucasgoral d3ae2ef
fixes
lucasgoral f4ff4f0
fixes
lucasgoral 092b17f
refactor
lucasgoral 0316081
fixes
lucasgoral 775cb8f
fixes
lucasgoral e598273
fixes
lucasgoral 4a1601b
fixes
lucasgoral c7ab2d3
fixes
lucasgoral cdea1f6
remove aliases
lucasgoral 1ed594b
refactor
lucasgoral ed120af
removed card prototype
lucasgoral 0f5b052
fixes
lucasgoral 2a142ed
fixes
lucasgoral dea32ec
fixes
lucasgoral c9f5416
Update vite.config.ts
lucasgoral 75b845d
fixes
lucasgoral 54174b2
revert
lucasgoral a07b296
Merge branch 'main' into feature/display-resource-yaml
lucasgoral 3571ba4
Update package-lock.json
lucasgoral 190a4b0
Update package-lock.json
lucasgoral 4161df2
Update ProjectsList.tsx
lucasgoral aa13880
Update ProjectsList.tsx
lucasgoral 096c5f4
refactor
lucasgoral 18d3f63
fix
lucasgoral 2bafa7a
Update YamlViewer.tsx
lucasgoral c2df896
Merge branch 'main' into feature/display-resource-yaml
lucasgoral 046afb0
Update package-lock.json
lucasgoral 428e14f
refactor
lucasgoral 88c9baa
Update YamlViewer.tsx
lucasgoral b2da1b2
Merge branch 'main' into feature/display-resource-yaml
lucasgoral c37f57a
Update package-lock.json
lucasgoral 77c089f
Update ProjectsList.tsx
lucasgoral File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -0,0 +1,33 @@ | ||||
import { YamlViewButtonProps } from './YamlViewButton.tsx'; | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unused import
Suggested change
|
||||
import { FC } from 'react'; | ||||
|
||||
import { stringify } from 'yaml'; | ||||
|
||||
import { useTranslation } from 'react-i18next'; | ||||
import { ResourceObject } from '../../lib/api/types/crate/resourceObject.ts'; | ||||
import Loading from '../Shared/Loading.tsx'; | ||||
import IllustratedError from '../Shared/IllustratedError.tsx'; | ||||
import YamlViewer from './YamlViewer.tsx'; | ||||
import useResource from '../../lib/api/useApiResource'; | ||||
|
||||
export const YamlLoader: FC<YamlViewButtonProps> = ({ | ||||
workspaceName, | ||||
resourceType, | ||||
resourceName, | ||||
}) => { | ||||
const { isLoading, data, error } = useResource( | ||||
ResourceObject(workspaceName ?? '', resourceType, resourceName), | ||||
); | ||||
lucasgoral marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
const { t } = useTranslation(); | ||||
if (isLoading) return <Loading />; | ||||
if (error) { | ||||
return <IllustratedError error={t('common.cannotLoadData')} />; | ||||
} | ||||
|
||||
return ( | ||||
<YamlViewer | ||||
yamlString={stringify(data)} | ||||
filename={`${workspaceName ? `${workspaceName}_` : ''}${resourceType}_${resourceName}`} | ||||
/> | ||||
); | ||||
}; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.