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: As an assisted service agent, I want to view list of customer coupons for the customer #17748

Merged
merged 89 commits into from
Aug 18, 2023

Conversation

i53577
Copy link
Contributor

@i53577 i53577 commented Aug 10, 2023

(click)="
refreshCustomerCouponList.emit({
assignable: false,
searchQuery: undefined
Copy link
Contributor

Choose a reason for hiding this comment

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

no need pass searchQuery ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have just split the function, hope now it looks more clear.
In this scenario, user doesn't search anything. so no need to pass searchQuery.

assignable: undefined,
searchQuery: searchBox.value
});
searchBox.value = ''
Copy link
Contributor

Choose a reason for hiding this comment

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

why need clear the value of search box when press enter ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Some of search box use this behavior. I will check it with UX.

@Output() apply = new EventEmitter<PromotionListEntry>();
@Output() remove = new EventEmitter<PromotionListEntry>();
@Output() removeAlert = new EventEmitter();
@Output() removeAlertForApplyAction = new EventEmitter();
@Output() refreshCustomerCouponList = new EventEmitter<{
assignable: boolean | undefined;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
assignable: boolean | undefined;
assignable?: boolean;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the code has been refactored. Please check the latest code.

[showRemoveButton]="true"
[showApplyButton]="true"
[isCustomerCoupon]="true"
(refreshCustomerCouponList)="changeTab($event.assignable, $event.searchQuery)"
Copy link
Contributor

@i333055 i333055 Aug 10, 2023

Choose a reason for hiding this comment

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

not only changeTab, others like search will emit refreshCustomerCouponList , maybe function name can refine refreshCustomerCouponListHandler ?

Copy link
Contributor Author

@i53577 i53577 Aug 10, 2023

Choose a reason for hiding this comment

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

the code has been refactored. Please check the latest code.

@@ -3,6 +3,61 @@ <h4 class="cx-asm-customer-promotion-listing-heading-text">
{{ headerText }}
</h4>
</div>
<ng-container *ngIf="isCustomerCoupon">
Copy link
Contributor

@i333055 i333055 Aug 10, 2023

Choose a reason for hiding this comment

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

is more reasonable put these to asm-customer-customer-coupon component ? seems asm-customer-promotion-listing component is a more common and base list component.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will explain you in slack

Copy link
Contributor

Choose a reason for hiding this comment

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

consider to use ng-content

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ng-content works well. Thx a lot!

}

public changeTab(
assignable: boolean | undefined,
Copy link
Contributor

Choose a reason for hiding this comment

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

assignable?: boolean,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the code has been refactored. Please check the latest code.

#searchBox
class="cx-asm-customer-promotion-listing-search-input"
placeholder="{{ 'customer360.customerCoupons.searchBox' | cxTranslate }}"
(keydown.enter)="
Copy link
Contributor

Choose a reason for hiding this comment

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

if value changed do we need tigger search ? if yes maybe need consider debounce , if not ignore it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

only click enter or the search button will trigger search.

[showApplyButton]="true"
[isCustomerCoupon]="true"
(changeCustomerCouponTab)="changeTab($event)"
(searchCustomerCoupon)="searchCustomerCoupon($event)"
Copy link
Contributor

Choose a reason for hiding this comment

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

seems no need this two events for tabs and input has put in asm-customer-customer-coupon component

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed.

<cx-icon
class="success"
type="SUCCESS"
*ngIf="!isCustomerCoupon"
Copy link
Contributor

Choose a reason for hiding this comment

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

I see the *ngIf="!isCustomerCoupon" that has been used three times, How about only use one time?
e.g:

 <ng-container *ngIf="!isCustomerCoupon">
              <td>
                <cx-icon class="success" type="SUCCESS"></cx-icon>
              </td>
              <td class="cx-asm-customer-promotion-listing-applied">
                {{ applied }}
              </td>
              <td
                *ngIf="showRemoveButton"
                class="cx-asm-customer-promotion-listing-action-separator"
              >
                |
              </td>
            </ng-container>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agree, it will be more clear.

{{ applied }}
</td>
<td
*ngIf="showRemoveButton"
*ngIf="showRemoveButton && !isCustomerCoupon"
class="cx-asm-customer-promotion-listing-action-separator"
>
|
Copy link
Contributor

Choose a reason for hiding this comment

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

the | seems like redundant

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it not redundant, another section using this template will need it

type: Customer360Type.CUSTOMER_COUPON_LIST,
additionalRequestParameters: {
assignable: assignable,
searchQuery: undefined,
Copy link
Contributor

Choose a reason for hiding this comment

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

seem no need assignment undefined to var, Could you remove it ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

Copy link
Contributor

@niehuayang niehuayang left a comment

Choose a reason for hiding this comment

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

LGTM

@i53577
Copy link
Contributor Author

i53577 commented Aug 11, 2023

sonar failed caused by an issue need to be marked. I will invite people who have authority to mark it after finishing code review.
unit test failed caused by customer-ticketing don’t meet the coverage threshold. This PR is not related to customer-ticketing. I have raised the issue in slack channel.
https://sap-cx.slack.com/archives/CAC8PULNN/p1691736803168119

Copy link
Contributor

@niehuayang niehuayang left a comment

Choose a reason for hiding this comment

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

LGTM

@i53577 i53577 merged commit e18ecd8 into epic/CXSPA-700 Aug 18, 2023
7 checks passed
@i53577 i53577 deleted the feature/CXSPA-3945 branch August 18, 2023 06:06
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