From bc819a15dac96903f136731c4afa6698fb4ec620 Mon Sep 17 00:00:00 2001 From: yibaebi Date: Wed, 4 Sep 2024 09:51:35 +0100 Subject: [PATCH] complete global styles migration in partner dashboard --- .../partner/client-info/template.hbs | 18 +- app/components/partner/client-list/index.hbs | 2 +- .../partner/client-plan/template.hbs | 4 +- .../partner/client-project-detail/index.hbs | 10 +- .../partner/client-project-list/index.hbs | 33 +- .../partner/client-project-list/index.scss | 12 + .../client-project-list/item/index.hbs | 23 +- .../client-project-list/item/index.scss | 14 +- .../partner/client-report-download/index.hbs | 65 ++-- .../partner/client-report-download/index.scss | 28 +- .../report-password/index.hbs | 24 +- .../report-password/index.scss | 8 +- .../partner/client-uploads-list/index.hbs | 78 +++-- .../partner/client-uploads-list/index.scss | 23 +- .../client-uploads-stat-chart/index.hbs | 7 +- .../client-uploads-stat-chart/index.scss | 5 +- .../credit-transfer-confirm/index.hbs | 36 ++- .../credit-transfer-confirm/index.scss | 5 - .../credit-transfer-input/index.hbs | 11 +- .../credit-transfer-input/index.scss | 4 - .../partner/credit-transfer/index.hbs | 32 +- .../partner/credit-transfer/index.scss | 4 - app/components/partner/export-stats/index.hbs | 8 +- .../partner/invitation-list/index.hbs | 29 +- app/components/partner/invitation/index.hbs | 70 ++--- app/components/partner/invitation/index.scss | 44 +-- .../partner/invite-client/index.hbs | 162 ++++------ app/components/partner/partner-plan/index.hbs | 4 +- .../index.hbs | 20 +- .../registration-request-pending/index.hbs | 78 +++-- .../registration-request-pending/index.scss | 39 +-- .../index.hbs | 27 +- .../registration-request-rejected/index.hbs | 60 ++-- .../registration-request-rejected/index.scss | 38 +-- .../authenticated/partner/analytics.hbs | 6 +- .../authenticated/partner/client.hbs | 8 +- .../partner/clients/invitations.hbs | 2 +- .../partner/clients/registration-requests.hbs | 2 +- .../authenticated/partner/project.hbs | 8 +- .../partner/client-project-list-test.js | 4 +- .../partner/client-project-list/item-test.js | 9 +- .../partner/client-report-download-test.js | 2 +- .../client-uploads-list/component-test.js | 12 +- .../partner/credit-transfer/index-test.js | 11 +- .../components/partner/invite-client-test.js | 297 +++++++++--------- .../registration-request-pending-list-test.js | 11 +- .../registration-request-pending-test.js | 22 +- 47 files changed, 728 insertions(+), 691 deletions(-) delete mode 100644 app/components/partner/credit-transfer/index.scss diff --git a/app/components/partner/client-info/template.hbs b/app/components/partner/client-info/template.hbs index c23dbb5dc..9896a9260 100644 --- a/app/components/partner/client-info/template.hbs +++ b/app/components/partner/client-info/template.hbs @@ -25,9 +25,9 @@ {{#if @client.lastUploadedOn}} {{dayjs-from-now @client.lastUploadedOn}} {{else}} - + {{t 'noUploads'}} - + {{/if}} @@ -79,11 +79,15 @@ {{/if}} {{#if (and @showDetailLink this.partner.access.list_projects)}}
- + + + + +
{{/if}} diff --git a/app/components/partner/client-list/index.hbs b/app/components/partner/client-list/index.hbs index ec7bfbd4c..3e5ee35e4 100644 --- a/app/components/partner/client-list/index.hbs +++ b/app/components/partner/client-list/index.hbs @@ -1,4 +1,4 @@ -
+

{{t 'clients'}}

diff --git a/app/components/partner/client-plan/template.hbs b/app/components/partner/client-plan/template.hbs index cb4d1029d..e7f71a572 100644 --- a/app/components/partner/client-plan/template.hbs +++ b/app/components/partner/client-plan/template.hbs @@ -15,13 +15,13 @@
{{#if this.clientPlan.limitedScans}} - + {{this.clientPlan.scansLeft}} {{t 'pluralScans' itemCount=this.clientPlan.scansLeft}} {{t 'remaining'}} {{else}} - + {{this.clientPlan.projectsLimit}} {{t 'pluralApps' itemCount=this.clientPlan.projectsLimit}} diff --git a/app/components/partner/client-project-detail/index.hbs b/app/components/partner/client-project-detail/index.hbs index 41b6634ab..ed5f5e1d1 100644 --- a/app/components/partner/client-project-detail/index.hbs +++ b/app/components/partner/client-project-detail/index.hbs @@ -1,7 +1,7 @@ - - {{@project.packageName}} + + + + {{@project.packageName}} + \ No newline at end of file diff --git a/app/components/partner/client-project-list/index.hbs b/app/components/partner/client-project-list/index.hbs index 54292b0ab..0e282fab0 100644 --- a/app/components/partner/client-project-list/index.hbs +++ b/app/components/partner/client-project-list/index.hbs @@ -3,12 +3,15 @@

{{t 'projects'}}

-
{{this.totalParnterClientProjectsCount}} -
+
-
+ {{t 'platform'}} -
+ -
+ {{t 'packageName'}} -
+ -
+ {{t 'createdOn'}} -
+
diff --git a/app/components/partner/client-project-list/index.scss b/app/components/partner/client-project-list/index.scss index 902b2d318..7e95d6c87 100644 --- a/app/components/partner/client-project-list/index.scss +++ b/app/components/partner/client-project-list/index.scss @@ -76,3 +76,15 @@ align-items: center; justify-content: center; } + +.badge { + font-size: 0.857em; + min-width: 24px; + min-height: 20px; + padding: 0em 0.357em; + margin-left: 0.7em; + border-radius: var(--border-radius); + font-weight: var(--font-weight-regular); + background-color: var(--neutral-grey-200); + color: var(--text-secondary); +} diff --git a/app/components/partner/client-project-list/item/index.hbs b/app/components/partner/client-project-list/item/index.hbs index 921f5b8b1..1d0db60d0 100644 --- a/app/components/partner/client-project-list/item/index.hbs +++ b/app/components/partner/client-project-list/item/index.hbs @@ -1,10 +1,7 @@ - - + + +
{{@project.packageName}}
-
+ + {{day-js date=@project.createdOn format='DD MMM YYYY'}} -
+ + {{#if (and @enableViewFiles @clientId @project.id)}} - {{t 'viewUploads'}} - + {{/if}} \ No newline at end of file diff --git a/app/components/partner/client-project-list/item/index.scss b/app/components/partner/client-project-list/item/index.scss index 0b26ff91f..d05298615 100644 --- a/app/components/partner/client-project-list/item/index.scss +++ b/app/components/partner/client-project-list/item/index.scss @@ -3,15 +3,15 @@ color: var(--black-500); } -.platform-android { - color: var(--android); -} -.platform-apple { - color: var(--ios); -} - .version { display: grid; align-items: center; font-size: 0.95em; } + +.view-files-button { + height: 32px; + padding-left: 0.7143em; + padding-right: 0.7143em; + border: 1px solid var(--primary); +} diff --git a/app/components/partner/client-report-download/index.hbs b/app/components/partner/client-report-download/index.hbs index 3e752527a..820d5f3d3 100644 --- a/app/components/partner/client-report-download/index.hbs +++ b/app/components/partner/client-report-download/index.hbs @@ -30,35 +30,47 @@ <:default> - + + <:leftIcon> + {{#unless this.isGenerating}} + + {{/unless}} + + + <:default> + {{#if this.isGenerating}} + + + + {{t 'generating'}} + + {{else}} + + {{t 'download'}} + + {{/if}} + +
@@ -78,16 +90,15 @@ <:default> - +
diff --git a/app/components/partner/client-report-download/index.scss b/app/components/partner/client-report-download/index.scss index 211eb8b1b..5d4ce6f50 100644 --- a/app/components/partner/client-report-download/index.scss +++ b/app/components/partner/client-report-download/index.scss @@ -9,9 +9,8 @@ } .button-progress { - &:hover { + &:disabled { background-color: transparent !important; - color: var(--primary) !important; } } @@ -38,3 +37,28 @@ justify-content: center; gap: 0.5rem; } + +.is-progress { + transition: width 0.6s ease; + background-image: linear-gradient( + -45deg, + #fff2f1 25%, + transparent 25%, + transparent 50%, + #fff2f1 50%, + #fff2f1 75%, + transparent 75%, + transparent + ); + background-size: 20px 20px; + animation: progress 0.5s linear infinite; +} + +@keyframes progress { + 0% { + background-position: 0px 0px; + } + 100% { + background-position: 20px 0px; + } +} diff --git a/app/components/partner/client-report-download/report-password/index.hbs b/app/components/partner/client-report-download/report-password/index.hbs index 7c2d23508..e6fa20494 100644 --- a/app/components/partner/client-report-download/report-password/index.hbs +++ b/app/components/partner/client-report-download/report-password/index.hbs @@ -6,16 +6,14 @@ <:default> - + @@ -47,18 +45,22 @@ data-test-report-password-value /> - + <:leftIcon> + + + + <:default> + {{t 'copy'}} + +
{{else if this.apiError}}
diff --git a/app/components/partner/client-report-download/report-password/index.scss b/app/components/partner/client-report-download/report-password/index.scss index 56db31191..de0212d22 100644 --- a/app/components/partner/client-report-download/report-password/index.scss +++ b/app/components/partner/client-report-download/report-password/index.scss @@ -1,6 +1,12 @@ .dropdown-toggle { height: 2rem; padding: 0.5rem; + + &:focus { + background-color: var(--secondary); + border-color: var(--secondary); + color: var(--common-white) !important; + } } .dropdown-tray { @@ -43,7 +49,7 @@ background-color: var(--black-025); border: 1px solid var(--black-100); border-radius: 0.3rem; - height: 2rem; + height: 2.5rem; padding-left: 0.3rem; padding-right: 0.3rem; width: 9rem; diff --git a/app/components/partner/client-uploads-list/index.hbs b/app/components/partner/client-uploads-list/index.hbs index adf541281..616c74a5f 100644 --- a/app/components/partner/client-uploads-list/index.hbs +++ b/app/components/partner/client-uploads-list/index.hbs @@ -1,14 +1,25 @@ {{#if this.partner.access.list_files}}
-

{{t 'uploads'}}

- -
+ {{t 'uploads'}} + + + {{this.totalParnterClientUploadsCount}} -
+
-
{{t 'app'}}
- -
+ + {{t 'app'}} + + + {{t 'version'}} -
- -
+ + + {{t 'uploaded'}} -
+ {{#if this.partner.access.view_reports}} -
+ {{t 'scanResults'}} -
+ -
+ {{t 'report'}} -
+ {{/if}}
@@ -82,14 +120,14 @@ >
-
{{upload.name}} -
+
{{t 'fileID'}}: diff --git a/app/components/partner/client-uploads-list/index.scss b/app/components/partner/client-uploads-list/index.scss index d5007190c..fae338812 100644 --- a/app/components/partner/client-uploads-list/index.scss +++ b/app/components/partner/client-uploads-list/index.scss @@ -5,13 +5,6 @@ align-items: center; } -.title { - font-size: 1.1rem; - font-weight: bold; - color: var(--black-600); - margin-bottom: 0 !important; -} - .table { border: 1px solid var(--border-table); border-radius: 0.3rem; @@ -70,10 +63,6 @@ background-repeat: no-repeat; } -.app-name { - color: var(--black-900); -} - .fileid-key { color: var(--black-300); } @@ -140,3 +129,15 @@ align-items: center; justify-content: center; } + +.badge { + font-size: 0.857em; + min-width: 24px; + min-height: 20px; + padding: 0em 0.357em; + margin-left: 0.7em; + border-radius: var(--border-radius); + font-weight: var(--font-weight-regular); + background-color: var(--neutral-grey-200); + color: var(--text-secondary); +} diff --git a/app/components/partner/client-uploads-stat-chart/index.hbs b/app/components/partner/client-uploads-stat-chart/index.hbs index 58b072658..f22d94105 100644 --- a/app/components/partner/client-uploads-stat-chart/index.hbs +++ b/app/components/partner/client-uploads-stat-chart/index.hbs @@ -48,9 +48,7 @@
{{#each this.timelinePlaceholders as |option seq|}} - - + {{/each}}
diff --git a/app/components/partner/client-uploads-stat-chart/index.scss b/app/components/partner/client-uploads-stat-chart/index.scss index e08f7339d..82a9b1804 100644 --- a/app/components/partner/client-uploads-stat-chart/index.scss +++ b/app/components/partner/client-uploads-stat-chart/index.scss @@ -56,12 +56,15 @@ .option { border: 1px solid var(--primary); border-radius: 12px; - padding: 0.5rem 1rem; + padding: 0.5rem 1rem !important; + max-height: 32px; + background-color: transparent; text-transform: uppercase; font-size: 0.8rem; cursor: pointer; color: var(--primary); border-radius: 0; + &:hover, &:active, &:focus { diff --git a/app/components/partner/credit-transfer/credit-transfer-confirm/index.hbs b/app/components/partner/credit-transfer/credit-transfer-confirm/index.hbs index 6578f943c..3f89fd3a1 100644 --- a/app/components/partner/credit-transfer/credit-transfer-confirm/index.hbs +++ b/app/components/partner/credit-transfer/credit-transfer-confirm/index.hbs @@ -17,7 +17,8 @@
-
+ +
@@ -25,7 +26,7 @@ {{t 'client'}}:
{{#if @clientName}} @@ -53,28 +54,33 @@
-
+ {{#if @transferCredits}} - + {{/if}} + {{#if @toggleMode}} - + {{/if}} -
- + + \ No newline at end of file diff --git a/app/components/partner/credit-transfer/credit-transfer-confirm/index.scss b/app/components/partner/credit-transfer/credit-transfer-confirm/index.scss index df2a0d492..ccc01bdf4 100644 --- a/app/components/partner/credit-transfer/credit-transfer-confirm/index.scss +++ b/app/components/partner/credit-transfer/credit-transfer-confirm/index.scss @@ -16,11 +16,6 @@ align-items: center; } -.action-btns { - display: flex; - justify-content: center; -} - .empty-title { font-style: italic; } diff --git a/app/components/partner/credit-transfer/credit-transfer-input/index.hbs b/app/components/partner/credit-transfer/credit-transfer-input/index.hbs index 121cac39b..d1094da6d 100644 --- a/app/components/partner/credit-transfer/credit-transfer-input/index.hbs +++ b/app/components/partner/credit-transfer/credit-transfer-input/index.hbs @@ -32,15 +32,14 @@ {{#if @toggleMode}} - + {{/if}} \ No newline at end of file diff --git a/app/components/partner/credit-transfer/credit-transfer-input/index.scss b/app/components/partner/credit-transfer/credit-transfer-input/index.scss index a10c721ba..8a44d829a 100644 --- a/app/components/partner/credit-transfer/credit-transfer-input/index.scss +++ b/app/components/partner/credit-transfer/credit-transfer-input/index.scss @@ -69,7 +69,3 @@ .tranfer-btn { justify-self: center; } -.disabled-btn { - opacity: 0.5; - cursor: default; -} diff --git a/app/components/partner/credit-transfer/index.hbs b/app/components/partner/credit-transfer/index.hbs index 26b8d16b2..c2336c90c 100644 --- a/app/components/partner/credit-transfer/index.hbs +++ b/app/components/partner/credit-transfer/index.hbs @@ -2,7 +2,6 @@ (and this.partner.access.view_plans this.partner.access.transfer_credits) }}
- + <:leftIcon> + + + + <:default> + {{t 'transferCredits'}} + + {{/if}}
@@ -40,11 +40,7 @@ @showHeader={{true}} @headerTitle={{t 'creditTransfer'}} > -
- +
{{#if this.isEditMode}} {{t 'downloadClientsStatData'}}
+
+ {{#if this.selectedDateRange.start}} @@ -27,8 +28,8 @@ {{else}} {{t 'fromDate'}} {{/if}} - + - @@ -43,8 +44,9 @@
+ +

{{t 'pendingInvitations'}}

@@ -28,12 +28,27 @@
-
{{t 'invitee'}}
-
{{t 'company'}}
-
{{t 'invited'}}
-
{{t 'expiresOn'}}
-
{{t 'source'}}
-
+ + {{t 'invitee'}} + + + + {{t 'company'}} + + + + {{t 'invited'}} + + + + {{t 'expiresOn'}} + + + + {{t 'source'}} + + +
diff --git a/app/components/partner/invitation/index.hbs b/app/components/partner/invitation/index.hbs index 17e94652f..149d01f12 100644 --- a/app/components/partner/invitation/index.hbs +++ b/app/components/partner/invitation/index.hbs @@ -2,67 +2,67 @@ local-class='invitation {{if @request.hasExpired "invitation-expired"}}' ...attributes > -
-
{{@request.email}}
-
{{@request.fullName}}
-
+ + {{@request.email}} + + + {{@request.fullName}} + + -
{{@request.data.company}}
+ + {{@request.data.company}} + -
- {{dayjs-from-now @request.updatedOn}} -
+ {{dayjs-from-now @request.updatedOn}} +
{{#if @request.hasExpired}} -
{{t 'expired'}}
+ > + {{t 'expired'}} + {{else}} -
{{day-js date=@request.validUntil format='DD MMM YYYY'}}
+ @variant='body2' + > + {{day-js date=@request.validUntil format='DD MMM YYYY'}} + {{/if}}
-
{{@request.source}}
+
+ {{@request.source}} +
-
+ - + - + + -
+
\ No newline at end of file diff --git a/app/components/partner/invitation/index.scss b/app/components/partner/invitation/index.scss index bc570b868..08f3dee20 100644 --- a/app/components/partner/invitation/index.scss +++ b/app/components/partner/invitation/index.scss @@ -9,64 +9,30 @@ grid-template-columns: 1fr 25% 9rem 7rem 6.5rem 6rem; } } + .invitation-expired { background-color: var(--bg-gray-lighten-015); opacity: 0.6; } -.user { - padding-right: 1rem; -} -.email { - color: var(--black-700); - font-size: 0.95rem; - font-weight: 600; - line-height: 1.2; - word-break: break-word; - overflow-wrap: break-word; - text-overflow: ellipsis; -} -.name { - word-break: break-word; - overflow-wrap: break-word; - text-overflow: ellipsis; - padding-top: 0.3rem; - font-size: 0.9rem; -} -.company { - word-break: break-word; - overflow-wrap: break-word; - text-overflow: ellipsis; - padding-right: 1rem; - font-size: 0.92rem; -} -.date { - font-style: italic; - font-size: 0.9rem; - padding-right: 0.5rem; -} -.expired { - color: var(--text-error); - text-transform: lowercase; -} + .source { font-size: 0.85rem; padding: 0.1rem 0.6rem 0.2rem; display: inline-block; border-radius: 0.3rem; } + .source-backoffice { color: var(--label-orange-color); background-color: var(--label-orange-bg); } + .source-invitation { color: var(--label-green-color); background-color: var(--label-green-bg); } + .source-registration { color: var(--label-blue-color); background-color: var(--label-blue-bg); } -.actions { - display: flex; - justify-content: flex-end; -} diff --git a/app/components/partner/invite-client/index.hbs b/app/components/partner/invite-client/index.hbs index 33d3063c0..efe4cb597 100644 --- a/app/components/partner/invite-client/index.hbs +++ b/app/components/partner/invite-client/index.hbs @@ -1,12 +1,16 @@ - + <:leftIcon> + + + + <:default> + {{t 'inviteClients'}} + + {{#if this.showInviteModal}} -
-
- - {{#if this.changeset.error.email}} - {{this.changeset.error.email.validation}} - {{/if}} -
- +
-
-
- - {{#if - (or this.changeset.error.first_name this.changeset.error.last_name) - }} - {{this.changeset.error.first_name.validation}} - {{this.changeset.error.last_name.validation}} - {{/if}} -
-
- - -
-
+ + -
-
- - {{#if this.changeset.error.company}} - {{this.changeset.error.company.validation}} - {{/if}} -
- + + +
+
- + data-test-input-send-btn + > + <:leftIcon> + + <:default>{{t 'sendInvitation'}} +
diff --git a/app/components/partner/partner-plan/index.hbs b/app/components/partner/partner-plan/index.hbs index 6290d7edf..94a197cb2 100644 --- a/app/components/partner/partner-plan/index.hbs +++ b/app/components/partner/partner-plan/index.hbs @@ -18,13 +18,13 @@ @arrow={{true}} @title='No credits left to transfer to the clients. Please upgrade your plan' > -
+
{{else if (not this.partnerPlan.limitedScans)}} {{! NOTE credit transfer unavailable warning }}
-
+
<:tooltipContent> +

{{t 'pendingRequests'}}

@@ -33,10 +33,20 @@ local-class='table-header' data-test-pending-requests-table-header > -
{{t 'requested'}} {{t 'by'}}
-
{{t 'company'}}
-
{{t 'requested'}}
-
+ + {{t 'requested'}} + {{t 'by'}} + + + + {{t 'company'}} + + + + {{t 'requested'}} + + +
diff --git a/app/components/partner/registration-request-pending/index.hbs b/app/components/partner/registration-request-pending/index.hbs index 402ecdf07..bdd5727ba 100644 --- a/app/components/partner/registration-request-pending/index.hbs +++ b/app/components/partner/registration-request-pending/index.hbs @@ -1,41 +1,59 @@
-
-
{{@request.email}}
-
+ + {{@request.email}} + + + {{@request.fullName}}
-
-
+ {{@request.fullName}} + + + + {{@request.data.company}}
-
+ {{@request.data.company}} + + + {{dayjs-from-now @request.createdOn}}
-
- - -
+ > + <:leftIcon> + + <:default>Reject + +
\ No newline at end of file diff --git a/app/components/partner/registration-request-pending/index.scss b/app/components/partner/registration-request-pending/index.scss index bbebf901a..cc8e24909 100644 --- a/app/components/partner/registration-request-pending/index.scss +++ b/app/components/partner/registration-request-pending/index.scss @@ -9,39 +9,8 @@ grid-template-columns: 1fr 30% 11.5rem 12rem; } } -.user { - padding-right: 1rem; -} -.email { - color: var(--black-700); - font-size: 0.95rem; - font-weight: 600; - line-height: 1.2; - word-break: break-word; - overflow-wrap: break-word; - text-overflow: ellipsis; -} -.name { - word-break: break-word; - overflow-wrap: break-word; - text-overflow: ellipsis; - padding-top: 0.3rem; - font-size: 0.9rem; -} -.company { - word-break: break-word; - overflow-wrap: break-word; - text-overflow: ellipsis; - padding-right: 1rem; - font-size: 0.92rem; -} -.date { - font-style: italic; - font-size: 0.9rem; - padding-right: 0.5rem; -} -.actions { - display: flex; - justify-content: flex-end; - align-items: center; + +.invite-btn { + border: 1px solid var(--success-main) !important; + color: var(--success-main) !important; } diff --git a/app/components/partner/registration-request-rejected-list/index.hbs b/app/components/partner/registration-request-rejected-list/index.hbs index 022c00939..0685615a7 100644 --- a/app/components/partner/registration-request-rejected-list/index.hbs +++ b/app/components/partner/registration-request-rejected-list/index.hbs @@ -1,4 +1,4 @@ -
+
{{#if this.partnerRegistrationRequestReponse}} -

{{t 'rejectedRequests'}}

+

{{t 'rejectedRequests'}}

-
{{t 'requested'}} {{t 'by'}}
-
{{t 'company'}}
-
{{t 'requested'}}
-
{{t 'rejected'}}
-
+ + {{t 'requested'}} + {{t 'by'}} + + + + {{t 'company'}} + + + + {{t 'requested'}} + + + + {{t 'rejected'}} + + +
diff --git a/app/components/partner/registration-request-rejected/index.hbs b/app/components/partner/registration-request-rejected/index.hbs index d656b4f27..9079c822c 100644 --- a/app/components/partner/registration-request-rejected/index.hbs +++ b/app/components/partner/registration-request-rejected/index.hbs @@ -1,35 +1,53 @@
-
-
{{@request.email}}
-
{{@request.fullName}}
-
-
{{@request.data.company}}
-
+ + {{@request.email}} + + + + {{@request.fullName}} + + + + + {{@request.data.company}} + + + {{dayjs-from-now @request.createdOn}}
-
+ {{dayjs-from-now @request.createdOn}} + + + {{dayjs-from-now @request.updatedOn}}
-
+ data-test-pending-request-createdon + > + {{dayjs-from-now @request.updatedOn}} + + - + + -
+
\ No newline at end of file diff --git a/app/components/partner/registration-request-rejected/index.scss b/app/components/partner/registration-request-rejected/index.scss index dbe496bb3..3dc9fc98b 100644 --- a/app/components/partner/registration-request-rejected/index.scss +++ b/app/components/partner/registration-request-rejected/index.scss @@ -9,39 +9,7 @@ grid-template-columns: 1fr 30% 10rem 10rem 3.6rem; } } -.user { - padding-right: 1rem; -} -.email { - color: var(--black-700); - font-size: 0.95rem; - font-weight: 600; - line-height: 1.2; - word-break: break-word; - overflow-wrap: break-word; - text-overflow: ellipsis; -} -.name { - word-break: break-word; - overflow-wrap: break-word; - text-overflow: ellipsis; - padding-top: 0.3rem; - font-size: 0.9rem; -} -.company { - word-break: break-word; - overflow-wrap: break-word; - text-overflow: ellipsis; - padding-right: 1rem; - font-size: 0.92rem; -} -.date { - font-style: italic; - font-size: 0.9rem; - padding-right: 0.5rem; -} -.actions { - display: flex; - justify-content: flex-end; - align-items: center; + +.undo-icon { + color: var(--risk-high) !important; } diff --git a/app/templates/authenticated/partner/analytics.hbs b/app/templates/authenticated/partner/analytics.hbs index 75a9880d4..6bde023eb 100644 --- a/app/templates/authenticated/partner/analytics.hbs +++ b/app/templates/authenticated/partner/analytics.hbs @@ -1,14 +1,14 @@ {{page-title 'Analytics'}} -
-
+
+
-
+
diff --git a/app/templates/authenticated/partner/client.hbs b/app/templates/authenticated/partner/client.hbs index f2a17cddf..010aeb851 100644 --- a/app/templates/authenticated/partner/client.hbs +++ b/app/templates/authenticated/partner/client.hbs @@ -2,8 +2,8 @@ -
-
+
+
{{t 'clients'}} / {{#if this.model.client.isEmptyTitle}} @@ -15,12 +15,12 @@
-
+
{{#if this.model.partner.access.view_analytics}} -
+
+
\ No newline at end of file diff --git a/app/templates/authenticated/partner/clients/registration-requests.hbs b/app/templates/authenticated/partner/clients/registration-requests.hbs index 92a7ef8a5..1c56e8844 100644 --- a/app/templates/authenticated/partner/clients/registration-requests.hbs +++ b/app/templates/authenticated/partner/clients/registration-requests.hbs @@ -1,6 +1,6 @@ {{page-title 'Registration Requests'}} -
+
\ No newline at end of file diff --git a/app/templates/authenticated/partner/project.hbs b/app/templates/authenticated/partner/project.hbs index 42660f56e..75e430fea 100644 --- a/app/templates/authenticated/partner/project.hbs +++ b/app/templates/authenticated/partner/project.hbs @@ -2,8 +2,8 @@ -
-
+
+
{{t 'clients'}} / {{this.model.project.id}}
-
+
-
+
` ); assert.equal( - this.element.querySelectorAll(`[data-test-table-header] > div`).length, + this.element.querySelectorAll( + `[data-test-table-header] > [data-test-table-header-item]` + ).length, 3, '3 table header exist' ); diff --git a/tests/integration/components/partner/client-project-list/item-test.js b/tests/integration/components/partner/client-project-list/item-test.js index 34ba811d0..57846a468 100644 --- a/tests/integration/components/partner/client-project-list/item-test.js +++ b/tests/integration/components/partner/client-project-list/item-test.js @@ -70,10 +70,11 @@ module( @clientId={{this.clientId}} @project={{this.project}}/>` ); - assert.dom(`[data-test-view-files]`).exists(); - assert.dom(`[data-test-view-files]`).hasClass('button'); - assert.dom(`[data-test-view-files]`).hasText(`t:viewUploads:()`); - assert.dom(`[data-test-view-files]`).hasTagName('a'); + assert + .dom(`[data-test-view-files]`) + .exists() + .hasText(`t:viewUploads:()`) + .hasTagName('a'); }); test('it should not show view files btn', async function (assert) { diff --git a/tests/integration/components/partner/client-report-download-test.js b/tests/integration/components/partner/client-report-download-test.js index 9890e53e9..e71b35cdd 100644 --- a/tests/integration/components/partner/client-report-download-test.js +++ b/tests/integration/components/partner/client-report-download-test.js @@ -235,7 +235,7 @@ module( .hasClass(styles['button-progress']); assert .dom('[data-test-download-button-generating-progress]') - .hasClass('is-progress') + .hasClass(styles['is-progress']) .hasClass(styles['progress-loader']) .hasAttribute('style', `width: ${report.progress}%`); assert diff --git a/tests/integration/components/partner/client-uploads-list/component-test.js b/tests/integration/components/partner/client-uploads-list/component-test.js index 356e48f9d..1ff671c94 100644 --- a/tests/integration/components/partner/client-uploads-list/component-test.js +++ b/tests/integration/components/partner/client-uploads-list/component-test.js @@ -133,7 +133,9 @@ module( hbs`` ); assert.strictEqual( - this.element.querySelectorAll('[data-test-table-header] > div').length, + this.element.querySelectorAll( + '[data-test-table-header] > [data-test-table-header-item]' + ).length, 3, 'Should have 3 headers by default' ); @@ -322,7 +324,9 @@ module( hbs`` ); assert.strictEqual( - this.element.querySelectorAll('[data-test-table-header] > div').length, + this.element.querySelectorAll( + '[data-test-table-header] > [data-test-table-header-item]' + ).length, 5, 'Should have 5 headers by default' ); @@ -395,7 +399,9 @@ module( hbs`` ); assert.strictEqual( - this.element.querySelectorAll('[data-test-table-header] > div').length, + this.element.querySelectorAll( + '[data-test-table-header] > [data-test-table-header-item]' + ).length, 3, 'Should have 3 headers by default' ); diff --git a/tests/integration/components/partner/credit-transfer/index-test.js b/tests/integration/components/partner/credit-transfer/index-test.js index 015fc027f..ed1bb8a83 100644 --- a/tests/integration/components/partner/credit-transfer/index-test.js +++ b/tests/integration/components/partner/credit-transfer/index-test.js @@ -5,7 +5,6 @@ import { setupIntl } from 'ember-intl/test-support'; import { click, find, render, triggerEvent } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; import { underscore } from '@ember/string'; -import styles from 'irene/components/partner/credit-transfer/index.scss'; function serializer(payload) { const serializedPayload = {}; @@ -174,8 +173,7 @@ module('Integration | Component | partner/credit-transfer', function (hooks) { await render(hbs``); - assert.dom('[data-test-plus-btn]').exists(); - assert.dom('[data-test-plus-btn]').hasClass(styles['disabled-btn']); + assert.dom('[data-test-plus-btn]').exists().isDisabled(); const creditTransferTooltip = find( '[data-test-credit-transfer] [data-test-ak-tooltip-root]' @@ -218,8 +216,7 @@ module('Integration | Component | partner/credit-transfer', function (hooks) { this.set('client', this.server.create('partner/partnerclient')); await render(hbs``); - assert.dom('[data-test-plus-btn]').exists(); - assert.dom('[data-test-plus-btn]').hasClass(styles['disabled-btn']); + assert.dom('[data-test-plus-btn]').exists().isDisabled(); const creditTransferTooltip = find( '[data-test-credit-transfer] [data-test-ak-tooltip-root]' @@ -262,8 +259,8 @@ module('Integration | Component | partner/credit-transfer', function (hooks) { this.set('client', this.server.create('partner/partnerclient')); await render(hbs``); - assert.dom('[data-test-plus-btn]').exists(); - assert.dom('[data-test-plus-btn]').doesNotHaveClass(styles['disabled-btn']); + assert.dom('[data-test-plus-btn]').exists().isNotDisabled(); + assert .dom(`#client-${this.client.id}-tooltip`) .doesNotExist('Tooltip not required for clickable state'); diff --git a/tests/integration/components/partner/invite-client-test.js b/tests/integration/components/partner/invite-client-test.js index acb0b7682..f4ee118c4 100644 --- a/tests/integration/components/partner/invite-client-test.js +++ b/tests/integration/components/partner/invite-client-test.js @@ -1,11 +1,10 @@ -/* eslint-disable prettier/prettier, qunit/no-identical-names */ -import { module, test } from "qunit"; -import { setupRenderingTest } from "ember-qunit"; -import { render, click, fillIn } from "@ember/test-helpers"; -import { setupIntl } from "ember-intl/test-support"; -import { setupMirage } from "ember-cli-mirage/test-support"; -import { hbs } from "ember-cli-htmlbars"; -import Service from "@ember/service"; +import { module, test } from 'qunit'; +import { setupRenderingTest } from 'ember-qunit'; +import { render, click, fillIn } from '@ember/test-helpers'; +import { setupIntl } from 'ember-intl/test-support'; +import { setupMirage } from 'ember-cli-mirage/test-support'; +import { hbs } from 'ember-cli-htmlbars'; +import Service from '@ember/service'; class OrganizationStub extends Service { selected = { @@ -17,32 +16,32 @@ class RealtimeStub extends Service { RegistrationRequestCounter = 0; } -module("Integration | Component | partner/invite-client", function (hooks) { +module('Integration | Component | partner/invite-client', function (hooks) { setupRenderingTest(hooks); setupMirage(hooks); - setupIntl(hooks, "en"); + setupIntl(hooks, 'en'); hooks.beforeEach(function () { - this.owner.register("service:organization", OrganizationStub); - this.owner.register("service:realtime", RealtimeStub); + this.owner.register('service:organization', OrganizationStub); + this.owner.register('service:realtime', RealtimeStub); }); - test("it should render invite button", async function (assert) { + test('it should render invite button', async function (assert) { await render(hbs``); - assert.dom("[data-test-invite-client-button]").exists(); + assert.dom('[data-test-invite-client-button]').exists(); assert - .dom("[data-test-invite-client-button]") - .hasTextContaining("Invite Clients"); + .dom('[data-test-invite-client-button]') + .hasTextContaining('Invite Clients'); }); - test("it should open modal with invite form on invite button click", async function (assert) { - assert.dom("[data-test-invite-client-form]").doesNotExist(); + test('it should open modal with invite form on invite button click', async function (assert) { + assert.dom('[data-test-invite-client-form]').doesNotExist(); await render(hbs``); const inviteBtn = this.element.querySelector( - "[data-test-invite-client-button]" + '[data-test-invite-client-button]' ); await click(inviteBtn); - assert.dom("[data-test-invite-client-form]").exists(); + assert.dom('[data-test-invite-client-form]').exists(); }); test('it should close modal only on close button click', async function (assert) { @@ -58,172 +57,162 @@ module("Integration | Component | partner/invite-client", function (hooks) { await click(overlayElement); assert.dom('[data-test-invite-client-form]').exists(); - const closeButton = this.element.querySelector('[data-test-modal-close-btn]'); + const closeButton = this.element.querySelector( + '[data-test-modal-close-btn]' + ); await click(closeButton); assert.dom('[data-test-invite-client-form]').doesNotExist(); }); - test("it should render email, first name, last name & company input fields", async function (assert) { + test('it should render email, first name, last name & company input fields', async function (assert) { await render(hbs``); const inviteBtn = this.element.querySelector( - "[data-test-invite-client-button]" - ); - await click(inviteBtn); - assert.dom("[data-test-input-email]").exists(); - assert.dom("[data-test-input-firstname]").exists(); - assert.dom("[data-test-input-lastname]").exists(); - assert.dom("[data-test-input-company]").exists(); - }); - - test("it does not render error messages on initial load", async function (assert) { - await render(hbs``); - const inviteBtn = this.element.querySelector( - "[data-test-invite-client-button]" + '[data-test-invite-client-button]' ); await click(inviteBtn); - - assert.dom("[data-test-input-error-email]").doesNotExist(); - assert.dom("[data-test-input-error-name]").doesNotExist(); - assert.dom("[data-test-input-error-company]").doesNotExist(); + assert.dom('[data-test-input-email]').exists(); + assert.dom('[data-test-input-firstname]').exists(); + assert.dom('[data-test-input-lastname]').exists(); + assert.dom('[data-test-input-company]').exists(); }); - test("it does not render error messages on initial load", async function (assert) { + test('it does not render error messages on initial load', async function (assert) { await render(hbs``); const inviteBtn = this.element.querySelector( - "[data-test-invite-client-button]" + '[data-test-invite-client-button]' ); await click(inviteBtn); - assert.dom("[data-test-input-error-email]").doesNotExist(); - assert.dom("[data-test-input-error-name]").doesNotExist(); - assert.dom("[data-test-input-error-company]").doesNotExist(); + assert.dom('[data-test-input-error-email]').doesNotExist(); + assert.dom('[data-test-helper-text]').doesNotExist(); + assert.dom('[data-test-input-error-company]').doesNotExist(); }); - test("it should validate email on input", async function (assert) { + test('it should validate email on input', async function (assert) { await render(hbs``); const inviteBtn = this.element.querySelector( - "[data-test-invite-client-button]" + '[data-test-invite-client-button]' ); await click(inviteBtn); - const emailInput = this.element.querySelector("[data-test-input-email]"); + const emailInput = this.element.querySelector('[data-test-input-email]'); // accept valid email - await fillIn(emailInput, "test@example.com"); - assert.dom("[data-test-input-error-email]").doesNotExist(); + await fillIn(emailInput, 'test@example.com'); + assert.dom('[data-test-helper-text]').doesNotExist(); - await fillIn(emailInput, "t@t.1"); - assert.dom("[data-test-input-error-email]").doesNotExist(); + await fillIn(emailInput, 't@t.1'); + assert.dom('[data-test-helper-text]').doesNotExist(); // reject invalid email formats - await fillIn(emailInput, "test.com@"); - assert.dom("[data-test-input-error-email]").exists(); + await fillIn(emailInput, 'test.com@'); + assert.dom('[data-test-helper-text]').exists(); - await fillIn(emailInput, "🙂@🙂.🙂"); - assert.dom("[data-test-input-error-email]").exists(); + await fillIn(emailInput, '🙂@🙂.🙂'); + assert.dom('[data-test-helper-text]').exists(); await fillIn(emailInput, "'@t.'"); - assert.dom("[data-test-input-error-email]").exists(); + assert.dom('[data-test-helper-text]').exists(); // reject empty email - await fillIn(emailInput, ""); - assert.dom("[data-test-input-error-email]").exists(); + await fillIn(emailInput, ''); + assert.dom('[data-test-helper-text]').exists(); }); - test("it should validate first name on input", async function (assert) { + test('it should validate first name on input', async function (assert) { await render(hbs``); const inviteBtn = this.element.querySelector( - "[data-test-invite-client-button]" + '[data-test-invite-client-button]' ); await click(inviteBtn); const firstNameInput = this.element.querySelector( - "[data-test-input-firstname]" + '[data-test-input-firstname]' ); // accept less than 150 characters - await fillIn(firstNameInput, "f".repeat(150)); - assert.dom("[data-test-input-error-name]").doesNotExist(); + await fillIn(firstNameInput, 'f'.repeat(150)); + assert.dom('[data-test-helper-text]').doesNotExist(); // reject more than 150 characters - await fillIn(firstNameInput, "f".repeat(151)); - assert.dom("[data-test-input-error-name]").exists(); + await fillIn(firstNameInput, 'f'.repeat(151)); + assert.dom('[data-test-helper-text]').exists(); // accept empty input - await fillIn(firstNameInput, ""); - assert.dom("[data-test-input-error-name]").doesNotExist(); + await fillIn(firstNameInput, ''); + assert.dom('[data-test-helper-text]').doesNotExist(); // accept whitespace string - await fillIn(firstNameInput, " "); - assert.dom("[data-test-input-error-name]").doesNotExist(); + await fillIn(firstNameInput, ' '); + assert.dom('[data-test-helper-text]').doesNotExist(); }); - test("it should validate last name on input", async function (assert) { + test('it should validate last name on input', async function (assert) { await render(hbs``); const inviteBtn = this.element.querySelector( - "[data-test-invite-client-button]" + '[data-test-invite-client-button]' ); await click(inviteBtn); const lastNameInput = this.element.querySelector( - "[data-test-input-lastname]" + '[data-test-input-lastname]' ); // accept less than 150 characters - await fillIn(lastNameInput, "l".repeat(150)); - assert.dom("[data-test-input-error-name]").doesNotExist(); + await fillIn(lastNameInput, 'l'.repeat(150)); + assert.dom('[data-test-helper-text]').doesNotExist(); // reject more than 150 characters - await fillIn(lastNameInput, "l".repeat(151)); - assert.dom("[data-test-input-error-name]").exists(); + await fillIn(lastNameInput, 'l'.repeat(151)); + assert.dom('[data-test-helper-text]').exists(); // accept empty input - await fillIn(lastNameInput, ""); - assert.dom("[data-test-input-error-name]").doesNotExist(); + await fillIn(lastNameInput, ''); + assert.dom('[data-test-helper-text]').doesNotExist(); // accept whitespace string - await fillIn(lastNameInput, " "); - assert.dom("[data-test-input-error-name]").doesNotExist(); + await fillIn(lastNameInput, ' '); + assert.dom('[data-test-helper-text]').doesNotExist(); }); - test("it should validate company name on input", async function (assert) { + test('it should validate company name on input', async function (assert) { await render(hbs``); const inviteBtn = this.element.querySelector( - "[data-test-invite-client-button]" + '[data-test-invite-client-button]' ); await click(inviteBtn); const companyInput = this.element.querySelector( - "[data-test-input-company]" + '[data-test-input-company]' ); // accept less than 150 characters - await fillIn(companyInput, "c".repeat(255)); - assert.dom("[data-test-input-error-company]").doesNotExist(); + await fillIn(companyInput, 'c'.repeat(255)); + assert.dom('[data-test-helper-text]').doesNotExist(); // reject more than 150 characters - await fillIn(companyInput, "c".repeat(256)); - assert.dom("[data-test-input-error-company]").exists(); + await fillIn(companyInput, 'c'.repeat(256)); + assert.dom('[data-test-helper-text]').exists(); // reject empty input - await fillIn(companyInput, ""); - assert.dom("[data-test-input-error-company]").exists(); + await fillIn(companyInput, ''); + assert.dom('[data-test-helper-text]').exists(); // accept whitespace string - await fillIn(companyInput, " "); - assert.dom("[data-test-input-error-company]").doesNotExist(); + await fillIn(companyInput, ' '); + assert.dom('[data-test-helper-text]').doesNotExist(); }); - test("it should close modal on valid form submit", async function (assert) { + test('it should close modal on valid form submit', async function (assert) { const rrInvitationSample = this.server.createList( - "partner/registrationRequest", + 'partner/registrationRequest', 1, - { approvalStatus: "approved", source: "invitation" } + { approvalStatus: 'approved', source: 'invitation' } )[0]; this.server.post( - "v2/partners/1/registration_requests", + 'v2/partners/1/registration_requests', (schema, request) => { - const rrSchema = schema["partner/registrationRequests"]; + const rrSchema = schema['partner/registrationRequests']; const body = JSON.parse(request.requestBody); let obj = rrSchema.create({ email: body.email, @@ -239,41 +228,41 @@ module("Integration | Component | partner/invite-client", function (hooks) { await render(hbs``); const inviteBtn = this.element.querySelector( - "[data-test-invite-client-button]" + '[data-test-invite-client-button]' ); await click(inviteBtn); - const emailInput = this.element.querySelector("[data-test-input-email]"); + const emailInput = this.element.querySelector('[data-test-input-email]'); const firstNameInput = this.element.querySelector( - "[data-test-input-firstname]" + '[data-test-input-firstname]' ); const lastNameInput = this.element.querySelector( - "[data-test-input-lastname]" + '[data-test-input-lastname]' ); const companyInput = this.element.querySelector( - "[data-test-input-company]" + '[data-test-input-company]' ); - await fillIn(emailInput, "test@test.test"); - await fillIn(firstNameInput, "TestFirstName"); - await fillIn(lastNameInput, "TestLastName"); - await fillIn(companyInput, "TestCompany"); + await fillIn(emailInput, 'test@test.test'); + await fillIn(firstNameInput, 'TestFirstName'); + await fillIn(lastNameInput, 'TestLastName'); + await fillIn(companyInput, 'TestCompany'); - await click("[data-test-input-send-btn]"); + await click('[data-test-input-send-btn]'); - assert.dom("[data-test-invite-client-form]").doesNotExist(); + assert.dom('[data-test-invite-client-form]').doesNotExist(); }); - test("it should not close modal on form submission with invalid inputs", async function (assert) { + test('it should not close modal on form submission with invalid inputs', async function (assert) { const rrInvitationSample = this.server.createList( - "partner/registrationRequest", + 'partner/registrationRequest', 1, - { approvalStatus: "approved", source: "invitation" } + { approvalStatus: 'approved', source: 'invitation' } )[0]; this.server.post( - "v2/partners/1/registration_requests", + 'v2/partners/1/registration_requests', (schema, request) => { - const rrSchema = schema["partner/registrationRequests"]; + const rrSchema = schema['partner/registrationRequests']; const body = JSON.parse(request.requestBody); let obj = rrSchema.create({ email: body.email, @@ -289,35 +278,41 @@ module("Integration | Component | partner/invite-client", function (hooks) { await render(hbs``); const inviteBtn = this.element.querySelector( - "[data-test-invite-client-button]" + '[data-test-invite-client-button]' ); await click(inviteBtn); - const emailInput = this.element.querySelector("[data-test-input-email]"); + const emailInput = this.element.querySelector('[data-test-input-email]'); const companyInput = this.element.querySelector( - "[data-test-input-company]" + '[data-test-input-company]' ); - await fillIn(emailInput, ""); - await fillIn(companyInput, ""); + await fillIn(emailInput, ''); + await fillIn(companyInput, ''); + + await click('[data-test-input-send-btn]'); - await click("[data-test-input-send-btn]"); + assert.dom('[data-test-invite-client-form]').exists(); - assert.dom("[data-test-invite-client-form]").exists(); - assert.dom("[data-test-input-error-email]").exists(); - assert.dom("[data-test-input-error-company]").exists(); + assert + .dom('[data-test-input-email-container] [data-test-helper-text]') + .exists(); + + assert + .dom('[data-test-input-company-container] [data-test-helper-text]') + .exists(); }); - test("it should submit form with email & company but without first & last names", async function (assert) { + test('it should submit form with email & company but without first & last names', async function (assert) { const rrInvitationSample = this.server.createList( - "partner/registrationRequest", + 'partner/registrationRequest', 1, - { approvalStatus: "approved", source: "invitation" } + { approvalStatus: 'approved', source: 'invitation' } )[0]; this.server.post( - "v2/partners/1/registration_requests", + 'v2/partners/1/registration_requests', (schema, request) => { - const rrSchema = schema["partner/registrationRequests"]; + const rrSchema = schema['partner/registrationRequests']; const body = JSON.parse(request.requestBody); let obj = rrSchema.create({ email: body.email, @@ -333,62 +328,62 @@ module("Integration | Component | partner/invite-client", function (hooks) { await render(hbs``); const inviteBtn = this.element.querySelector( - "[data-test-invite-client-button]" + '[data-test-invite-client-button]' ); await click(inviteBtn); - const emailInput = this.element.querySelector("[data-test-input-email]"); + const emailInput = this.element.querySelector('[data-test-input-email]'); const firstNameInput = this.element.querySelector( - "[data-test-input-firstname]" + '[data-test-input-firstname]' ); const lastNameInput = this.element.querySelector( - "[data-test-input-lastname]" + '[data-test-input-lastname]' ); const companyInput = this.element.querySelector( - "[data-test-input-company]" + '[data-test-input-company]' ); - await fillIn(emailInput, "test@test.test"); - await fillIn(firstNameInput, ""); - await fillIn(lastNameInput, ""); - await fillIn(companyInput, "TestCompany"); + await fillIn(emailInput, 'test@test.test'); + await fillIn(firstNameInput, ''); + await fillIn(lastNameInput, ''); + await fillIn(companyInput, 'TestCompany'); - await click("[data-test-input-send-btn]"); + await click('[data-test-input-send-btn]'); - assert.dom("[data-test-invite-client-form]").doesNotExist(); + assert.dom('[data-test-invite-client-form]').doesNotExist(); }); - test("it should render api response field errors in respective inputs", async function (assert) { + test('it should render api response field errors in respective inputs', async function (assert) { this.server.post( - "v2/partners/1/registration_requests", + 'v2/partners/1/registration_requests', { - email: ["A user with this email has been already invited."], + email: ['A user with this email has been already invited.'], }, 400 ); await render(hbs``); const inviteBtn = this.element.querySelector( - "[data-test-invite-client-button]" + '[data-test-invite-client-button]' ); await click(inviteBtn); - assert.dom("[data-test-invite-client-form]").exists(); + assert.dom('[data-test-invite-client-form]').exists(); - const emailInput = this.element.querySelector("[data-test-input-email]"); + const emailInput = this.element.querySelector('[data-test-input-email]'); const companyInput = this.element.querySelector( - "[data-test-input-company]" + '[data-test-input-company]' ); - await fillIn(emailInput, "test@test.test"); - await fillIn(companyInput, "Test"); - await click("[data-test-input-send-btn]"); + await fillIn(emailInput, 'test@test.test'); + await fillIn(companyInput, 'Test'); + await click('[data-test-input-send-btn]'); - assert.dom("[data-test-invite-client-form]").exists(); + assert.dom('[data-test-invite-client-form]').exists(); - assert.dom("[data-test-input-error-email]").exists(); assert - .dom("[data-test-input-error-email]") - .hasText("A user with this email has been already invited."); + .dom('[data-test-input-email-container] [data-test-helper-text]') + .exists() + .hasText('A user with this email has been already invited.'); }); }); diff --git a/tests/integration/components/partner/registration-request-pending-list-test.js b/tests/integration/components/partner/registration-request-pending-list-test.js index 5f36e79d2..5c60cac9f 100644 --- a/tests/integration/components/partner/registration-request-pending-list-test.js +++ b/tests/integration/components/partner/registration-request-pending-list-test.js @@ -131,10 +131,11 @@ module( '[data-test-pending-requests-table-header]' ); - assert.equal(header.children[0].textContent, 'Requested by'); - assert.equal(header.children[1].textContent, 'Company'); - assert.equal(header.children[2].textContent, 'Requested'); - assert.equal(header.children[3].textContent, ''); + assert.true(header.children[0].textContent.trim().includes('Requested')); + assert.true(header.children[0].textContent.trim().includes('by')); + assert.strictEqual(header.children[1].textContent.trim(), 'Company'); + assert.strictEqual(header.children[2].textContent.trim(), 'Requested'); + assert.strictEqual(header.children[3].textContent.trim(), ''); }); test('it does not render table header for empty state', async function (assert) { @@ -181,7 +182,7 @@ module( '[data-test-pending-request-row]' ); - assert.equal(rows.length, 5); + assert.strictEqual(rows.length, 5); assert.dom('[data-test-pending-requests-empty]').doesNotExist(); assert.dom('[data-test-pending-requests-list]').exists(); }); diff --git a/tests/integration/components/partner/registration-request-pending-test.js b/tests/integration/components/partner/registration-request-pending-test.js index 4a9d557e7..b2993e89f 100644 --- a/tests/integration/components/partner/registration-request-pending-test.js +++ b/tests/integration/components/partner/registration-request-pending-test.js @@ -252,18 +252,11 @@ module( await render( hbs`` ); - assert.dom('[data-test-pending-request-approve-button]').exists(); - const btn = this.element.querySelector( - '[data-test-pending-request-approve-button]' - ); - assert - .dom('[data-test-pending-request-approve-button]') - .hasClass('is-success'); assert .dom('[data-test-pending-request-approve-button]') - .hasAttribute('title'); - assert.equal(btn.title, 'Send invitation'); + .exists() + .hasAttribute('title', 'Send invitation'); }); test('it renders reject button as primary btn with title reject request', async function (assert) { @@ -284,18 +277,11 @@ module( await render( hbs`` ); - assert.dom('[data-test-pending-request-reject-button]').exists(); - const btn = this.element.querySelector( - '[data-test-pending-request-reject-button]' - ); - assert - .dom('[data-test-pending-request-reject-button]') - .hasClass('is-primary'); assert .dom('[data-test-pending-request-reject-button]') - .hasAttribute('title'); - assert.equal(btn.title, 'Reject request'); + .exists() + .hasAttribute('title', 'Reject request'); }); } );