Skip to content
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

Add JSON editor #1

Closed
wants to merge 6 commits into from
Closed

Add JSON editor #1

wants to merge 6 commits into from

Conversation

andig
Copy link
Collaborator

@andig andig commented Aug 14, 2018

Add json editor control

@simPod
Copy link
Owner

simPod commented Aug 14, 2018

So we are gonna do that in this repo I guess :) I'll put my work into master so we can continue on top of that.

Copy link
Owner

@simPod simPod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you rebase on simPod:master?

@@ -30,6 +30,13 @@ export class GenericDatasource {
query.adhocFilters = [];
}

// strip empty json
query.targets = _.map(query.targets, d => {
if (d.data.trim() == "") {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's use ===


// special handling when in table panel
if (!this.target.format) {
this.target.format = this.panelCtrl.panel.type === 'table' ? 'table' : 'timeseries';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have changed it to time_series according to grafana/simple-json-datasource#103 (comment)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If ok I've prefer timeseries for readability. With the mysql source its only internal while with JSON its actually being sent to the data source.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So shall we use timeseries then?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes :)

this.target.format = this.panelCtrl.panel.type === 'table' ? 'table' : 'timeseries';
}

this.formats = [{ text: 'Time series', value: 'timeseries' }, { text: 'Table', value: 'table' }];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the same

}

getOptions(query) {
return this.datasource.metricFindQuery(query || '');
}

// not used
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if not used, can we toss it away?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't want to do that since its still in upstream? If remove then we can also scrap the part in the query editor.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, let's skip this for now.

@andig
Copy link
Collaborator Author

andig commented Aug 14, 2018

Pleas don't. IMHO master should stay at upstream level- rather create a new next branch from master and target that. I've sent you a mail ;)

@simPod
Copy link
Owner

simPod commented Aug 14, 2018

@andig very well, next branch is up

@andig andig changed the base branch from pass-additional-json-data to next August 14, 2018 08:11
@andig andig mentioned this pull request Aug 14, 2018
@andig
Copy link
Collaborator Author

andig commented Aug 14, 2018

Replaced by #2

@andig andig closed this Aug 14, 2018
@andig andig deleted the json-edit branch August 14, 2018 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants