Skip to content

Commit

Permalink
[Workspace] Refactor summary panel in workspace create page (opensear…
Browse files Browse the repository at this point in the history
…ch-project#8381) (opensearch-project#8388)

* Refactor summary panel in workspace create page



* Changeset file for PR opensearch-project#8381 created/updated

* add description



---------



(cherry picked from commit f9b8c8a)

Signed-off-by: yubonluo <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored and SuZhou-Joe committed Oct 3, 2024
1 parent 17f08f8 commit c904389
Show file tree
Hide file tree
Showing 15 changed files with 247 additions and 294 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/8381.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
refactor:
- [Workspace] Refactor summary panel in workspace create page. ([#8381](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8381))

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export enum RightSidebarScrollField {
Color = 'color',
UseCase = 'useCase',
DataSource = 'dataSource',
Member = 'member',
Collaborators = 'collaborators',
}

export const generateRightSidebarScrollProps = (key: RightSidebarScrollField) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { EuiSmallButton, EuiFlexGroup, EuiFlexItem, EuiSmallButtonEmpty } from '@elastic/eui';
import {
EuiSmallButton,
EuiFlexGroup,
EuiFlexItem,
EuiSmallButtonEmpty,
EuiHorizontalRule,
} from '@elastic/eui';
import { i18n } from '@osd/i18n';
import React, { useState, useCallback } from 'react';
import type { ApplicationStart } from 'opensearch-dashboards/public';
Expand Down Expand Up @@ -35,12 +41,15 @@ export const WorkspaceCreateActionPanel = ({

return (
<>
<EuiHorizontalRule margin="s" />
<EuiFlexGroup justifyContent="spaceBetween">
<EuiFlexItem grow={false}>
<EuiSmallButtonEmpty
data-test-subj="workspaceForm-bottomBar-cancelButton"
onClick={showCancelModal}
disabled={isSubmitting}
iconType="cross"
flush="left"
>
{i18n.translate('workspace.form.right.sidebar.buttons.cancelText', {
defaultMessage: 'Cancel',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ $workspaceCreateRightSideBarBottomOffset: 100px;
overflow: hidden;
display: flex;
flex-direction: column;
width: 280px;
width: 360px;

@include ouiBreakpoint("xs","s") {
position: static;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ import {
WorkspaceDescriptionField,
} from '../workspace_form';

import { WorkspaceCreateActionPanel } from './workspace_create_action_panel';
import { WorkspaceFaqPanel } from './workspace_faq_panel';
import { WorkspaceFormSummaryPanel } from './workspace_form_summary_panel';
import { generateRightSidebarScrollProps, RightSidebarScrollField } from './utils';

Expand Down Expand Up @@ -182,7 +180,7 @@ export const WorkspaceCreatorForm = (props: WorkspaceCreatorFormProps) => {
{permissionEnabled && (
<>
<EuiTitle
{...generateRightSidebarScrollProps(RightSidebarScrollField.Member)}
{...generateRightSidebarScrollProps(RightSidebarScrollField.Collaborators)}
size="s"
>
<h3>{usersAndPermissionsCreatePageTitle}</h3>
Expand All @@ -208,18 +206,10 @@ export const WorkspaceCreatorForm = (props: WorkspaceCreatorFormProps) => {
<EuiFlexItem grow={false}>
<div className="workspaceCreateRightSidebar">
<div className="workspaceCreateRightSideBarContentWrapper">
<WorkspaceFaqPanel />
<EuiSpacer size="m" />
<WorkspaceFormSummaryPanel
formData={formData}
availableUseCases={availableUseCases}
permissionEnabled={permissionEnabled}
/>
</div>
<EuiSpacer size="m" />
<div className="workspaceCreateRightSideBarActionsWrapper">
<WorkspaceCreateActionPanel
formData={formData}
formId={formId}
application={application}
isSubmitting={props.isSubmitting}
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit c904389

Please sign in to comment.