mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 08:58:26 +00:00
Fix issue where the client crashes when goto app action is selected
This commit supplies the missing prop 'apps' to Table component and EventSelector component so that they can properly display the apps. This commit also modifies the get-all-apps query logic such that if the queried page is 0, it fetches all the apps. It adds a filtering logic such that presently only the apps with slugs are listed as targets for goto app action.
This commit is contained in:
parent
900e0e06fb
commit
b76f18bbba
4 changed files with 7 additions and 2 deletions
|
|
@ -230,6 +230,7 @@ class Table extends React.Component {
|
|||
eventOptionUpdated={this.actionButtonEventOptionUpdated}
|
||||
currentState={this.state.currentState}
|
||||
extraData={{ actionButton: action, index: index }} // This data is returned in the callbacks
|
||||
apps={this.props.apps}
|
||||
/>
|
||||
<button className="btn btn-sm btn-outline-danger col" onClick={() => this.removeAction(index)}>
|
||||
Remove
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ export const EventSelector = ({
|
|||
|
||||
function getAllApps() {
|
||||
let appsOptionsList = [];
|
||||
apps.map((item) => {
|
||||
apps.filter(item => item.slug != undefined).map((item) => {
|
||||
appsOptionsList.push({
|
||||
name: item.name,
|
||||
value: item.slug
|
||||
|
|
|
|||
|
|
@ -191,6 +191,7 @@ export const Inspector = ({
|
|||
components={components}
|
||||
currentState={currentState}
|
||||
darkMode={darkMode}
|
||||
apps={apps}
|
||||
/>
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,10 @@ export const appService = {
|
|||
|
||||
function getAll(page, folder) {
|
||||
const requestOptions = { method: 'GET', headers: authHeader() };
|
||||
return fetch(`${config.apiUrl}/apps?page=${page}&folder=${folder || ''}`, requestOptions).then(handleResponse);
|
||||
if (page === 0)
|
||||
return fetch(`${config.apiUrl}/apps`, requestOptions).then(handleResponse);
|
||||
else
|
||||
return fetch(`${config.apiUrl}/apps?page=${page}&folder=${folder || ''}`, requestOptions).then(handleResponse);
|
||||
}
|
||||
|
||||
function createApp() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue