diff --git a/eslint.config.js b/eslint.config.js index 2fd159f0fcf..ece56c24c9d 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -132,6 +132,7 @@ module.exports = [ 'no-redeclare': 'off', '@typescript-eslint/no-redeclare': ['error'], 'unicorn/no-empty-file': 'error', + 'no-constant-condition': 'error', }, }, { diff --git a/public/app/features/browse-dashboards/api/browseDashboardsAPI.ts b/public/app/features/browse-dashboards/api/browseDashboardsAPI.ts index 89749f285d5..addc640cef9 100644 --- a/public/app/features/browse-dashboards/api/browseDashboardsAPI.ts +++ b/public/app/features/browse-dashboards/api/browseDashboardsAPI.ts @@ -289,29 +289,11 @@ export const browseDashboardsAPI = createApi({ // Delete all the dashboards sequentially // TODO error handling here for (const dashboardUID of selectedDashboards) { - const response = await getDashboardAPI().deleteDashboard(dashboardUID, true); + await getDashboardAPI().deleteDashboard(dashboardUID, true); // handling success alerts for these feature toggles // for legacy response, the success alert will be triggered by showSuccessAlert function in public/app/core/services/backend_srv.ts - if (false) { - // TODO: change this to a feature flag when dashboard restore is reworked - const name = response?.title; - - if (name) { - const payload = config.featureToggles.kubernetesDashboards - ? ['Dashboard moved to Recently deleted'] - : [ - t('browse-dashboards.soft-delete.success', 'Dashboard {{name}} moved to Recently deleted', { - name, - }), - ]; - - appEvents.publish({ - type: AppEvents.alertSuccess.name, - payload, - }); - } - } else if (config.featureToggles.kubernetesDashboards) { + if (config.featureToggles.kubernetesDashboards) { appEvents.publish({ type: AppEvents.alertSuccess.name, payload: ['Dashboard deleted'], diff --git a/public/app/plugins/datasource/grafana-testdata-datasource/runStreams.ts b/public/app/plugins/datasource/grafana-testdata-datasource/runStreams.ts index 26a6af2449b..3d769e7b7f9 100644 --- a/public/app/plugins/datasource/grafana-testdata-datasource/runStreams.ts +++ b/public/app/plugins/datasource/grafana-testdata-datasource/runStreams.ts @@ -104,12 +104,10 @@ export function runSignalStream( }; // Fill the buffer on init - if (true) { - let time = Date.now() - maxDataPoints * speed; - for (let i = 0; i < maxDataPoints; i++) { - addNextRow(time); - time += speed; - } + let time = Date.now() - maxDataPoints * speed; + for (let i = 0; i < maxDataPoints; i++) { + addNextRow(time); + time += speed; } const pushNextEvent = () => { diff --git a/public/app/plugins/panel/geomap/layers/data/dayNightLayer.tsx b/public/app/plugins/panel/geomap/layers/data/dayNightLayer.tsx index dff87ea84bc..346c922900c 100644 --- a/public/app/plugins/panel/geomap/layers/data/dayNightLayer.tsx +++ b/public/app/plugins/panel/geomap/layers/data/dayNightLayer.tsx @@ -1,7 +1,5 @@ import Feature from 'ol/Feature'; import Map from 'ol/Map'; -import { Coordinate } from 'ol/coordinate'; -import { MultiLineString } from 'ol/geom'; import Point from 'ol/geom/Point'; import { Group as LayerGroup } from 'ol/layer'; import VectorImage from 'ol/layer/VectorImage'; @@ -16,9 +14,7 @@ import { MapLayerOptions, PanelData, GrafanaTheme2, - EventBus, - DataHoverEvent, - DataHoverClearEvent, + EventBus } from '@grafana/data'; export enum ShowTime { @@ -74,8 +70,6 @@ export const dayNightLayer: MapLayerRegistryItem = { // DayNight source const source = new DayNight({}); const sourceMethods = Object.getPrototypeOf(source); - const sourceLine = new DayNight({}); - const sourceLineMethods = Object.getPrototypeOf(sourceLine); // Night polygon const vectorLayer = new VectorImage({ @@ -160,44 +154,6 @@ export const dayNightLayer: MapLayerRegistryItem = { // Crosshair sharing subscriptions const subscriptions = new Subscription(); - if (false) { - subscriptions.add( - eventBus.subscribe(DataHoverEvent, (event) => { - const time = event.payload?.point?.time; - if (time) { - const lineTime = new Date(time); - const nightLinePoints = sourceLine.getCoordinates(lineTime.toString(), 'line'); - nightLineLayer.getSource()?.clear(); - const lineStringArray: Coordinate[][] = []; - for (let l = 0; l < nightLinePoints.length - 1; l++) { - const x1: number = Object.values(nightLinePoints[l])[0]; - const y1: number = Object.values(nightLinePoints[l])[1]; - const x2: number = Object.values(nightLinePoints[l + 1])[0]; - const y2: number = Object.values(nightLinePoints[l + 1])[1]; - const lineString = [fromLonLat([x1, y1]), fromLonLat([x2, y2])]; - lineStringArray.push(lineString); - } - nightLineLayer.getSource()?.addFeature( - new Feature({ - geometry: new MultiLineString(lineStringArray), - }) - ); - - let sunLinePos: number[] = []; - sunLinePos = sourceLineMethods.getSunPosition(lineTime); - sunLineFeature.getGeometry()?.setCoordinates(fromLonLat(sunLinePos)); - sunLineFeature.setStyle([sunLineStyle, sunLineStyleDash]); - } - }) - ); - - subscriptions.add( - eventBus.subscribe(DataHoverClearEvent, (event) => { - nightLineLayer.getSource()?.clear(); - sunLineFeature.setStyle(new Style({})); - }) - ); - } return { init: () => layer, diff --git a/public/app/plugins/panel/geomap/layers/data/geojsonDynamic.ts b/public/app/plugins/panel/geomap/layers/data/geojsonDynamic.ts index 924a732707d..19ee2480669 100644 --- a/public/app/plugins/panel/geomap/layers/data/geojsonDynamic.ts +++ b/public/app/plugins/panel/geomap/layers/data/geojsonDynamic.ts @@ -108,12 +108,12 @@ export const dynamicGeoJSONLayer: MapLayerRegistryItem(); diff --git a/public/app/plugins/panel/geomap/layers/data/geojsonLayer.ts b/public/app/plugins/panel/geomap/layers/data/geojsonLayer.ts index de1bc24eb4e..176126f4183 100644 --- a/public/app/plugins/panel/geomap/layers/data/geojsonLayer.ts +++ b/public/app/plugins/panel/geomap/layers/data/geojsonLayer.ts @@ -102,12 +102,11 @@ export const geojsonLayer: MapLayerRegistryItem = { } } } - if (true) { - const s = await getStyleConfigState(config.style); - styles.push({ - state: s, - }); - } + + const s = await getStyleConfigState(config.style); + styles.push({ + state: s, + }); const polyStyleStrings: string[] = Object.values(GeoJSONPolyStyles); const pointStyleStrings: string[] = Object.values(GeoJSONPointStyles); diff --git a/public/locales/en-US/grafana.json b/public/locales/en-US/grafana.json index a975f9585ed..5f5704eb8a8 100644 --- a/public/locales/en-US/grafana.json +++ b/public/locales/en-US/grafana.json @@ -2680,9 +2680,6 @@ "clear": "Clear search and filters", "text": "No results found for your query" }, - "soft-delete": { - "success": "Dashboard {{name}} moved to Recently deleted" - }, "text-this-repository-is-read-only": "If you have direct access to the target, copy the JSON and paste it there." }, "canvas": {