Skip to content

Commit

Permalink
Update R-based visuals templates (#503)
Browse files Browse the repository at this point in the history
* Updated settings in R-visuals to work properly

* Updated changelog and packages
  • Loading branch information
AleksSavelev authored Jan 22, 2024
1 parent 07246ff commit 4ead063
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 16 deletions.
3 changes: 3 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

This page contains information about changes to the PowerBI Visual Tools (pbiviz).

## 5.4.1
* Updated R-based visuals settings.ts file to work properly with the new API

## 5.4.0
* Updated packages
* New command `pbiviz lint` to run lint check from tools. It'll use eslintrc file from the root of the visual, if there is no such file, recommended one will be used instead.
Expand Down
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "powerbi-visuals-tools",
"version": "5.4.0",
"version": "5.4.1",
"description": "Command line tool for creating and publishing visuals for Power BI",
"main": "./bin/pbiviz.js",
"type": "module",
Expand Down
19 changes: 14 additions & 5 deletions templates/visuals/rhtml/src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,32 @@ import { formattingSettings } from "powerbi-visuals-utils-formattingmodel";
import FormattingSettingsCard = formattingSettings.SimpleCard;
import FormattingSettingsSlice = formattingSettings.Slice;
import FormattingSettingsModel = formattingSettings.Model;

import TextInput = formattingSettings.TextInput;

/**
* RCV Script Formatting Card
*/
class rcvScriptCardSettings extends FormattingSettingsCard {
provider: FormattingSettingsSlice = undefined;
source: FormattingSettingsSlice = undefined;
provider: FormattingSettingsSlice = new TextInput({
name: "provider",
displayName: "Provider",
value: undefined,
placeholder: "Provider"
});
source: FormattingSettingsSlice = new TextInput({
name: "source",
displayName: "Source",
value: undefined,
placeholder: "Source"
});

name: string = "rcv_script";
displayName: string = "rcv_script";
slices: Array<FormattingSettingsSlice> = [this.provider, this.source];
}

/**
* visual settings model class
*
* Visual settings model class
*/
export class VisualFormattingSettingsModel extends FormattingSettingsModel {
// Create formatting settings model formatting cards
Expand Down
19 changes: 14 additions & 5 deletions templates/visuals/rvisual/src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,32 @@ import { formattingSettings } from "powerbi-visuals-utils-formattingmodel";
import FormattingSettingsCard = formattingSettings.SimpleCard;
import FormattingSettingsSlice = formattingSettings.Slice;
import FormattingSettingsModel = formattingSettings.Model;

import TextInput = formattingSettings.TextInput;

/**
* RCV Script Formatting Card
*/
class rcvScriptCardSettings extends FormattingSettingsCard {
provider: FormattingSettingsSlice = undefined;
source: FormattingSettingsSlice = undefined;
provider: FormattingSettingsSlice = new TextInput({
name: "provider",
displayName: "Provider",
value: undefined,
placeholder: "Provider"
});
source: FormattingSettingsSlice = new TextInput({
name: "source",
displayName: "Source",
value: undefined,
placeholder: "Source"
});

name: string = "rcv_script";
displayName: string = "rcv_script";
slices: Array<FormattingSettingsSlice> = [this.provider, this.source];
}

/**
* visual settings model class
*
* Visual settings model class
*/
export class VisualFormattingSettingsModel extends FormattingSettingsModel {
// Create formatting settings model formatting cards
Expand Down

0 comments on commit 4ead063

Please sign in to comment.