-
Notifications
You must be signed in to change notification settings - Fork 9
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
Refactor: Updated location of components. #26
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
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 was deleted.
Oops, something went wrong.
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,7 @@ | ||
.api-card-view-card-body { | ||
font-size: var(--pf-global--FontSize--sm); | ||
} | ||
|
||
.api-card-view-card-header { | ||
font-weight: var(--pf-global--FontWeight--normal) !important; | ||
} |
16 changes: 8 additions & 8 deletions
16
packages/studio/src/app/appCard.tsx → ...rc/app/components/api/apiCard/apiCard.tsx
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './apiCard'; | ||
export * from './apiCardView'; |
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
3 changes: 3 additions & 0 deletions
3
packages/studio/src/app/components/api/apiDataList/apiDataListItem.css
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,3 @@ | ||
.api-data-list-cell.pf-m-icon > img { | ||
max-width: unset; | ||
} |
50 changes: 50 additions & 0 deletions
50
packages/studio/src/app/components/api/apiDataList/apiDataListItem.tsx
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,50 @@ | ||
import React, { useEffect, useContext } from 'react'; | ||
import { Button, DataListItem, DataListItemCells, DataListItemRow, DataListCell, DataListCheck, DataListAction } from '@patternfly/react-core'; | ||
import {ApiTag} from '../apiTag'; | ||
import {ApiDropdownKebab} from '../apiDropDownKebab'; | ||
import ApicurioIcon from '../../../assets/apicurio-icon.png'; | ||
import './apiDataListItem.css'; | ||
import { useStoreContext } from '../../../../context/reducers'; | ||
|
||
export const ApiDataListItem: React.FunctionComponent<any> = () => { | ||
const { apiData } = useStoreContext(); | ||
|
||
return ( | ||
<React.Fragment> | ||
{apiData.map(apis => | ||
<DataListItem id={apis.id} key={apis.id} aria-labelledby={`data-list-item-${apis.id}`}> | ||
<DataListItemRow> | ||
<DataListCheck checked={false} aria-labelledby={`data-list-item-${apis.id}`} name={`data-list-item-check-${apis.id}`}/> | ||
<DataListItemCells | ||
dataListCells={[ | ||
<DataListCell isIcon={true} className="api-data-list-cell" key={`primary content ${apis.id}`}> | ||
<img src={ApicurioIcon}/> | ||
</DataListCell>, | ||
<DataListCell key={`secondary content ${apis.id}`}> | ||
<div className="app-api-title"> | ||
{apis.name} | ||
</div> | ||
<div className="app-api-description"> | ||
{apis.description} | ||
</div> | ||
<div className="app-api-tag-group"> | ||
{apis.tags.map((tag, index) => | ||
<ApiTag key={index} text={tag}/> | ||
)} | ||
</div> | ||
</DataListCell> | ||
]} | ||
/> | ||
<DataListAction aria-labelledby={`data-list-item-${apis.id}`} id={`data-list-item-${apis.id}`} aria-label="Actions"> | ||
<Button variant="link">View Details</Button> | ||
<Button variant="secondary">Edit API</Button> | ||
<ApiDropdownKebab/> | ||
</DataListAction> | ||
</DataListItemRow> | ||
</DataListItem> | ||
)} | ||
</React.Fragment> | ||
) | ||
}; | ||
|
||
export default ApiDataListItem; |
Empty file.
11 changes: 11 additions & 0 deletions
11
packages/studio/src/app/components/api/apiDrawer/apiDrawer.css
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,11 @@ | ||
.api-drawer-content { | ||
padding: var(--pf-global--spacer--lg); /* remove this when new drawer styles in pf are added */ | ||
} | ||
|
||
.api-drawer-panel-content { | ||
padding: 0 !important; | ||
} | ||
|
||
.ap--drawer-panel-body .pf-c-drawer__panel-body { | ||
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. incorrect spelling this is why the padding is there |
||
padding: 0; | ||
} |
56 changes: 28 additions & 28 deletions
56
packages/studio/src/app/appDrawer.tsx → ...pp/components/api/apiDrawer/apiDrawer.tsx
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 |
---|---|---|
@@ -1,66 +1,66 @@ | ||
import React from 'react'; | ||
import { Drawer, DrawerPanelContent, DrawerContent } from '@patternfly/react-core/dist/esm/experimental'; | ||
import AppDataList from './appDataList'; | ||
import {AppCardView} from './appCardView'; | ||
import AppDrawerPanelContent from './appDrawerPanelContent'; | ||
import './app.css'; | ||
import AppDataList from '../apiDataList/apiDataList'; | ||
import {ApiCardView} from '../..'; | ||
import ApiDrawerPanelContent from './apiDrawerPanelContent'; | ||
import './apiDrawer.css'; | ||
|
||
interface AppDrawerProps { | ||
export interface ApiDrawerProps { | ||
dashboardView: string | ||
} | ||
|
||
interface AppDrawerState { | ||
interface ApiDrawerState { | ||
readonly currentApiId: string, | ||
readonly isExpanded: boolean, | ||
} | ||
|
||
class AppDrawer extends React.Component<AppDrawerProps, AppDrawerState> { | ||
constructor(props: AppDrawerProps) { | ||
export class ApiDrawer extends React.Component<ApiDrawerProps, ApiDrawerState> { | ||
constructor(props: ApiDrawerProps) { | ||
super(props); | ||
this.state = { | ||
currentApiId: "", | ||
isExpanded: false | ||
}; | ||
} | ||
|
||
private openDrawer = () => { | ||
const isExpanded = !this.state.isExpanded; | ||
this.setState({ | ||
isExpanded | ||
}); | ||
}; | ||
|
||
private findKey = (id: string) => { | ||
const keyListItem = id; | ||
this.setState({ | ||
currentApiId: keyListItem | ||
}) | ||
} | ||
|
||
render() { | ||
render() { | ||
const { isExpanded, currentApiId } = this.state; | ||
|
||
return ( | ||
<React.Fragment> | ||
<Drawer isExpanded={isExpanded} isInline> | ||
<DrawerContent> | ||
<div className="app-drawer-content"> | ||
<div className="api-drawer-content"> | ||
{ | ||
this.props.dashboardView === 'list' ? ( | ||
<AppDataList keyListItem={this.findKey} selectItem={this.openDrawer} viewDetails={this.openDrawer}/> | ||
) : ( | ||
<AppCardView/> | ||
<ApiCardView/> | ||
) | ||
} | ||
</div> | ||
</DrawerContent> | ||
<DrawerPanelContent className="app-drawer-panel-body"> | ||
<AppDrawerPanelContent currentApiId={currentApiId}/> | ||
<DrawerPanelContent className="api-drawer-panel-body"> | ||
<ApiDrawerPanelContent currentApiId={currentApiId}/> | ||
</DrawerPanelContent> | ||
</Drawer> | ||
</React.Fragment> | ||
); | ||
} | ||
|
||
private openDrawer = () => { | ||
const isExpanded = !this.state.isExpanded; | ||
this.setState({ | ||
isExpanded | ||
}); | ||
}; | ||
|
||
private findKey = (id: string) => { | ||
const keyListItem = id; | ||
this.setState({ | ||
currentApiId: keyListItem | ||
}) | ||
} | ||
} | ||
|
||
export default AppDrawer; | ||
export default ApiDrawer; |
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.
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.
OK so I couldn't figure out why this was added.
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.
lol I love the image. It was originally added because I was working on a fix for for rebuilding the model and services and thought about using nodemon. I'll remove it lol.