Skip to content

Commit

Permalink
fix: Dashboard UI fix (openobserve#4514)
Browse files Browse the repository at this point in the history
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Enhanced loading state visibility for dashboard components, improving
user experience during data fetching.
- Updated conditional rendering for dashboard elements to better reflect
the presence of breakdown fields.

- **Bug Fixes**
- Corrected a tooltip text for improved clarity and grammatical
accuracy.

- **Style**
- Improved layout and styling consistency across dashboard components,
including class-based notifications and enhanced CSS properties.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
ktx-vaidehi authored Sep 10, 2024
1 parent f31f09a commit 6f7d025
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 31 deletions.
2 changes: 1 addition & 1 deletion web/src/components/dashboards/PanelContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
>
<q-tooltip anchor="bottom right" self="top right">
<div style="white-space: pre-wrap">
The data shown is cached and is differed from the selected time
The data shown is cached and is different from the selected time
range.
</div>
</q-tooltip>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -494,9 +494,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<div
class="text-caption text-weight-bold text-center q-py-xs"
v-if="
dashboardPanelData.data.queries[
!dashboardPanelData.data.queries[
dashboardPanelData.layout.currentQueryIndex
].fields?.breakdown?.length < 1
].fields?.breakdown?.length
"
style="
width: 100%;
Expand Down
14 changes: 7 additions & 7 deletions web/src/views/Dashboards/ViewDashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
size="sm"
v-model="selectedDate"
:initialTimezone="initialTimezone"
:disable="!disable"
:disable="arePanelsLoading"
/>
<AutoRefreshInterval
v-model="refreshInterval"
Expand All @@ -99,7 +99,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
size="sm"
/>
<q-btn
v-if="config.isEnterprise == 'true' && !disable"
v-if="config.isEnterprise == 'true' && arePanelsLoading"
outline
class="dashboard-icons q-px-sm q-ml-sm hideOnPrintMode"
size="sm"
Expand All @@ -119,7 +119,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
no-caps
icon="refresh"
@click="refreshData"
:disable="!disable"
:disable="arePanelsLoading"
data-test="dashboard-refresh-btn"
>
<q-tooltip>{{ t("dashboard.refresh") }}</q-tooltip>
Expand Down Expand Up @@ -522,10 +522,10 @@ export default defineComponent({

// [START] cancel running queries

const disable = ref(false);
const arePanelsLoading = ref(false);

const handleEmittedData = (panelsValues) => {
disable.value = panelsValues;
const handleEmittedData = (allPanelsLoaded) => {
arePanelsLoading.value = !allPanelsLoaded;
};

const { traceIdRef, searchRequestTraceIds, cancelQuery } = useCancelQuery();
Expand Down Expand Up @@ -882,7 +882,7 @@ export default defineComponent({
tabId,
outlinedDescription,
searchRequestTraceIds,
disable,
arePanelsLoading,
cancelQuery,
traceIdRef,
searchRequestTraceIds,
Expand Down
40 changes: 21 additions & 19 deletions web/src/views/Dashboards/addPanel/AddPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -206,28 +206,29 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

<div
v-if="isOutDated"
:style="{
borderColor: '#c3920d',
borderWidth: '1px',
borderStyle: 'solid',
backgroundColor:
store.state.theme == 'dark' ? '#2a1f03' : '#faf2da',
padding: '1%',
margin: '1%',
borderRadius: '5px',
}"
class="tw-p-2"
>
<div style="font-weight: 700">
Your chart is not up to date
</div>
<div>
Chart Configuration / Variables has been updated, but
the chart was not updated automatically. Click on the
"Apply" button to run the query again
<div
:style="{
borderColor: '#c3920d',
borderWidth: '1px',
borderStyle: 'solid',
backgroundColor:
store.state.theme == 'dark' ? '#2a1f03' : '#faf2da',
padding: '1%',
borderRadius: '5px',
}"
>
<div style="font-weight: 700">
Your chart is not up to date
</div>
<div>
Chart Configuration / Variables has been updated, but
the chart was not updated automatically. Click on the
"Apply" button to run the query again
</div>
</div>
</div>

<div class="col" style="flex: 1">
<div class="tw-flex tw-justify-end tw-mr-2">
<span v-if="lastTriggeredAt" class="lastRefreshedAt">
<span class="lastRefreshedAtIcon">🕑</span
Expand All @@ -237,6 +238,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/>
</span>
</div>
<div class="col" style="flex: 1">
<PanelSchemaRenderer
v-if="chartData"
@metadata-update="metaDataValue"
Expand Down
10 changes: 8 additions & 2 deletions web/src/views/Dashboards/addPanel/DashboardFiltersOption.vue
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,17 @@ export default defineComponent({
<style lang="scss" scoped>
.layout-name {
font-size: 14px;
margin-top: 10px;
white-space: nowrap;
min-width: 130px;
display: flex;
align-items: center;
}
.layout-separator {
padding: 0 10px;
display: flex;
align-items: center;
margin-left: 2px;
margin-right: 2px;
}
.axis-container {
Expand Down

0 comments on commit 6f7d025

Please sign in to comment.