-
Notifications
You must be signed in to change notification settings - Fork 434
Docked composer #3062
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
Docked composer #3062
Conversation
Thanks for opening this pull request! 💯 This is a community-driven project, and we can't do it without your participation. Please check out our contributing guidelines and review the Contributor Checklist if you haven't already, to make sure everything is squared away. CircleCI will take about 10 minutes to run through the same items that are on the Contributor checklist with a pass/fail check below. Please fix any issues that cause CircleCI to fail or ask for clarification--we try, but sometimes the errors can be unclear. |
components/docked-composer/index.jsx
Outdated
<div className="slds-col_bump-left slds-shrink-none"> | ||
<Button | ||
id={`${this.getId()}-minimize-button`} | ||
title="Minimize" |
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.
should we localize titles?
components/docked-composer/index.jsx
Outdated
* Text to display in the header. | ||
* _Tested with snapshot testing._ | ||
*/ | ||
header: PropTypes.string, |
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.
should we allow user to add a node for header too? so they can change icon etc
import Button from '../button'; | ||
|
||
const propTypes = { | ||
/** |
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.
we can also add a css class prop to allow overriding css
static displayName = 'DockedComposerExample'; | ||
|
||
state = { | ||
isOpen: true, |
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.
This naming convention is a bit confusing, do you think isExpanded
and isOpen
would be a bit less ambiguous?
…poser state, add class name parameter, add assitive text parameters, add story for minimized state
b970427
import { mount } from 'enzyme'; | ||
import IconSettings from '../../icon-settings'; | ||
|
||
// Import your internal dependencies (for example): |
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.
These comments seem like they can be removed
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.
First, this is a great pull request! I did not pull this down to manually test it, but did left a few minor request and referenced the overview doc. Thank you for this great contribution!
}} | ||
id="docked-composer" | ||
events={{ | ||
onMinimize: this.handleMinimize, |
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 haven't dove deep into this yet, but these look like on request pre-state change actions.
https://github.com/salesforce/design-system-react/blob/master/docs/codebase-overview.md#prefix-onrequestaction-to-pre-state-change-callbacks-functions
components/docked-composer/index.jsx
Outdated
<section | ||
className={`slds-docked-composer slds-grid slds-grid_vertical ${sectionClassName}`} | ||
role="dialog" | ||
aria-labelledby="dialog-heading-id-1" |
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.
All ids should be prefixed by an id or a random id if not set by the use. You are doing this in other locations: this.generatedId
components/docked-composer/index.jsx
Outdated
{this.props.isOpen ? ( | ||
<Button | ||
id={`${this.getId()}-minimize-button`} | ||
title={this.props.assistiveText?.minimizeButton || 'Minimize'} |
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 think was would be typically done by a default props object, so no one has to search render functions for text literals.
components/docked-composer/index.jsx
Outdated
title={this.props.assistiveText?.minimizeButton || 'Minimize'} | ||
assistiveText={{ | ||
icon: | ||
this.props.assistiveText?.minimizeButton || 'Minimize', |
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.
Same here.
components/docked-composer/index.jsx
Outdated
) : ( | ||
<Button | ||
id={`${this.getId()}-expand-button`} | ||
title={this.props.assistiveText?.expandButton || 'Expand'} |
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.
Same.
components/docked-composer/index.jsx
Outdated
id={`${this.getId()}-expand-button`} | ||
title={this.props.assistiveText?.expandButton || 'Expand'} | ||
assistiveText={{ | ||
icon: this.props.assistiveText?.expandButton || 'Expand', |
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.
Same.
…enerated id for all components, use default props
50d90fe
@alexzherdev Merge when you ready to. |
Not super important for this simple component, but I wonder if we should encourage new components to be written as functions. At this point I don't think there are any pre-16.8 consumers? |
Congrats on merging your first pull request to Design System React! 🎉 |
@alexzherdev I'm cool with that. Please update the docs when convenient. I believe DataTable has hooks in it. |
Also, love the account name: @2FALockedMeOutOfMyAcct |
Thanks for the reviews and merging. When will the next DSR release be @interactivellama @alexzherdev ? |
@interactivellama is the automated release build still broken? |
Yes. I could use some help in triaging the authentication, since the security protections went up. |
@2FALockedMeOutOfMyAcct Please open a release PR and I will pull down and push up a tag. |
@interactivellama I opened #3063 if that's what you meant? |
I'll try to get this out by End of week. |
There are additional issues with the NPM publishing process. I'm in talks with Jim in OSS group on getting different permissions set up. The tag is present in Github but we do not have a NPM package up today. |
Additional description
Adds Docked Composer to DSR

CONTRIBUTOR checklist (do not remove)
Please complete for every pull request
npm run lint:fix
has been run and linting passes.components/component-docs.json
CI tests pass (npm test
).REVIEWER checklist (do not remove)
components/component-docs.json
tests.Required only if there are markup / UX changes
last-slds-markup-review
inpackage.json
and push.last-accessibility-review
, topackage.json
and push.npm run local-update
within locally cloned site repo to confirm the site will function correctly at the next release.