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 single button for export all panels #56

Merged
merged 2 commits into from
Oct 2, 2020
Merged

Conversation

sblrok
Copy link
Contributor

@sblrok sblrok commented Oct 2, 2020

Added button for export all from export panel #42
When you click the "Export all" button a task is created for each exported panel

Changes
Send many panels to the exporter, instead of one, as it was before
Small types refactoring
image

src/module.ts Show resolved Hide resolved
src/module.ts Outdated
const exportTable = _.keyBy(exportPanels, 'datasource');
datasources = (datasources as {name: string}[])
.reduce((result, item) => {
if (exportTable[item.name]) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (exportTable[item.name]) {
if(exportTable[item.name]) {

also, it's inside the reduce callback so I guess you'd want to move it 2 spaces righter

src/module.ts Outdated
datasources = await this.backendSrv.get(`/api/datasources`) ;

const exportTable = _.keyBy(exportPanels, 'datasource');
datasources = (datasources as {name: string}[])
Copy link
Member

Choose a reason for hiding this comment

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

is datasources object or array? because a couple of lines ago you initialize it with {}

@@ -48,5 +48,13 @@
</tr>
</tbody>
</table>
<button class="btn gf-form-btn btn-primary"
id="export-button"
ng-if="!!ctrl.panels.length"
Copy link
Member

Choose a reason for hiding this comment

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

ctrl.panels.length > 0 looks more intuitive, but maybe it's just for me

@rozetko rozetko merged commit db41422 into master Oct 2, 2020
@rozetko rozetko deleted the single-export-button-#42 branch October 2, 2020 11:45
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