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

Added Dashboard URL #9523

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.35.4
2.36.1
2 changes: 1 addition & 1 deletion frontend/.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.35.4
2.36.1
12 changes: 8 additions & 4 deletions frontend/assets/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@
"columnType": "Column type",
"columnName": "Column name",
"overflow": "Overflow",
"key": "key",
"key": "Key",
"textColor": "Text color",
"validation": "Validation",
"regex": "Regex",
Expand All @@ -716,8 +716,8 @@
"values": "Values",
"labels": "Labels",
"cellBgColor": "Cell background color",
"dateDisplayformat": "Date display format",
"dateParseformat": "Date parse format",
"dateDisplayformat": "Date format",
"dateParseformat": "Date",
"showTime": "show time",
"makeEditable": "make editable",
"buttonText": "Button text",
Expand All @@ -727,7 +727,10 @@
"addColumn": "Add column",
"addNewColumn": "Add new column",
"noActionMessage": "This table doesn't have any action buttons",
"horizontalAlignment": "horizontal alignment"
"horizontalAlignment":"Horizontal alignment",
"textAlignment":"Text alignment",
"deciamalPlaces":"Decimal Places",
"imageFit":"Image fit"
},
"Button": {
"displayName": "Button",
Expand Down Expand Up @@ -947,6 +950,7 @@
"maxWidthOfCanvas": "Max width of canvas",
"maxHeightOfCanvas": "Max height of canvas",
"backgroundColorOfCanvas": "Canvas background",
"appMode": "App mode",
"exportApp": "Export app"
},
"Back": {
Expand Down
14 changes: 7 additions & 7 deletions frontend/assets/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@
"blankPage": {
"welcomeToToolJet": "¡Bienvenido a ToolJet!",
"getStartedCreateNewApp": "Puedes empezar creando una nueva aplicación o creando una aplicación usando una plantilla en la biblioteca de ToolJet.",
"importApplication": "Importar una aplicación",
"importApplication": "Importar una aplicación"
},
"foldersSection": {
"allApplications": "Todas las aplicaciones",
Expand Down Expand Up @@ -387,11 +387,11 @@
"templateCard": {
"use": "Usar",
"preview": "Prevista",
"leadGeneretion": "Generación de líderes",
"leadGeneretion": "Generación de líderes"
},
"templateLibraryModal": {
"select": "Seleccionar plantilla",
"createAppfromTemplate": "Crear aplicación desde plantilla",
"createAppfromTemplate": "Crear aplicación desde plantilla"
}
},
"confirmationPage": {
Expand Down Expand Up @@ -662,7 +662,7 @@
"setColor": "Establecer color",
"structure": "Estructura",
"checkedValues": "Valores marcados",
"expandedValues": "Valores expandidos",
"expandedValues": "Valores expandidos"
},
"Table": {
"displayName": "Tabla",
Expand All @@ -689,7 +689,7 @@
"remove": "Eliminar",
"addButton": "+ Agregar botón",
"addColumn": "+ Agregar columna",
"noActionMessage": "Esta tabla no tiene botones de acción",
"noActionMessage": "Esta tabla no tiene botones de acción"
},
"Button": {
"displayName": "Botón",
Expand Down Expand Up @@ -898,7 +898,7 @@
"text": "Comentarios",
"tip": "Habilitar comentarios",
"commentBody": "No hay comentarios para desplegar",
"typeComment": "Escriba su comentario aquí",
"typeComment": "Escriba su comentario aquí"
},
"Settings": {
"text": "Ajustes",
Expand All @@ -907,7 +907,7 @@
"maintenanceMode": "Modo de mantenimiento",
"maxWidthOfCanvas": "Ancho máximo del lienzo",
"maxHeightOfCanvas": "Altura máxima del lienzo",
"backgroundColorOfCanvas": "Color de fondo del lienzo",
"backgroundColorOfCanvas": "Color de fondo del lienzo"
},
"Back": {
"text": "Atrás",
Expand Down
13 changes: 7 additions & 6 deletions frontend/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 frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"react-circular-progressbar": "^2.1.0",
"react-color": "^2.19.3",
"react-copy-to-clipboard": "^5.1.0",
"react-datepicker": "^4.10.0",
"react-datepicker": "^4.25.0",
"react-dates": "^21.8.0",
"react-datetime": "^3.2.0",
"react-dnd": "^16.0.1",
Expand Down
43 changes: 33 additions & 10 deletions frontend/src/App/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,38 +31,44 @@ import 'react-tooltip/dist/react-tooltip.css';
import { getWorkspaceIdOrSlugFromURL } from '@/_helpers/routes';
import ErrorPage from '@/_components/ErrorComponents/ErrorPage';
import WorkspaceConstants from '@/WorkspaceConstants';
import { useAppDataStore } from '@/_stores/appDataStore';
import { useSuperStore } from '../_stores/superStore';
import { ModuleContext } from '../_contexts/ModuleContext';
import cx from 'classnames';
import useAppDarkMode from '@/_hooks/useAppDarkMode';
import { ManageOrgUsers } from '@/ManageOrgUsers';
import { ManageGroupPermissions } from '@/ManageGroupPermissions';
import OrganizationLogin from '@/_components/OrganizationLogin/OrganizationLogin';
import { ManageOrgVars } from '@/ManageOrgVars';

const AppWrapper = (props) => {
const { isAppDarkMode } = useAppDarkMode();
return (
<Suspense fallback={null}>
<BrowserRouter basename={window.public_config?.SUB_PATH || '/'}>
<AppWithRouter props={props} />
<AppWithRouter props={props} isAppDarkMode={isAppDarkMode} />
</BrowserRouter>
</Suspense>
);
};

class AppComponent extends React.Component {
static contextType = ModuleContext;
constructor(props) {
super(props);

this.state = {
currentUser: null,
fetchedMetadata: false,
darkMode: localStorage.getItem('darkMode') === 'true',
isEditorOrViewer: '',
};
}
updateSidebarNAV = (val) => {
this.setState({ sidebarNav: val });
};
fetchMetadata = () => {
tooljetService.fetchMetaData().then((data) => {
useAppDataStore.getState().actions.setMetadata(data);
useSuperStore.getState().modules[this.context].useAppDataStore.getState().actions.setMetadata(data);
localStorage.setItem('currentVersion', data.installed_version);
if (data.latest_version && lt(data.installed_version, data.latest_version) && data.version_ignored === false) {
this.setState({ updateAvailable: true });
Expand Down Expand Up @@ -98,19 +104,19 @@ class AppComponent extends React.Component {

switchDarkMode = (newMode) => {
this.setState({ darkMode: newMode });
useSuperStore.getState().modules[this.context].useAppDataStore.getState().actions.updateIsTJDarkMode(newMode);
localStorage.setItem('darkMode', newMode);
};

render() {
const { updateAvailable, darkMode } = this.state;

const { updateAvailable, darkMode, isEditorOrViewer } = this.state;
let toastOptions = {
style: {
wordBreak: 'break-all',
},
};

if (darkMode) {
if (isEditorOrViewer === 'viewer' ? this.props.isAppDarkMode : darkMode) {
toastOptions = {
className: 'toast-dark-mode',
style: {
Expand All @@ -125,7 +131,12 @@ class AppComponent extends React.Component {
const { updateSidebarNAV } = this;
return (
<>
<div className={`main-wrapper ${darkMode ? 'theme-dark dark-theme' : ''}`} data-cy="main-wrapper">
<div
className={cx('main-wrapper', {
'theme-dark dark-theme': !isEditorOrViewer && darkMode,
})}
data-cy="main-wrapper"
>
{updateAvailable && (
<div className="alert alert-info alert-dismissible" role="alert">
<h3 className="mb-1">Update available</h3>
Expand Down Expand Up @@ -181,7 +192,11 @@ class AppComponent extends React.Component {
path="/:workspaceId/apps/:slug/:pageHandle?/*"
element={
<PrivateRoute>
<AppLoader switchDarkMode={this.switchDarkMode} darkMode={darkMode} />
<AppLoader
switchDarkMode={this.switchDarkMode}
darkMode={darkMode}
setEditorOrViewer={(value) => this.setState({ isEditorOrViewer: value })}
/>
</PrivateRoute>
}
/>
Expand All @@ -199,7 +214,11 @@ class AppComponent extends React.Component {
path="/applications/:slug/:pageHandle?"
element={
<PrivateRoute>
<Viewer switchDarkMode={this.switchDarkMode} darkMode={darkMode} />
<Viewer
switchDarkMode={this.switchDarkMode}
darkMode={this.props.isAppDarkMode}
setEditorOrViewer={(value) => this.setState({ isEditorOrViewer: value })}
/>
</PrivateRoute>
}
/>
Expand All @@ -208,7 +227,11 @@ class AppComponent extends React.Component {
path="/applications/:slug/versions/:versionId/:pageHandle?"
element={
<PrivateRoute>
<Viewer switchDarkMode={this.switchDarkMode} darkMode={darkMode} />
<Viewer
switchDarkMode={this.switchDarkMode}
darkMode={this.props.isAppDarkMode}
setEditorOrViewer={(value) => this.setState({ isEditorOrViewer: value })}
/>
</PrivateRoute>
}
/>
Expand Down
5 changes: 2 additions & 3 deletions frontend/src/Editor/AppVersionsManager/AppVersionsManager.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const AppVersionsManager = function ({
onVersionDelete,
isEditable = true,
isViewer,
darkMode,
}) {
const [appVersionStatus, setGetAppVersionStatus] = useState(appVersionLoadingStatus.loading);
const [deleteVersion, setDeleteVersion] = useState({
Expand Down Expand Up @@ -53,8 +54,6 @@ export const AppVersionsManager = function ({
};
}, [appVersions]);

const darkMode = localStorage.getItem('darkMode') === 'true';

const selectVersion = (id) => {
appVersionService
.getAppVersionData(appId, id)
Expand Down Expand Up @@ -173,8 +172,8 @@ export const AppVersionsManager = function ({
value={editingVersion?.id}
onChange={(id) => selectVersion(id)}
{...customSelectProps}
className={` ${darkMode && 'dark-theme'}`}
isEditable={isEditable}
darkMode={darkMode}
/>
</div>
</div>
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/Editor/Box.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ import { EditorContext } from '@/Editor/Context/EditorContextWrapper';
import { useTranslation } from 'react-i18next';
import { useCurrentState } from '@/_stores/currentStateStore';
import { useAppInfo } from '@/_stores/appDataStore';
import { useModuleName } from '../_contexts/ModuleContext';
import { isPDFSupported } from '@/_stores/utils';

export const AllComponents = {
Expand Down Expand Up @@ -158,10 +159,12 @@ export const Box = memo(
isResizing,
adjustHeightBasedOnAlignment,
currentLayout,
darkMode,
}) => {
const { t } = useTranslation();
const backgroundColor = yellow ? 'yellow' : '';
const currentState = useCurrentState();
const moduleName = useModuleName();
const { events } = useAppInfo();
const shouldAddBoxShadowAndVisibility = ['TextInput', 'PasswordInput', 'NumberInput', 'Text'];

Expand Down Expand Up @@ -204,7 +207,6 @@ export const Box = memo(
? validateProperties(resolvedGeneralStyles, componentMeta.generalStyles)
: [resolvedGeneralStyles, []];

const darkMode = localStorage.getItem('darkMode') === 'true';
const { variablesExposedForPreview, exposeToCodeHinter } = useContext(EditorContext) || {};

let styles = {
Expand Down
13 changes: 12 additions & 1 deletion frontend/src/Editor/CodeBuilder/CodeHinter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ import { Input } from './Elements/Input';
import { Icon } from './Elements/Icon';
import { Visibility } from './Elements/Visibility';
import { NumberInput } from './Elements/NumberInput';
import TableRowHeightInput from './Elements/TableRowHeightInput';

import { validateProperty } from '../component-properties-validation';

const HIDDEN_CODE_HINTER_LABELS = ['Table data', 'Column data', 'Text Format', 'TextComponentTextInput'];
Expand All @@ -63,6 +65,7 @@ const AllElements = {
Icon,
Visibility,
NumberInput,
TableRowHeightInput,
};

export function CodeHinter({
Expand Down Expand Up @@ -407,7 +410,15 @@ export function CodeHinter({

const fxBtn = () => (
<div className="col-auto pt-0 fx-common">
{!['Type', 'selectRowOnCellEdit', 'Select row on cell edit', ' ', 'Padding', 'Width'].includes(paramLabel) && ( //add some key if these extends
{![
'Type',
'selectRowOnCellEdit',
'Select row on cell edit',
' ',
'Padding',
'Width',
'Make all columns editable',
].includes(paramLabel) && ( //add some key if these extends
<FxButton
active={codeShow}
onPress={() => {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Editor/CodeBuilder/Elements/BoxShadow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const BoxShadow = ({ value, onChange, cyLabel }) => {

const colorPickerStyle = {
position: 'absolute',
bottom: '260px',
top: '-220px',
};

useEffect(() => {
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/Editor/CodeBuilder/Elements/Color.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ export const Color = ({ value, onChange, pickerStyle = {}, cyLabel, asBoxShadowP
// This is fix when color picker don't have much space to open in bottom side
{ 'inspector-color-input-popover': colorPickerPosition === 'top' }
)}
style={{ zIndex: 10000 }}
>
<Popover.Body className={!asBoxShadowPopover && 'boxshadow-picker'}>
<Popover.Body className={!asBoxShadowPopover && 'boxshadow-picker'} style={{ padding: '0px' }}>
<>{ColorPicker()}</>
</Popover.Body>
</Popover>
Expand Down