diff --git a/.version b/.version
index 5bb76b575e..198ec23ccf 100644
--- a/.version
+++ b/.version
@@ -1 +1 @@
-1.25.3
+1.25.6
diff --git a/frontend/src/Editor/Components/Calendar.jsx b/frontend/src/Editor/Components/Calendar.jsx
index d0584ea6cd..f582277513 100644
--- a/frontend/src/Editor/Components/Calendar.jsx
+++ b/frontend/src/Editor/Components/Calendar.jsx
@@ -3,6 +3,7 @@ import { Calendar as ReactCalendar, momentLocalizer } from 'react-big-calendar';
import moment from 'moment';
import 'react-big-calendar/lib/css/react-big-calendar.css';
import { CalendarEventPopover } from './CalendarPopover';
+import _ from 'lodash';
const localizer = momentLocalizer(moment);
@@ -12,7 +13,16 @@ const prepareEvent = (event, dateFormat) => ({
end: moment(event.end, dateFormat).toDate(),
});
-const parseDate = (date, dateFormat) => moment(date, dateFormat).toDate();
+const parseDate = (date, dateFormat) => {
+ const parsed = moment(date, dateFormat).toDate();
+
+ //handle invalid dates
+ if (isNaN(parsed.getTime())) {
+ return null;
+ }
+
+ return parsed;
+};
const allowedCalendarViews = ['month', 'week', 'day'];
@@ -39,6 +49,7 @@ export const Calendar = function ({
const startTime = properties.startTime ? parseDate(properties.startTime, properties.dateFormat) : todayStartTime;
const endTime = properties.endTime ? parseDate(properties.endTime, properties.dateFormat) : todayEndTime;
+ const [currentDate, setCurrentDate] = useState(defaultDate);
const [eventPopoverOptions, setEventPopoverOptions] = useState({ show: false });
const eventPropGetter = (event) => {
@@ -82,9 +93,15 @@ export const Calendar = function ({
: allowedCalendarViews[0];
useEffect(() => {
- setExposedVariable('currentView', defaultView);
+ //check if the default date is a valid date
+
+ if (defaultDate !== null && !_.isEqual(exposedVariables.currentDate, properties.defaultDate)) {
+ setExposedVariable('currentDate', moment(defaultDate).format(properties.dateFormat));
+ setCurrentDate(defaultDate);
+ }
+
// eslint-disable-next-line react-hooks/exhaustive-deps
- }, [defaultView]);
+ }, [JSON.stringify(moment(defaultDate).format('DD-MM-YYYY'))]);
const components = {
timeGutterHeader: () =>
All day
,
@@ -93,7 +110,10 @@ export const Calendar = function ({
},
};
- if (exposedVariables.currentDate === undefined) setExposedVariable('currentDate', properties.defaultDate);
+ //! hack
+ if (exposedVariables.currentDate === undefined) {
+ setExposedVariable('currentDate', moment(defaultDate).format(properties.dateFormat));
+ }
return (
@@ -105,7 +125,7 @@ export const Calendar = function ({
${exposedVariables.currentView === 'week' ? 'resources-week-cls' : ''}
${properties.displayViewSwitcher ? '' : 'hide-view-switcher'}`}
localizer={localizer}
- defaultDate={defaultDate}
+ date={currentDate}
events={events}
startAccessor="start"
endAccessor="end"
@@ -136,7 +156,9 @@ export const Calendar = function ({
});
}}
onNavigate={(date) => {
- setExposedVariable('currentDate', moment(date).format(properties.dateFormat));
+ const formattedDate = moment(date).format(properties.dateFormat);
+ setExposedVariable('currentDate', formattedDate);
+ setCurrentDate(date);
fireEvent('onCalendarNavigate');
}}
selectable={true}
diff --git a/frontend/src/SignupPage/SignupPage.jsx b/frontend/src/SignupPage/SignupPage.jsx
index ec85fe7eec..40b450273d 100644
--- a/frontend/src/SignupPage/SignupPage.jsx
+++ b/frontend/src/SignupPage/SignupPage.jsx
@@ -15,8 +15,6 @@ class SignupPageComponent extends React.Component {
isLoading: false,
};
- console.log('window.public_config?.SSO_DISABLE_SIGNUPS--- ', window.public_config?.SSO_DISABLE_SIGNUPS != true);
-
this.ssoConfigs = {
enableSignUp:
window.public_config?.DISABLE_MULTI_WORKSPACE !== 'true' &&
diff --git a/frontend/src/_components/DynamicForm.jsx b/frontend/src/_components/DynamicForm.jsx
index cb17b8814e..a326c2daf6 100644
--- a/frontend/src/_components/DynamicForm.jsx
+++ b/frontend/src/_components/DynamicForm.jsx
@@ -132,6 +132,7 @@ const DynamicForm = ({
auth_key: options.auth_key?.value,
custom_auth_params: options.custom_auth_params?.value,
custom_query_params: options.custom_query_params?.value,
+ multiple_auth_enabled: options.multiple_auth_enabled?.value,
optionchanged,
};
case 'react-component-google-sheets':
diff --git a/frontend/src/_helpers/appUtils.js b/frontend/src/_helpers/appUtils.js
index 12efa5ee16..69765e158d 100644
--- a/frontend/src/_helpers/appUtils.js
+++ b/frontend/src/_helpers/appUtils.js
@@ -667,7 +667,7 @@ export function runQuery(_ref, queryId, queryName, confirmed = undefined, mode =
.then((data) => {
if (data.status === 'needs_oauth') {
const url = data.data.auth_url; // Backend generates and return sthe auth url
- fetchOAuthToken(url, dataQuery.data_source_id);
+ fetchOAuthToken(url, dataQuery['data_source_id'] || dataQuery['dataSourceId']);
}
if (data.status === 'failed') {
diff --git a/frontend/src/_ui/OAuth/Authentication.jsx b/frontend/src/_ui/OAuth/Authentication.jsx
index 45a3794233..76b8ddb553 100644
--- a/frontend/src/_ui/OAuth/Authentication.jsx
+++ b/frontend/src/_ui/OAuth/Authentication.jsx
@@ -20,6 +20,7 @@ const Authentication = ({
bearer_token,
password,
auth_url,
+ multiple_auth_enabled,
optionchanged,
}) => {
if (auth_type === 'oauth2') {
@@ -153,6 +154,15 @@ const Authentication = ({
width={'100%'}
useMenuPortal={false}
/>
+
)}
diff --git a/frontend/src/_ui/OAuth/index.js b/frontend/src/_ui/OAuth/index.js
index 7faa4d67a4..37abc22aa6 100644
--- a/frontend/src/_ui/OAuth/index.js
+++ b/frontend/src/_ui/OAuth/index.js
@@ -19,6 +19,7 @@ const OAuth = ({
auth_url,
header_prefix,
add_token_to,
+ multiple_auth_enabled,
optionchanged,
}) => {
return (
@@ -48,6 +49,7 @@ const OAuth = ({
client_id={client_id}
client_secret={client_secret}
client_auth={client_auth}
+ multiple_auth_enabled={multiple_auth_enabled}
scopes={scopes}
username={username}
password={password}
diff --git a/plugins/packages/common/lib/app.type.ts b/plugins/packages/common/lib/app.type.ts
new file mode 100644
index 0000000000..7f5179100d
--- /dev/null
+++ b/plugins/packages/common/lib/app.type.ts
@@ -0,0 +1,4 @@
+export type App = {
+ id: string;
+ isPublic: boolean;
+};
diff --git a/plugins/packages/common/lib/index.ts b/plugins/packages/common/lib/index.ts
index e22d446c57..de1538e1ae 100644
--- a/plugins/packages/common/lib/index.ts
+++ b/plugins/packages/common/lib/index.ts
@@ -1,7 +1,9 @@
import { QueryError, OAuthUnauthorizedClientError } from './query.error';
import { QueryResult } from './query_result.type';
+import { User } from './user.type';
+import { App } from './app.type';
import { QueryService } from './query_service.interface';
-import { cacheConnection, getCachedConnection, parseJson, cleanSensitiveData } from './utils.helper';
+import { cacheConnection, getCachedConnection, parseJson, cleanSensitiveData, getCurrentToken } from './utils.helper';
import { ConnectionTestResult } from './connection_test_result.type';
export {
@@ -9,9 +11,12 @@ export {
OAuthUnauthorizedClientError,
QueryResult,
QueryService,
+ User,
+ App,
cacheConnection,
getCachedConnection,
parseJson,
ConnectionTestResult,
cleanSensitiveData,
+ getCurrentToken,
};
diff --git a/plugins/packages/common/lib/query_service.interface.ts b/plugins/packages/common/lib/query_service.interface.ts
index e538696903..056930f4d4 100644
--- a/plugins/packages/common/lib/query_service.interface.ts
+++ b/plugins/packages/common/lib/query_service.interface.ts
@@ -1,12 +1,14 @@
+import { App } from './app.type';
import { ConnectionTestResult } from './connection_test_result.type';
import { QueryResult } from './query_result.type';
-
+import { User } from './user.type';
export interface QueryService {
run(
sourceOptions: object,
queryOptions: object,
dataSourceId?: string,
- dataSourceUpdatedAt?: string
+ dataSourceUpdatedAt?: string,
+ context?: { user?: User; app?: App }
): Promise;
getConnection?(queryOptions: object, options: any, checkCache: boolean, dataSourceId: string): Promise