Skip to content

Conversation

@DiegoTinitana
Copy link
Contributor

No description provided.

@codecov
Copy link

codecov bot commented Jun 15, 2020

Codecov Report

Merging #387 into master will decrease coverage by 1.31%.
The diff coverage is 67.39%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #387      +/-   ##
==========================================
- Coverage   91.72%   90.40%   -1.32%     
==========================================
  Files          71       72       +1     
  Lines        1184     1220      +36     
  Branches       77       78       +1     
==========================================
+ Hits         1086     1103      +17     
- Misses         71       89      +18     
- Partials       27       28       +1     
Impacted Files Coverage Δ
...omponents/activity-list/activity-list.component.ts 78.57% <50.00%> (-21.43%) ⬇️
...omponents/customer-list/customer-list.component.ts 91.66% <50.00%> (-8.34%) ⬇️
...s/project-type-list/project-type-list.component.ts 80.00% <50.00%> (-20.00%) ⬇️
.../components/project-list/project-list.component.ts 84.21% <50.00%> (-15.79%) ⬇️
...dules/time-entries/pages/time-entries.component.ts 90.00% <72.72%> (-6.78%) ⬇️
...nents/time-range-form/time-range-form.component.ts 100.00% <100.00%> (ø)
...dules/shared/components/dialog/dialog.component.ts 100.00% <100.00%> (ø)
...modules/shared/components/clock/clock.component.ts 58.33% <0.00%> (-33.34%) ⬇️
.../components/technologies/technologies.component.ts 90.32% <0.00%> (ø)
... and 1 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 e6c6ec4...2c9c0a2. Read the comment docs.

fixture.detectChanges();
component.removeListById(merged.id);
expect(component.removeList.emit).toHaveBeenCalled();
component.cancelDeleteModal.nativeElement.click();
Copy link
Contributor

@juanultimate juanultimate Jun 15, 2020

Choose a reason for hiding this comment

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

What is this line for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this line is to close de modal

</button>
</div>
<div class="modal-body">
Are you sure you want to delete <b>{{ list.project_name || list.name }}</b>
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 we need a question mark at the end of this sentence?

Copy link
Contributor

Choose a reason for hiding this comment

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

We do need it for sure. So messages should look like:

Are you sure you want to delete XYZ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes this is working, I need to put this {{ list.project_name || list.name }} because the objects don't have the same names.

Are you sure you want to delete <b>{{ list.project_name || list.name }}</b>
</div>
<div class="modal-footer">
<button (click)="removeListById(list.id)" type="button" class="btn btn-primary">Delete</button>
Copy link
Contributor

@juanultimate juanultimate Jun 15, 2020

Choose a reason for hiding this comment

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

Since this is a confirmation dialog, I would change the Delete/Cancel button texts by Yes/No or Confirm/Cancel so that in the future we can reuse this confirmation dialog in any other action that demands user confirmation.

Copy link
Contributor

Choose a reason for hiding this comment

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

Probably not, since this component is intended to be used just to confirm delete actions. In this sense, I'd rather call it
src/app/modules/shared/components/dialogs/remove.dialog.component.html

The functionality works good but we need to move the buttons so the first option is Cancel and the second one is Delete. This is how confirmation modal panels usually look like:
Screen Shot 2020-06-16 at 09 51 06

Taking the image into account, let's use the style danger for the Delete button.

<div class="modal-dialog" role="document">
<div class="modal-content" *ngIf="list">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">{{ title }}</h5>
Copy link
Contributor

Choose a reason for hiding this comment

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

id would me modalTitle or so. Please replace exampleModalPanel

Copy link
Contributor

Choose a reason for hiding this comment

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

Any chance to put the title using a bold style?

</button>
</div>
<div class="modal-body">
Are you sure you want to delete <b>{{ list.project_name || list.name }}</b>
Copy link
Contributor

Choose a reason for hiding this comment

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

We do need it for sure. So messages should look like:

Are you sure you want to delete XYZ?

Are you sure you want to delete <b>{{ list.project_name || list.name }}</b>
</div>
<div class="modal-footer">
<button (click)="removeListById(list.id)" type="button" class="btn btn-primary">Delete</button>
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably not, since this component is intended to be used just to confirm delete actions. In this sense, I'd rather call it
src/app/modules/shared/components/dialogs/remove.dialog.component.html

The functionality works good but we need to move the buttons so the first option is Cancel and the second one is Delete. This is how confirmation modal panels usually look like:
Screen Shot 2020-06-16 at 09 51 06

Taking the image into account, let's use the style danger for the Delete button.

@DiegoTinitana DiegoTinitana force-pushed the 371_Add_confirmation_before_deleting_data branch 3 times, most recently from fa8fe33 to 3a80c14 Compare June 17, 2020 17:04
</div>
<div class="modal-footer">
<button #cancelDeleteModal type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button (click)="closeModal()" type="button" class="btn btn-danger">Delete</button>
Copy link
Contributor

@juanultimate juanultimate Jun 18, 2020

Choose a reason for hiding this comment

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

Replace Delete by Confirm so that this modal can be used by other confirm scenarios

@juanultimate juanultimate self-requested a review June 18, 2020 11:11
@DiegoTinitana DiegoTinitana force-pushed the 371_Add_confirmation_before_deleting_data branch from 3a80c14 to 2c9c0a2 Compare June 18, 2020 14:27
@enriquezrene enriquezrene merged commit ae7f3f3 into master Jun 18, 2020
@enriquezrene enriquezrene deleted the 371_Add_confirmation_before_deleting_data branch June 18, 2020 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants