-
Notifications
You must be signed in to change notification settings - Fork 372
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
feat: display 6 actions as contentless node #2108
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
022d0fe
display 6 types as contentless node
yeze322 000dff1
fix ut
yeze322 e6c0da6
header color to darker gray
yeze322 bb5deaf
fix UT
yeze322 4793338
Merge branch 'master' into visual/thin-action
yeze322 2797e7b
put copyright ahead
yeze322 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
5 changes: 4 additions & 1 deletion
5
Composer/packages/extensions/visual-designer/src/constants/ElementSizes.ts
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
79 changes: 79 additions & 0 deletions
79
Composer/packages/extensions/visual-designer/src/widgets/ActionHeader.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,79 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
/** @jsx jsx */ | ||
import { jsx, css } from '@emotion/core'; | ||
import { generateSDKTitle } from '@bfc/shared'; | ||
|
||
import { WidgetComponent, WidgetContainerProps } from '../schema/uischema.types'; | ||
import { StandardNodeWidth, HeaderHeight } from '../constants/ElementSizes'; | ||
import { ObiColors } from '../constants/ElementColors'; | ||
import { NodeMenu } from '../components/menus/NodeMenu'; | ||
|
||
export interface ActionHeaderProps extends WidgetContainerProps { | ||
title: string; | ||
disableSDKTitle?: boolean; | ||
menu?: JSX.Element | 'none'; | ||
colors: { | ||
theme: string; | ||
icon: string; | ||
}; | ||
} | ||
|
||
const DefaultColors = { | ||
theme: ObiColors.AzureGray3, | ||
icon: ObiColors.AzureGray2, | ||
}; | ||
|
||
const container = css` | ||
cursor: pointer; | ||
font-family: Segoe UI; | ||
font-size: 12px; | ||
line-height: 14px; | ||
color: black; | ||
`; | ||
|
||
const header = css` | ||
font-size: 12px; | ||
font-family: Segoe UI; | ||
line-height: 14px; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
whitespace: pre; | ||
`; | ||
|
||
export const ActionHeader: WidgetComponent<ActionHeaderProps> = ({ | ||
id, | ||
data, | ||
onEvent, | ||
title, | ||
disableSDKTitle, | ||
menu, | ||
colors = DefaultColors, | ||
}) => { | ||
const headerContent = disableSDKTitle ? title : generateSDKTitle(data, title); | ||
|
||
return ( | ||
<div | ||
css={css` | ||
${container}; | ||
width: ${StandardNodeWidth}px; | ||
height: ${HeaderHeight}px; | ||
background-color: ${colors.theme}; | ||
`} | ||
> | ||
<div | ||
css={css` | ||
${header}; | ||
width: calc(100% - 40px); | ||
padding: 4px 8px; | ||
`} | ||
> | ||
{headerContent} | ||
</div> | ||
<div css={{ position: 'absolute', top: 4, right: 0 }}> | ||
{menu === 'none' ? null : menu || <NodeMenu id={id} onEvent={onEvent} />} | ||
</div> | ||
</div> | ||
); | ||
}; |
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.
Is it possible to use the colors from the
@ui-fabric/fluent-theme
package?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.
@a-b-r-o-w-n Yes! I would like to do that. We need designer's help on mapping those colors to our theme, do we need an issue to track this?