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

feat(components/collapsiblepanel): style update #961

Merged
merged 26 commits into from
Jan 15, 2018

Conversation

charlesnguyen
Copy link
Contributor

@charlesnguyen charlesnguyen commented Jan 5, 2018

What is the problem this PR is trying to solve?
New guidesline updates: https://company-57688.frontify.com/document/135457#/export-history-v2

Take into account the following changes:
-Left bar with the status color
-Status label must be displayed in black, not colored anymore

What is the chosen solution to this problem?

Please check if the PR fulfills these requirements

  • The PR commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • Related design / discussions / pages (not in jira), if any, are all linked or available in the PR

[x] This PR introduces a breaking change
-The boolean 'selected' used for 'selected CollapsiblePanel' is replaced by the string 'status' in order to customize the panel border
For Example:
selected: true => status = 'selected'
selected: false=> status = ''
-Status component has no longer default export.
import Status from '../Status'; ---> import { Status, getbsStyleFromStatus } from '../Status';

@charlesnguyen charlesnguyen changed the title Cnguyen/tdp 4895 update collapsible panel style feat(component): tdp-4895 update collapsible panel style Jan 5, 2018
@build-travis-ci
Copy link
Collaborator

:octocat: Demo is available here

}

&.muted {
color: $brand-muted;
Copy link
Collaborator

Choose a reason for hiding this comment

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

You have created brand-muted on $grey.
I think just color $grey should be enough here.
$brand-xx are bootstrap-sass variable we have changed using our own colors in the bootstrap theme.
I will not block it for that but I would like other opinion

@build-travis-ci
Copy link
Collaborator

:octocat: Demo is available here

@build-travis-ci
Copy link
Collaborator

:octocat: Demo is available here

@frassinier frassinier changed the title feat(component): tdp-4895 update collapsible panel style feat(components/collapsiblepanel): style update Jan 11, 2018
@@ -254,13 +229,15 @@ CollapsiblePanel.propTypes = {
onSelect: PropTypes.func,
onToggle: PropTypes.func,
expanded: PropTypes.bool,
selected: PropTypes.bool,
status: PropTypes.string,
Copy link
Contributor

Choose a reason for hiding this comment

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

Breaking changes should be referenced into /BREAKING_CHANGES.MD file 🙏

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

&.muted {
border-left: 4px solid $grey;
padding-left: 1px;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't Repeat Yourself

    &.info,
	&.success,
	&.danger,
	&.muted {
		padding-left: 1px;
		border-left: 4px solid;
	}
    
    &.info {
		border-left-color: $brand-info;
	}
 
	&.success {
		border-left-color: $brand-success;
	}
 
	&.danger {
		border-left-color: $brand-danger;
	}
 
	&.muted {
		border-left-color: $grey;
	}

829:11 warning Hex notation should all be upper case hex-notation
831:13 warning Hex notation should all be upper case hex-notation
834:10 warning Hex notation should all be upper case hex-notation
836:20 warning Hex notation should all be upper case hex-notation
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you change sasslint configuration please?

@build-travis-ci
Copy link
Collaborator

:octocat: Demo is available here

@build-travis-ci
Copy link
Collaborator

:octocat: Demo is available here

@build-travis-ci
Copy link
Collaborator

:octocat: Demo is available here

@build-travis-ci
Copy link
Collaborator

:octocat: Demo is available here

1 similar comment
@build-travis-ci
Copy link
Collaborator

:octocat: Demo is available here

@build-travis-ci
Copy link
Collaborator

:octocat: Demo is available here

.sass-lint.yml Outdated
- 1
-
style: 'uppercase'
- 0
Copy link
Contributor

Choose a reason for hiding this comment

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

You should make a PR on the tools repository (https://github.com/Talend/tools/blob/master/tools-scss-formatting/.sass-lint.yml) prior to this change.

After that, please, make another PR for this change.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is be aligned with perttier ? In that case I auto agree with the PR on tools :D

@@ -105,5 +97,3 @@ Status.propTypes = {
Status.defaultProps = {
actions: [],
};

export default Status;
Copy link
Contributor

Choose a reason for hiding this comment

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

Because of this, Status component is no more required like that :

import Status from 'blah';

but like that :

import { Status } from 'blah';

So I think this is a breaking change too. What do you think ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

const adaptActions = actions.map(action => ({
...action,
onClick: getActionHandler(action.onClick, headerItem),
}));
Copy link
Contributor

Choose a reason for hiding this comment

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

adapt is meaningless. It doesn't describe the transformation applied to the actions. Please find a more descriptive name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

[css.open]: expanded,
[css[getbsStyleFromStatus(status) || status]]: !!status,
status,
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Lots of complexity for some classes. I can't from a first read be sure of what makes it as class.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@talend-glorieux I agree with you but I do not know how to improve it and I do not know why there were so much class.

progress,
} = props;
export function Status(props) {
const { status, label, icon, actions, progress } = props;
Copy link
Contributor

Choose a reason for hiding this comment

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

Please put that spread inside the function arguments declaration. props isn't reused anywhere in the function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

828:11 warning Hex notation should all be upper case hex-notation
830:13 warning Hex notation should all be upper case hex-notation
833:10 warning Hex notation should all be upper case hex-notation
835:20 warning Hex notation should all be upper case hex-notation
Copy link
Contributor

Choose a reason for hiding this comment

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

Please fix those errors.

@build-travis-ci
Copy link
Collaborator

:octocat: Demo is available here

@build-travis-ci
Copy link
Collaborator

:octocat: Demo is available here

@build-travis-ci
Copy link
Collaborator

:octocat: Demo is available here

@@ -1,5 +1,21 @@
# Breaking changes log

## v0.141.0
Copy link
Contributor

Choose a reason for hiding this comment

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

@build-travis-ci
Copy link
Collaborator

:octocat: Demo is available here

@build-travis-ci
Copy link
Collaborator

:octocat: Demo is available here

@build-travis-ci
Copy link
Collaborator

:octocat: Demo is available here

@charlesnguyen charlesnguyen merged commit 765b79b into master Jan 15, 2018
@charlesnguyen charlesnguyen deleted the cnguyen/TDP-4895_review_collapsiblePanel branch January 15, 2018 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants