Skip to content

Commit

Permalink
feat: implement row limit update (#124)
Browse files Browse the repository at this point in the history
* feat: implement row limit update

Added row limit update example. This required updating the extension SDK packages.
  • Loading branch information
bryans99 authored Dec 20, 2023
1 parent e3d7e94 commit 05b4e30
Show file tree
Hide file tree
Showing 20 changed files with 1,040 additions and 191 deletions.
1,064 changes: 959 additions & 105 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions react/javascript/demo-core-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
"@looker/components-providers": "1.5.34",
"@looker/design-tokens": "3.1.1",
"@looker/embed-sdk": "^1.8.5",
"@looker/extension-sdk": "23.20.0",
"@looker/extension-sdk-react": "23.20.0",
"@looker/extension-sdk": "23.20.1",
"@looker/extension-sdk-react": "23.20.1",
"@looker/icons": "1.5.21",
"@looker/sdk": "23.20.0",
"@looker/sdk": "23.20.1",
"@looker/sdk-rtl": "21.6.1",
"@styled-icons/material": "^10.28.0",
"@styled-icons/material-outlined": "^10.34.0",
Expand Down
6 changes: 3 additions & 3 deletions react/javascript/demo-embeds/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
"@looker/design-tokens": "3.1.1",
"@looker/i18n": "1.0.0",
"@looker/embed-sdk": "^1.8.5",
"@looker/extension-sdk": "23.20.0",
"@looker/extension-sdk-react": "23.20.0",
"@looker/extension-sdk": "23.20.1",
"@looker/extension-sdk-react": "23.20.1",
"@looker/icons": "1.5.21",
"@looker/sdk": "23.20.0",
"@looker/sdk": "23.20.1",
"@looker/sdk-rtl": "21.6.1",
"@styled-icons/material": "^10.28.0",
"@styled-icons/material-outlined": "^10.34.0",
Expand Down
6 changes: 3 additions & 3 deletions react/javascript/demo-extension-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
"@looker/design-tokens": "3.1.1",
"@looker/i18n": "1.0.0",
"@looker/embed-sdk": "^1.8.5",
"@looker/extension-sdk": "23.20.0",
"@looker/extension-sdk-react": "23.20.0",
"@looker/extension-sdk": "23.20.1",
"@looker/extension-sdk-react": "23.20.1",
"@looker/icons": "1.5.21",
"@looker/sdk": "23.20.0",
"@looker/sdk": "23.20.1",
"@looker/sdk-rtl": "21.6.1",
"@styled-icons/material": "^10.28.0",
"@styled-icons/material-outlined": "^10.34.0",
Expand Down
6 changes: 3 additions & 3 deletions react/javascript/demo-external-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
"@looker/design-tokens": "3.1.1",
"@looker/i18n": "1.0.0",
"@looker/embed-sdk": "^1.8.5",
"@looker/extension-sdk": "23.20.0",
"@looker/extension-sdk-react": "23.20.0",
"@looker/extension-sdk": "23.20.1",
"@looker/extension-sdk-react": "23.20.1",
"@looker/icons": "1.5.21",
"@looker/sdk": "23.20.0",
"@looker/sdk": "23.20.1",
"@looker/sdk-rtl": "21.6.1",
"@styled-icons/material": "^10.28.0",
"@styled-icons/material-outlined": "^10.34.0",
Expand Down
6 changes: 3 additions & 3 deletions react/javascript/file-download/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
"@looker/design-tokens": "3.1.1",
"@looker/i18n": "1.0.0",
"@looker/embed-sdk": "^1.8.5",
"@looker/extension-sdk": "23.20.0",
"@looker/extension-sdk-react": "23.20.0",
"@looker/extension-sdk": "23.20.1",
"@looker/extension-sdk-react": "23.20.1",
"@looker/icons": "1.5.21",
"@looker/sdk": "23.20.0",
"@looker/sdk": "23.20.1",
"@looker/sdk-rtl": "21.6.1",
"@styled-icons/material": "^10.28.0",
"@styled-icons/material-outlined": "^10.34.0",
Expand Down
6 changes: 3 additions & 3 deletions react/javascript/file-upload/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
"@looker/design-tokens": "3.1.1",
"@looker/i18n": "1.0.0",
"@looker/embed-sdk": "^1.8.5",
"@looker/extension-sdk": "23.20.0",
"@looker/extension-sdk-react": "23.20.0",
"@looker/extension-sdk": "23.20.1",
"@looker/extension-sdk-react": "23.20.1",
"@looker/icons": "1.5.21",
"@looker/sdk": "23.20.0",
"@looker/sdk": "23.20.1",
"@looker/sdk-rtl": "21.6.1",
"@styled-icons/material": "^10.28.0",
"@styled-icons/material-outlined": "^10.34.0",
Expand Down
6 changes: 3 additions & 3 deletions react/javascript/helloworld-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
"@looker/design-tokens": "3.1.1",
"@looker/i18n": "1.0.0",
"@looker/embed-sdk": "^1.8.5",
"@looker/extension-sdk": "23.20.0",
"@looker/extension-sdk-react": "23.20.0",
"@looker/extension-sdk": "23.20.1",
"@looker/extension-sdk-react": "23.20.1",
"@looker/icons": "1.5.21",
"@looker/sdk": "23.20.0",
"@looker/sdk": "23.20.1",
"@looker/sdk-rtl": "21.6.1",
"@styled-icons/material": "^10.28.0",
"@styled-icons/material-outlined": "^10.34.0",
Expand Down
6 changes: 3 additions & 3 deletions react/javascript/map-iframe/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
"@looker/design-tokens": "3.1.1",
"@looker/i18n": "1.0.0",
"@looker/embed-sdk": "^1.8.5",
"@looker/extension-sdk": "23.20.0",
"@looker/extension-sdk-react": "23.20.0",
"@looker/extension-sdk": "23.20.1",
"@looker/extension-sdk-react": "23.20.1",
"@looker/icons": "1.5.21",
"@looker/sdk": "23.20.0",
"@looker/sdk": "23.20.1",
"@looker/sdk-rtl": "21.6.1",
"@styled-icons/material": "^10.28.0",
"@styled-icons/material-outlined": "^10.34.0",
Expand Down
6 changes: 3 additions & 3 deletions react/javascript/tile-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
"@looker/design-tokens": "3.1.1",
"@looker/i18n": "1.0.0",
"@looker/embed-sdk": "^1.8.5",
"@looker/extension-sdk": "23.20.0",
"@looker/extension-sdk-react": "23.20.0",
"@looker/extension-sdk": "23.20.1",
"@looker/extension-sdk-react": "23.20.1",
"@looker/icons": "1.5.21",
"@looker/sdk": "23.20.0",
"@looker/sdk": "23.20.1",
"@looker/sdk-rtl": "21.6.1",
"@styled-icons/material": "^10.28.0",
"@styled-icons/material-outlined": "^10.34.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const EventTester = () => {
visualizationData,
visualizationSDK,
} = useContext(ExtensionContext40)
const [runDashboard, setRunDashboard] = useState(false)
const [run, setRun] = useState(false)
const openDrillMenuButtonRef = useRef()
const toggleCrossFilterButtonRef = useRef()

Expand Down Expand Up @@ -130,23 +130,10 @@ export const EventTester = () => {
return event
}, [])

const triggerClick = useCallback((event) => {
// Taken from custom visualizations 2
const defaultColors = {
red: '#F36254',
green: '#4FBC89',
yellow: '#FCF758',
white: '#FFFFFF',
const updateRowLimitClick = useCallback((event) => {
if (visualizationSDK) {
visualizationSDK.updateRowLimit(50)
}
tileSDK.trigger(
'updateConfig',
[
{ lowColor: defaultColors.red },
{ midColor: defaultColors.white },
{ highColor: defaultColors.green },
],
event
)
}, [])

const toggleCrossFilterClick = useCallback(
Expand Down Expand Up @@ -197,17 +184,21 @@ export const EventTester = () => {

const updateFiltersClick = useCallback(() => {
const updatedFilter = {}
Object.entries(dashboardFilters || {}).forEach(([key, value]) => {
updatedFilter[key] = value
if (key === 'State') {
updatedFilter[key] =
value === 'California' ? 'Washington' : 'California'
} else if (typeof value === 'string') {
updatedFilter[key] = value.split('').reverse().join('')
}
})
tileSDK.updateFilters(updatedFilter, runDashboard)
}, [dashboardFilters, runDashboard])
if (Object.entries(dashboardFilters || {}).length === 0) {
updatedFilter.State = 'Washington'
} else {
Object.entries(dashboardFilters || {}).forEach(([key, value]) => {
updatedFilter[key] = value
if (key === 'State') {
updatedFilter[key] =
value === 'California' ? 'Washington' : 'California'
} else if (typeof value === 'string') {
updatedFilter[key] = value.split('').reverse().join('')
}
})
}
tileSDK.updateFilters(updatedFilter, run)
}, [dashboardFilters, run])

const openScheduleDialogClick = useCallback(() => {
tileSDK.openScheduleDialog()
Expand Down Expand Up @@ -249,11 +240,11 @@ export const EventTester = () => {
Test stop dashboard
</ButtonOutline>
<ButtonOutline
onClick={triggerClick}
onClick={updateRowLimitClick}
width="100%"
disabled={!visualizationData}
>
Test trigger
Update row limit
</ButtonOutline>
<ButtonOutline
onClick={openDrillMenuClick}
Expand All @@ -279,9 +270,9 @@ export const EventTester = () => {
Test update filters
</ButtonOutline>
<FieldToggleSwitch
label="Run dashboard"
onChange={(event) => setRunDashboard(event.target.checked)}
on={runDashboard}
label="Run"
onChange={(event) => setRun(event.target.checked)}
on={run}
></FieldToggleSwitch>
<ButtonOutline
onClick={openScheduleDialogClick}
Expand All @@ -290,7 +281,11 @@ export const EventTester = () => {
>
Test open schedule dialog
</ButtonOutline>
<ButtonOutline onClick={updateTileClick} width="100%">
<ButtonOutline
onClick={updateTileClick}
width="100%"
disabled={isExploring}
>
Update title title
</ButtonOutline>
</Grid>
Expand Down
6 changes: 3 additions & 3 deletions react/javascript/tile-visualization/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
"@looker/design-tokens": "3.1.1",
"@looker/i18n": "1.0.0",
"@looker/embed-sdk": "^1.8.5",
"@looker/extension-sdk": "23.20.0",
"@looker/extension-sdk-react": "23.20.0",
"@looker/extension-sdk": "23.20.1",
"@looker/extension-sdk-react": "23.20.1",
"@looker/icons": "1.5.21",
"@looker/sdk": "23.20.0",
"@looker/sdk": "23.20.1",
"@looker/sdk-rtl": "21.6.1",
"@styled-icons/material": "^10.28.0",
"@styled-icons/material-outlined": "^10.34.0",
Expand Down
6 changes: 3 additions & 3 deletions react/typescript/access-key-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
"@looker/design-tokens": "3.1.1",
"@looker/i18n": "1.0.0",
"@looker/embed-sdk": "^1.8.5",
"@looker/extension-sdk": "23.20.0",
"@looker/extension-sdk-react": "23.20.0",
"@looker/extension-sdk": "23.20.1",
"@looker/extension-sdk-react": "23.20.1",
"@looker/icons": "1.5.21",
"@looker/sdk": "23.20.0",
"@looker/sdk": "23.20.1",
"@looker/sdk-rtl": "21.6.1",
"@styled-icons/material": "^10.28.0",
"@styled-icons/material-outlined": "^10.34.0",
Expand Down
6 changes: 3 additions & 3 deletions react/typescript/helloworld-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
"@looker/design-tokens": "3.1.1",
"@looker/embed-sdk": "^1.8.5",
"@looker/i18n": "1.0.0",
"@looker/extension-sdk": "23.20.0",
"@looker/extension-sdk-react": "23.20.0",
"@looker/extension-sdk": "23.20.1",
"@looker/extension-sdk-react": "23.20.1",
"@looker/icons": "1.5.21",
"@looker/sdk": "23.20.0",
"@looker/sdk": "23.20.1",
"@looker/sdk-rtl": "21.6.1",
"@styled-icons/material": "^10.28.0",
"@styled-icons/material-outlined": "^10.34.0",
Expand Down
6 changes: 3 additions & 3 deletions react/typescript/kitchensink/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
"@looker/design-tokens": "3.1.1",
"@looker/i18n": "1.0.0",
"@looker/embed-sdk": "^1.8.5",
"@looker/extension-sdk": "23.20.0",
"@looker/extension-sdk-react": "23.20.0",
"@looker/extension-sdk": "23.20.1",
"@looker/extension-sdk-react": "23.20.1",
"@looker/icons": "1.5.21",
"@looker/sdk": "23.20.0",
"@looker/sdk": "23.20.1",
"@looker/sdk-rtl": "21.6.1",
"@styled-icons/material": "^10.28.0",
"@styled-icons/material-outlined": "^10.34.0",
Expand Down
6 changes: 3 additions & 3 deletions react/typescript/looks-query-redux/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
"@looker/design-tokens": "3.1.1",
"@looker/i18n": "1.0.0",
"@looker/embed-sdk": "^1.8.5",
"@looker/extension-sdk": "23.20.0",
"@looker/extension-sdk-react": "23.20.0",
"@looker/extension-sdk": "23.20.1",
"@looker/extension-sdk-react": "23.20.1",
"@looker/icons": "1.5.21",
"@looker/sdk": "23.20.0",
"@looker/sdk": "23.20.1",
"@looker/sdk-rtl": "21.6.1",
"@styled-icons/material": "^10.28.0",
"@styled-icons/material-outlined": "^10.34.0",
Expand Down
6 changes: 3 additions & 3 deletions react/typescript/looks-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
"@looker/design-tokens": "3.1.1",
"@looker/i18n": "1.0.0",
"@looker/embed-sdk": "^1.8.5",
"@looker/extension-sdk": "23.20.0",
"@looker/extension-sdk-react": "23.20.0",
"@looker/extension-sdk": "23.20.1",
"@looker/extension-sdk-react": "23.20.1",
"@looker/icons": "1.5.21",
"@looker/sdk": "23.20.0",
"@looker/sdk": "23.20.1",
"@looker/sdk-rtl": "21.6.1",
"@styled-icons/material": "^10.28.0",
"@styled-icons/material-outlined": "^10.34.0",
Expand Down
6 changes: 3 additions & 3 deletions scripts/update_packages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ const packages = {
'@looker/i18n': '1.0.0',
'@looker/design-tokens': '3.1.1',
'@looker/embed-sdk': '^1.8.5',
'@looker/extension-sdk': '23.20.0',
'@looker/extension-sdk-react': '23.20.0',
'@looker/extension-sdk': '23.20.1',
'@looker/extension-sdk-react': '23.20.1',
'@looker/icons': '1.5.21',
'@looker/sdk': '23.20.0',
'@looker/sdk': '23.20.1',
'@looker/sdk-rtl': '21.6.1',
react: '^16.14.0',
'react-content-loader': '^4.0.1',
Expand Down
4 changes: 2 additions & 2 deletions vanilla/counter-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"node": ">=14"
},
"dependencies": {
"@looker/extension-sdk": "23.20.0",
"@looker/sdk": "23.20.0",
"@looker/extension-sdk": "23.20.1",
"@looker/sdk": "23.20.1",
"@looker/sdk-rtl": "21.6.1"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions vanilla/counter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"node": ">=14"
},
"dependencies": {
"@looker/extension-sdk": "23.20.0",
"@looker/sdk": "23.20.0",
"@looker/extension-sdk": "23.20.1",
"@looker/sdk": "23.20.1",
"@looker/sdk-rtl": "21.6.1"
},
"devDependencies": {
Expand Down

0 comments on commit 05b4e30

Please sign in to comment.