Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Alternative confirm component #1333

Merged
merged 15 commits into from
Dec 11, 2017
Merged

Alternative confirm component #1333

merged 15 commits into from
Dec 11, 2017

Conversation

Blackbaud-SteveBrush
Copy link
Member

@Blackbaud-SteveBrush Blackbaud-SteveBrush commented Nov 30, 2017

@codecov-io
Copy link

codecov-io commented Dec 1, 2017

Codecov Report

Merging #1333 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #1333   +/-   ##
======================================
  Coverage     100%    100%           
======================================
  Files         364     370    +6     
  Lines        6723    6796   +73     
  Branches      865     874    +9     
======================================
+ Hits         6723    6796   +73
Impacted Files Coverage Δ
src/modules/confirm/confirm.service.ts 100% <100%> (ø)
src/modules/confirm/confirm.component.ts 100% <100%> (ø)
src/modules/confirm/confirm-instance.ts 100% <100%> (ø)
src/modules/confirm/confirm-modal-context.ts 100% <100%> (ø)
src/modules/confirm/types/confirm-type.ts 100% <100%> (ø)
src/modules/confirm/confirm.module.ts 100% <100%> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9ca3d15...27cab6f. Read the comment docs.

<button
type="button"
class="sky-btn sky-btn-primary sky-confirm-btn-ok"
(click)="openConfirm(1)">

Choose a reason for hiding this comment

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

I may be out in left field, but would it make sense to use the new type here, instead of a number?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure it's possible to include an enum here?

Copy link
Member Author

Choose a reason for hiding this comment

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

The value SkyConfirmType.OK === 1, for example...

Copy link
Member

@Blackbaud-PaulCrowder Blackbaud-PaulCrowder Dec 5, 2017

Choose a reason for hiding this comment

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

This probably isn't a big deal in the visual tests, but I saw the same thing in demo. Instead of having one method and passing in the number, I think I'd just break them out into separate methods (openYesCancel(), openYesNoCancel() etc.) and then demonstrate the use of the enum within the body of the method.

@@ -0,0 +1,5 @@
export interface SkyConfirmButtonConfig {
action?: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

action as a string will lead to some wonkiness where the user can configure the action to be something other than a SkyConfirmButtonAction. Someone might expect SkyConfirmButton.action to be a known value, but it would end up being set to something completely custom to the user.

Copy link
Member Author

Choose a reason for hiding this comment

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

I understand your point, but this was done to allow the developer to write custom actions, as needed. @Blackbaud-PaulCrowder can confirm the need of the requirement.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm totally fine with custom actions by the user. It just seems like maybe SkyConfirmationButtonAction shouldn't exist as a type. The union string type usually notifies to the developer and compiler that the only values this type can hold are those listed in the union. Allowing the user specify any string makes this no longer true and SkyConfirmButton.action is misrepresenting itself.

Choose a reason for hiding this comment

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

@Blackbaud-SteveBrush Do we currently have a way for the consumer to specify a custom action on a button? I don't see that as a property on SkyConfirmButtonConfig.

export class SkyConfirmInstance {
public closed = new EventEmitter<SkyConfirmCloseEventArgs>();

public open(
Copy link
Contributor

Choose a reason for hiding this comment

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

Why does open exist on SkyConfirmInstance? The service itself has an open function that returns a SkyConfirmInstance. Why would we also have an open function on the instance that the user could call too?

Choose a reason for hiding this comment

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

I noticed this, too. Seems like this logic could just exist inside SkyConfirmService.

Copy link
Member

@Blackbaud-PaulCrowder Blackbaud-PaulCrowder left a comment

Choose a reason for hiding this comment

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

See inline comments

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.

5 participants