Skip to content
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

adds a collapsible "create new app" section #163

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 42 additions & 37 deletions src/containers/apps/Apps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,45 +74,50 @@ export default class Apps extends ApiComponent<

return (
<div className="slow-fadein-fast">
<div
style={{
display: 'flex',
flexDirection: 'column',
gap: 25,
padding: '0 20px',
margin: '0 auto 50px',
maxWidth: 1000,
}}
>
<Row justify="center">
<Col
xs={{
span: 24,
}}
lg={{
span: 13,
}}
>
<CreateNewApp
projects={apiData.projects}
onCreateNewAppClicked={(
appName: string,
projectId: string,
hasPersistency: boolean
) => {
self.onCreateNewAppClicked(
appName,
projectId,
hasPersistency
)
<details id="create-new-app">
<summary style={{ display: 'none' }}></summary>
<div
style={{
display: 'flex',
flexDirection: 'column',
gap: 25,
padding: '0 20px',
margin: '0 auto 50px',
maxWidth: 1000,
}}
>
<Row justify="center">
<Col
xs={{
span: 24,
}}
onOneClickAppClicked={() => {
self.props.history.push('/apps/oneclick')
lg={{
span: 13,
}}
/>
</Col>
</Row>
</div>
>
<CreateNewApp
projects={apiData.projects}
onCreateNewAppClicked={(
appName: string,
projectId: string,
hasPersistency: boolean
) => {
self.onCreateNewAppClicked(
appName,
projectId,
hasPersistency
)
}}
onOneClickAppClicked={() => {
self.props.history.push(
'/apps/oneclick'
)
}}
/>
</Col>
</Row>
</div>
</details>
{(apiData.apps.appDefinitions.length > 0 ||
apiData.projects.length > 0) && (
<div
Expand Down
21 changes: 20 additions & 1 deletion src/containers/apps/AppsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,26 @@ class AppsTable extends Component<
return (
<Card
extra={
<div>
<div
style={{
display: 'flex',
alignItems: 'center',
gap: '0.5em',
}}
>
<Button
onClick={() =>
document
.getElementById('create-new-app')
?.toggleAttribute('open')
}
type="primary"
>
Copy link
Collaborator

Choose a reason for hiding this comment

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

The button needs to hide when the create app panel is visible.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also create app panel needs to have a close button that result in this button being visible again.

{localize(
'create_new_app.button',
'Create New App'
)}
</Button>
{self.state.isBulkEditMode && (
<Tooltip
title={localize(
Expand Down
Loading