remove feature toggle + add libraryPaneldefinition
This commit is contained in:
@@ -133,10 +133,6 @@ Family: scuemata.#Family & {
|
||||
|
||||
// The values depend on panel type
|
||||
options: {...}
|
||||
libraryPanel?: {
|
||||
name: string,
|
||||
uid: string
|
||||
}
|
||||
fieldConfig: {
|
||||
defaults: {
|
||||
...
|
||||
|
||||
@@ -52,11 +52,9 @@ func (hs *HTTPServer) TrimDashboard(c *models.ReqContext, cmd models.TrimDashboa
|
||||
meta := cmd.Meta
|
||||
|
||||
trimedResult := *dash
|
||||
if !hs.LoadSchemaService.IsDisabled() {
|
||||
trimedResult, err = hs.LoadSchemaService.DashboardTrimDefaults(*dash)
|
||||
if err != nil {
|
||||
return response.Error(500, "Error while trim default value from dashboard json", err)
|
||||
}
|
||||
trimedResult, err = hs.LoadSchemaService.DashboardTrimDefaults(*dash)
|
||||
if err != nil {
|
||||
return response.Error(500, "Error while trim default value from dashboard json", err)
|
||||
}
|
||||
|
||||
dto := dtos.TrimDashboardFullWithMeta{
|
||||
|
||||
+1
-1
@@ -213,7 +213,7 @@ func (hs *HTTPServer) ImportDashboard(c *models.ReqContext, apiCmd dtos.ImportDa
|
||||
}
|
||||
|
||||
trimDefaults := c.QueryBoolWithDefault("trimdefaults", true)
|
||||
if trimDefaults && !hs.LoadSchemaService.IsDisabled() {
|
||||
if trimDefaults {
|
||||
apiCmd.Dashboard, err = hs.LoadSchemaService.DashboardApplyDefaults(apiCmd.Dashboard)
|
||||
if err != nil {
|
||||
return response.Error(500, "Error while applying default value to the dashboard json", err)
|
||||
|
||||
@@ -50,12 +50,6 @@ func (rs *SchemaLoaderService) Init() error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (rs *SchemaLoaderService) IsDisabled() bool {
|
||||
if rs.Cfg == nil {
|
||||
return true
|
||||
}
|
||||
return !rs.Cfg.IsTrimDefaultsEnabled()
|
||||
}
|
||||
|
||||
func (rs *SchemaLoaderService) DashboardApplyDefaults(input *simplejson.Json) (*simplejson.Json, error) {
|
||||
val, _ := input.Map()
|
||||
|
||||
@@ -390,11 +390,6 @@ func (cfg Cfg) IsNgAlertEnabled() bool {
|
||||
return cfg.FeatureToggles["ngalert"]
|
||||
}
|
||||
|
||||
// IsTrimDefaultsEnabled returns whether the standalone trim dashboard default feature is enabled.
|
||||
func (cfg Cfg) IsTrimDefaultsEnabled() bool {
|
||||
return cfg.FeatureToggles["trimDefaults"]
|
||||
}
|
||||
|
||||
// IsDatabaseMetricsEnabled returns whether the database instrumentation feature is enabled.
|
||||
func (cfg Cfg) IsDatabaseMetricsEnabled() bool {
|
||||
return cfg.FeatureToggles["database_metrics"]
|
||||
|
||||
@@ -7,7 +7,6 @@ import { DashboardExporter } from 'app/features/dashboard/components/DashExportM
|
||||
import { appEvents } from 'app/core/core';
|
||||
import { ShowModalReactEvent } from 'app/types/events';
|
||||
import { ViewJsonModal } from './ViewJsonModal';
|
||||
import { config } from '@grafana/runtime';
|
||||
|
||||
interface Props {
|
||||
dashboard: DashboardModel;
|
||||
@@ -138,11 +137,9 @@ export class ShareExport extends PureComponent<Props, State> {
|
||||
<Field label="Export for sharing externally">
|
||||
<Switch value={shareExternally} onChange={this.onShareExternallyChange} />
|
||||
</Field>
|
||||
{config.featureToggles.trimDefaults && (
|
||||
<Field label="Export with trimed dashboard json">
|
||||
<Switch value={trimDefaults} onChange={this.onTrimDefaultsChange} />
|
||||
</Field>
|
||||
)}
|
||||
<Field label="Export with trimed dashboard json">
|
||||
<Switch value={trimDefaults} onChange={this.onTrimDefaultsChange} />
|
||||
</Field>
|
||||
<Modal.ButtonRow>
|
||||
<Button variant="secondary" onClick={onDismiss} fill="outline">
|
||||
Cancel
|
||||
|
||||
Reference in New Issue
Block a user