-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add ensa version sap system details #1559
Merged
Merged
Changes from all commits
Commits
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
This file contains 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
51 changes: 51 additions & 0 deletions
51
assets/js/components/DatabaseDetails/DatabaseDetails.stories.jsx
This file contains 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,51 @@ | ||
import React from 'react'; | ||
import { MemoryRouter } from 'react-router-dom'; | ||
|
||
import { | ||
clusterFactory, | ||
databaseInstanceFactory, | ||
databaseFactory, | ||
hostFactory, | ||
} from '@lib/test-utils/factories'; | ||
import { DATABASE_TYPE } from '@lib/model'; | ||
import { keysToCamel } from '@lib/serialization'; | ||
|
||
import { GenericSystemDetails } from '@components/SapSystemDetails'; | ||
|
||
const system = { | ||
...keysToCamel( | ||
databaseFactory.build({ instances: databaseInstanceFactory.buildList(2) }) | ||
), | ||
hosts: hostFactory.buildList(2, { cluster: clusterFactory.build() }), | ||
}; | ||
|
||
function ContainerWrapper({ children }) { | ||
return ( | ||
<div className="max-w-7xl mx-auto px-4 sm:px-6 md:px-8">{children}</div> | ||
); | ||
} | ||
|
||
export default { | ||
title: 'DatabaseDetails', | ||
components: GenericSystemDetails, | ||
decorators: [ | ||
(Story) => ( | ||
<MemoryRouter> | ||
<Story /> | ||
</MemoryRouter> | ||
), | ||
], | ||
render: (args) => ( | ||
<ContainerWrapper> | ||
<GenericSystemDetails {...args} /> | ||
</ContainerWrapper> | ||
), | ||
}; | ||
|
||
export const Database = { | ||
args: { | ||
title: 'Database Details', | ||
type: DATABASE_TYPE, | ||
system, | ||
}, | ||
}; |
This file contains 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 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
53 changes: 53 additions & 0 deletions
53
assets/js/components/SapSystemDetails/SapSystemDetails.stories.jsx
This file contains 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,53 @@ | ||
import React from 'react'; | ||
import { MemoryRouter } from 'react-router-dom'; | ||
|
||
import { | ||
clusterFactory, | ||
hostFactory, | ||
sapSystemApplicationInstanceFactory, | ||
sapSystemFactory, | ||
} from '@lib/test-utils/factories'; | ||
import { APPLICATION_TYPE } from '@lib/model'; | ||
import { keysToCamel } from '@lib/serialization'; | ||
|
||
import { GenericSystemDetails } from './GenericSystemDetails'; | ||
|
||
const system = { | ||
...keysToCamel( | ||
sapSystemFactory.build({ | ||
instances: sapSystemApplicationInstanceFactory.buildList(2), | ||
}) | ||
), | ||
hosts: hostFactory.buildList(2, { cluster: clusterFactory.build() }), | ||
}; | ||
|
||
function ContainerWrapper({ children }) { | ||
return ( | ||
<div className="max-w-7xl mx-auto px-4 sm:px-6 md:px-8">{children}</div> | ||
); | ||
} | ||
|
||
export default { | ||
title: 'SapSystemDetails', | ||
components: GenericSystemDetails, | ||
decorators: [ | ||
(Story) => ( | ||
<MemoryRouter> | ||
<Story /> | ||
</MemoryRouter> | ||
), | ||
], | ||
render: (args) => ( | ||
<ContainerWrapper> | ||
<GenericSystemDetails {...args} /> | ||
</ContainerWrapper> | ||
), | ||
}; | ||
|
||
export const SapSystem = { | ||
args: { | ||
title: 'SAP System Details', | ||
type: APPLICATION_TYPE, | ||
system, | ||
}, | ||
}; |
This file contains 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 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 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
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.
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'm not sure if the place for this function is the best one.
Suggestions?
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.
You can both leave it here or have a dedicated file, if we maybe get to have more and more render functions we can have something like
renderers.js
or something like that. For now I think we can leave itThere 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 you happen to find another file name that isn't
utils
feels free)