FIX: do not display empty state while fetching bot conversations (#1320)
* FIX: do not display empty state while fetching bot conversations * skip test in playwright and fix implementation * tiny css fix, missing padding
This commit is contained in:
parent
f1b7cc8f7a
commit
d62c76d1e8
|
@ -93,8 +93,9 @@ export default {
|
||||||
@tracked loadedSevenDayLabel = false;
|
@tracked loadedSevenDayLabel = false;
|
||||||
@tracked loadedThirtyDayLabel = false;
|
@tracked loadedThirtyDayLabel = false;
|
||||||
@tracked loadedMonthLabels = new Set();
|
@tracked loadedMonthLabels = new Set();
|
||||||
page = 0;
|
@tracked isLoading = true;
|
||||||
isFetching = false;
|
isFetching = false;
|
||||||
|
page = 0;
|
||||||
totalTopicsCount = 0;
|
totalTopicsCount = 0;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -123,8 +124,10 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
get emptyStateComponent() {
|
get emptyStateComponent() {
|
||||||
|
if (!this.isLoading) {
|
||||||
return AiBotSidebarEmptyState;
|
return AiBotSidebarEmptyState;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
get text() {
|
get text() {
|
||||||
return i18n(
|
return i18n(
|
||||||
|
@ -214,6 +217,8 @@ export default {
|
||||||
this.attachScrollListener();
|
this.attachScrollListener();
|
||||||
} catch {
|
} catch {
|
||||||
this.isFetching = false;
|
this.isFetching = false;
|
||||||
|
} finally {
|
||||||
|
this.isLoading = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -389,6 +389,10 @@ body.has-ai-conversations-sidebar {
|
||||||
color: var(--primary-high);
|
color: var(--primary-high);
|
||||||
font-size: var(--font-down-2);
|
font-size: var(--font-down-2);
|
||||||
|
|
||||||
|
&__progress {
|
||||||
|
margin-left: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
&:hover,
|
&:hover,
|
||||||
&:focus-visible {
|
&:focus-visible {
|
||||||
.d-icon {
|
.d-icon {
|
||||||
|
|
|
@ -137,15 +137,17 @@ RSpec.describe "AI Bot - Homepage", type: :system do
|
||||||
expect(page).to have_no_css(".ai-bot-upload")
|
expect(page).to have_no_css(".ai-bot-upload")
|
||||||
end
|
end
|
||||||
|
|
||||||
xit "allows removing an upload before submission" do
|
it "allows removing an upload before submission" do
|
||||||
|
skip "TODO: fix this test for playwright"
|
||||||
|
|
||||||
ai_pm_homepage.visit
|
ai_pm_homepage.visit
|
||||||
expect(ai_pm_homepage).to have_homepage
|
expect(ai_pm_homepage).to have_homepage
|
||||||
|
|
||||||
file_path = file_from_fixtures("logo.png", "images").path
|
file_path = file_from_fixtures("logo.png", "images").path
|
||||||
attach_file([file_path]) { find(".ai-bot-upload-btn", visible: true).click }
|
attach_file([file_path]) { find(".ai-bot-upload-btn", visible: true).click }
|
||||||
|
|
||||||
expect(page).to have_css(".ai-bot-upload", count: 1)
|
expect(page).to have_css(".ai-bot-upload", count: 1)
|
||||||
|
|
||||||
|
# TODO: for some reason this line fails in playwright
|
||||||
find(".ai-bot-upload__remove").click
|
find(".ai-bot-upload__remove").click
|
||||||
|
|
||||||
expect(page).to have_no_css(".ai-bot-upload")
|
expect(page).to have_no_css(".ai-bot-upload")
|
||||||
|
|
Loading…
Reference in New Issue