Skip to content
This repository was archived by the owner on Dec 23, 2021. It is now read-only.

Conversation

@xnkevinnguyen
Copy link
Contributor

@xnkevinnguyen xnkevinnguyen commented Jan 21, 2020

Description:

In preparation of expanding functionality of the extension, making component reusable is a priority to reduce technical debt in the near future.

Refactoring of component by extracting 2 components:

  • Toolbar
  • Action bar (play/stop, refresh)

Also contains:

  • cpx is put into a device container (multiple devices in the future and possibly more)
  • name changes for consistency of the project

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Type of change

Please delete options that are not relevant.

  • [x ] Refactoring (no breaking changes)

Limitations:

Please describe limitations of this PR

Testing:

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

@xnkevinnguyen xnkevinnguyen changed the title Users/t xunguy/cpx components refactor Refactor toolbar and actionbar Jan 21, 2020
Copy link
Contributor

@andreamah andreamah left a comment

Choose a reason for hiding this comment

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

Good! Thanks for the organized refactoring 👍

import Dropdown from "./Dropdown";
import ActionBar from "./simulator/ActionBar"


Copy link
Contributor

Choose a reason for hiding this comment

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

nit: one line between these imports? or is this a convention for css files?

if (l > 50) s = 100 * (cDelta / (2 - maxAndMin));
else s = 100 * (cDelta / maxAndMin);
if (l > 50) { s = 100 * (cDelta / (2 - maxAndMin)); }
else { s = 100 * (cDelta / maxAndMin); }
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: would look better if it were like:

if () {
  ...
} else {
  ...
}

or as ternary operator

border-color: var(--vscode-highContrastButtonBorderOverride-color);
border-width: 1px;
border-style: solid;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: add space in between here

image: TOOLBAR_SVG.LIGHT_SVG,
label: TOOLBAR_ICON_ID.LIGHT,
}
, {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: these brackets are all messed up and inconsistent

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks for the heads up. I'll actually make it a task to have proper linting rules and set up so it doesnt slow us down in the future

@xnkevinnguyen xnkevinnguyen merged commit 57395fb into dev Jan 22, 2020
@vandyliu vandyliu deleted the users/t-xunguy/cpx-components-refactor branch January 23, 2020 03:23
Copy link

@nasadigital nasadigital left a comment

Choose a reason for hiding this comment

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

A bit late, but great job!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants