-
Notifications
You must be signed in to change notification settings - Fork 12
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(SFINT-4388) no results text when no user actions #106
Changes from 5 commits
ad07fac
ae4de42
818b1c2
1964661
a9566b1
af63448
2fb3950
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,7 +1,13 @@ | ||||||
import { Translation, Language } from '../../utils/translation'; | ||||||
|
||||||
Translation.register(Language.English, { | ||||||
UserActions_no_actions: 'No actions available for this user', | ||||||
UserActions: 'User Actions', | ||||||
UserActions_no_actions_title: 'No actions available for this user', | ||||||
UserActions_no_actions_causes_title: 'Potential causes', | ||||||
UserActions_no_actions_cause_not_enabled: 'User actions are not enabled for your organization', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
UserActions_no_actions_cause_not_associated: 'There are no user actions associated with the user', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
UserActions_no_actions_cause_case_too_old: 'The case is too old to detect related actions', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
UserActions_no_actions_contact_admin: 'Contact your administrator for help', | ||||||
Comment on lines
+4
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @acarpentier01 These are the strings. you can check on the screenshots where they are used. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
UserActions_enable_prompt: 'The User Action feature is not activated for your organization.\nTo activate it, contact Coveo Support.', | ||||||
|
||||||
QueryList_more: 'Show More', | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -175,7 +175,6 @@ export class UserActions extends Component { | |
this.element.dispatchEvent(new CustomEvent(UserActions.Events.Show)); | ||
this.bindings.usageAnalytics.logCustomEvent(UserActionEvents.open, {}, this.element); | ||
this.root.classList.add(UserActions.USER_ACTION_OPENED); | ||
|
||
try { | ||
const userActions = await (get(this.root, UserProfileModel) as UserProfileModel).getActions(this.options.userId); | ||
if (userActions.length > 0) { | ||
|
@@ -316,21 +315,38 @@ export class UserActions extends Component { | |
} | ||
|
||
private renderNoActions() { | ||
const element = document.createElement('div'); | ||
element.classList.add('coveo-no-actions'); | ||
element.innerText = l(`${UserActions.ID}_no_actions`); | ||
const messageContainer = document.createElement('div'); | ||
messageContainer.classList.add('coveo-no-actions'); | ||
messageContainer.innerHTML = ` | ||
<div class="coveo-user-actions-title">${l(UserActions.ID)}</div> | ||
<div>${l(UserActions.ID + '_no_actions_title')}.</div> | ||
<br/> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of adding There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wrote a comment but it disappeared :( Basically the thing we are displaying I consider more as a 1 paragraph than multiple HTML elements. What do you think? It felt more like a line break, than a margin between elements. |
||
<div>${l(UserActions.ID + '_no_actions_causes_title')} | ||
<ul class="coveo-no-actions-causes"> | ||
<li>${l(UserActions.ID + '_no_actions_cause_not_associated')}</li> | ||
<li>${l(UserActions.ID + '_no_actions_cause_case_too_old')}</li> | ||
</ul> | ||
</div> | ||
<br/> | ||
<div>${l(UserActions.ID + '_no_actions_contact_admin')}.</div> | ||
`; | ||
|
||
this.element.innerHTML = ''; | ||
this.element.appendChild(element); | ||
this.element.appendChild(messageContainer); | ||
} | ||
|
||
private renderEnablePrompt() { | ||
const element = document.createElement('div'); | ||
element.classList.add('coveo-enable-prompt'); | ||
element.innerText = l(`${UserActions.ID}_enable_prompt`); | ||
const messageContainer = document.createElement('div'); | ||
messageContainer.classList.add('coveo-no-actions'); | ||
messageContainer.innerHTML = ` | ||
<div class="coveo-user-actions-title">${l(UserActions.ID)}</div> | ||
<div>${l(UserActions.ID + '_no_actions_cause_not_enabled')}.</div> | ||
<br/> | ||
<div>${l(UserActions.ID + '_no_actions_contact_admin')}.</div> | ||
`; | ||
|
||
this.element.innerHTML = ''; | ||
this.element.appendChild(element); | ||
this.element.appendChild(messageContainer); | ||
} | ||
|
||
private showViewedByCustomer() { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should've specified :D the
.
is added but elsewhere hehe thanks for confirming I need a.
though!