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

feat : Query manager separated to different tabs #9823

Merged
merged 49 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
192a917
change toggle for query manager and revamp preview
Kartik18g May 22, 2024
ff345c2
feat : query manger body revamp
stepinfwd May 22, 2024
c96bf7b
updates
stepinfwd May 22, 2024
105baea
Merge branch 'feature/query-manager-toggle-and-preview-changes' into …
stepinfwd May 22, 2024
61f7584
fix : tranformation switch
stepinfwd May 22, 2024
3df4313
preview integration
stepinfwd May 22, 2024
f079717
loader safari changes and overflow fix
Kartik18g May 23, 2024
0fd01cf
Merge branch 'feature/query-manager-toggle-and-preview-changes' into …
stepinfwd May 23, 2024
ac84a7a
fix
stepinfwd May 23, 2024
947e86b
fix : settings tab QM
stepinfwd May 23, 2024
5fcb09a
revert few changes to fix datasources page
stepinfwd May 23, 2024
447e729
revert header options change
stepinfwd May 23, 2024
ea86844
zindex fix for query-pane
Kartik18g May 23, 2024
1e6cbf6
fix : events ui
stepinfwd May 23, 2024
eb5afd0
fix :events widget manager
stepinfwd May 23, 2024
be413a7
Merge branch 'main' into feature/query-manager-body
stepinfwd May 23, 2024
4077949
code optimised for this file
stepinfwd May 23, 2024
7dd5742
QM header fixes
stepinfwd May 23, 2024
48088b0
Merge branch 'feature/query-manager-toggle-and-preview-changes' into …
stepinfwd May 23, 2024
024a161
dark mode changes
Kartik18g May 23, 2024
51e426a
fix : info icon
stepinfwd May 23, 2024
3d2f3a5
Merge branch 'feature/query-manager-toggle-and-preview-changes' into …
stepinfwd May 23, 2024
8f42115
open preview drawer on run query
Kartik18g May 23, 2024
f855ea5
Merge branch 'feature/query-manager-toggle-and-preview-changes' into …
stepinfwd May 23, 2024
8cb72c0
fix : query manager query section icons update
stepinfwd May 24, 2024
999aa47
update color
stepinfwd May 24, 2024
6013be1
Merge branch 'main' into feature/query-manager-body
stepinfwd May 24, 2024
ee96cb8
design feedbacks and make preview panel resizable
Kartik18g May 28, 2024
40ed3d4
update toggle for preview result & increate draggable area
Kartik18g May 31, 2024
fd5a9eb
fix :review changes
stepinfwd May 31, 2024
b532588
Merge branch 'appbuilder-1.8' into feature/query-manager-body
stepinfwd May 31, 2024
f10d6a7
merge fixes
stepinfwd May 31, 2024
e9a544f
Merge branch 'appbuilder-1.8' into feature/query-manager-body
stepinfwd May 31, 2024
1785f47
fix : codehinter in disabled state
stepinfwd May 31, 2024
de7cd97
ui fix
stepinfwd Jun 3, 2024
4763dd1
code refactor
stepinfwd Jun 3, 2024
80f2c9e
cleanup
stepinfwd Jun 3, 2024
919f753
fix fontsize in datasource selector popup
stepinfwd Jun 3, 2024
06aced3
fix border issue in preview container and increase draggable area
Kartik18g Jun 3, 2024
cfb3f8e
fix : review fixes
stepinfwd Jun 3, 2024
32871ec
fix: fixed text css formatting for safari support
stepinfwd Jun 3, 2024
557452f
Merge branch 'appbuilder-1.8' into feature/query-manager-body
stepinfwd Jun 12, 2024
c9b2555
Revert "code refactor"
stepinfwd Jun 13, 2024
a24d7b8
typo
stepinfwd Jun 13, 2024
107a1ef
fix : not able to select text in preview
stepinfwd Jun 13, 2024
df4c366
fix : not able to view add params
stepinfwd Jun 13, 2024
2f879da
fix selection issue in preview
Kartik18g Jun 14, 2024
b6795d2
fix : add scroll in query manager when preview is blocking view
stepinfwd Jun 14, 2024
81450a9
Merge branch 'appbuilder-1.8' into feature/query-manager-body
stepinfwd Jun 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions frontend/assets/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,9 @@
"goToAllDatasources": "Go to all Datasource",
"send": "Send"
},
"runQueryOnApplicationLoad": "Run this query on application load?",
"confirmBeforeQueryRun": "Request confirmation before running query?",
"notificationOnSuccess": "Show notification on success?",
"runQueryOnApplicationLoad": "Run this query on application load",
"confirmBeforeQueryRun": "Request confirmation before running query",
"notificationOnSuccess": "Show notification on success",
"successMessage": "Success Message",
"queryRanSuccessfully": "Query ran successfully",
"notificationDuration": "Notification duration (s)",
Expand Down Expand Up @@ -207,6 +207,7 @@
"pageIndex": "Page index",
"component": "Component",
"addHandler": "New event handler",
"addNewEvent": "Add new event",
"addEventHandler": "+ Add event handler",
"emptyMessage": "This {{componentName}} doesn't have any event handlers",
"page": "Page"
Expand Down Expand Up @@ -286,9 +287,9 @@
"createUpdateDelete": "Create/Update/Delete",
"folder": "Folder"
},
"groupOptions":{
"deleteGroup":"Delete Group",
"duplicateGroup":"Duplicate Group"
"groupOptions": {
"deleteGroup": "Delete Group",
"duplicateGroup": "Duplicate Group"
}
},
"manageSSO": {
Expand Down Expand Up @@ -496,7 +497,7 @@
"properties": "Properties",
"events": "Events",
"layout": "Layout",
"devices":"Devices",
"devices": "Devices",
"styles": "Styles",
"general": "General",
"validation": "Validation",
Expand Down Expand Up @@ -728,10 +729,10 @@
"addColumn": "Add column",
"addNewColumn": "Add new column",
"noActionMessage": "This table doesn't have any action buttons",
"horizontalAlignment":"Horizontal alignment",
"textAlignment":"Text alignment",
"deciamalPlaces":"Decimal Places",
"imageFit":"Image fit"
"horizontalAlignment": "Horizontal alignment",
"textAlignment": "Text alignment",
"deciamalPlaces": "Decimal Places",
"imageFit": "Image fit"
},
"Button": {
"displayName": "Button",
Expand Down Expand Up @@ -944,7 +945,7 @@
"typeComment": "Type your comment here"
},
"Settings": {
"text": "Settings",
"text": "Triggers",
"tip": "Global Settings",
"hideHeader": "Hide header for launched apps",
"maintenanceMode": "Maintenance mode",
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/Editor/CodeEditor/MultiLineCodeEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ const MultiLineCodeEditor = (props) => {
showPreview,
paramLabel = '',
delayOnChange = true, // Added this prop to immediately update the onBlurUpdate callback
readOnly = false,
editable = true,
} = props;

const [currentValue, setCurrentValue] = React.useState(() => initialValue);
Expand Down Expand Up @@ -252,6 +254,8 @@ const MultiLineCodeEditor = (props) => {
}}
className={`codehinter-multi-line-input`}
indentWithTab={true}
readOnly={readOnly}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bito Code Review Agent Run #46c012 - 06/14/2024, 11:19 am

🔴 High importance
Issue: The 'readOnly' and 'editable' props are both being used, which can cause confusion and potential conflicts in the component's behavior. Typically, 'readOnly' should suffice for controlling editability.
Fix: Remove the 'editable' prop and rely solely on the 'readOnly' prop to control the editability of the component.
Code suggestion

 @@ -42,8 +42,7 @@ const MultiLineCodeEditor = (props) => {
      showPreview,
      paramLabel = '',
      delayOnChange = true, // Added this prop to immediately update the onBlurUpdate callback
 -    readOnly = false,
 -    editable = true,
 +    readOnly = false,
    } = props;
const [currentValue, setCurrentValue] = React.useState(() => initialValue);

@@ -254,8 +253,7 @@ const MultiLineCodeEditor = (props) => {
overflowY: 'auto',
}}
className={'codehinter-multi-line-input'}
indentWithTab={true}

  •        readOnly={readOnly}
    
  •        editable={editable} //for transformations in query manager
    
  •        readOnly={readOnly}
         />
       </div>
       {showPreview && (
    


editable={editable} //for transformations in query manager
/>
</div>
{showPreview && (
Expand Down
23 changes: 16 additions & 7 deletions frontend/src/Editor/Components/text.scss
Original file line number Diff line number Diff line change
@@ -1,25 +1,34 @@


.reactMarkdown {
p,h1,h2,h3,h4,h5,h6 {

p,
h1,
h2,
h3,
h4,
h5,
h6 {
margin-bottom: 0px;
}
}

.text-widget-section {
scrollbar-color: transparent transparent;
scrollbar-width: thin;
&::-webkit-scrollbar {

& ::-webkit-scrollbar {
background-color: transparent;
width: 6px;
}
&::-webkit-scrollbar-track {

& ::-webkit-scrollbar-track {
background-color: transparent;
}
&::-webkit-scrollbar-thumb {

& ::-webkit-scrollbar-thumb {
background-color: transparent;
}
&:hover{

& :hover {
scrollbar-color: #a0a6ae transparent;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@ class DataSourceManagerComponent extends React.Component {
<ConfirmDialog
title={'Add datasource'}
show={dataSourceConfirmModalProps.isOpen}
message={`Do you want to add ${dataSourceConfirmModalProps?.dataSource?.name}?`}
message={`Do you want to add ${dataSourceConfirmModalProps?.dataSource?.name}`}
onConfirm={() => createSelectedDataSource(dataSourceConfirmModalProps.dataSource)}
onCancel={this.resetDataSourceConfirmModal}
confirmButtonText={'Add datasource'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const NoListItem = ({ text, dataCy = '' }) => {
borderRadius: '6px',
border: '1px dashed var(--slate5)',
color: 'var(--slate8)',
marginBottom: '8px',
}}
>
<span className="d-flex align-items-center" style={{ marginRight: '2px' }}>
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/Editor/Inspector/EventManager.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@ export const EventManager = ({

const renderAddHandlerBtn = () => {
return (
<AddNewButton onClick={addHandler} dataCy="add-event-handler" className="mt-0" isLoading={eventsCreatedLoader}>
<AddNewButton onClick={addHandler} dataCy="add-event-handler" isLoading={eventsCreatedLoader}>
{t('editor.inspector.eventManager.addHandler', 'New event handler')}
</AddNewButton>
);
Expand All @@ -1050,7 +1050,7 @@ export const EventManager = ({
return (
<>
{!hideEmptyEventsAlert && <NoListItem text={'No event handlers'} />}
{renderAddHandlerBtn()}
<div className="d-flex">{renderAddHandlerBtn()}</div>
</>
);
}
Expand All @@ -1059,7 +1059,7 @@ export const EventManager = ({

if (events.length === 0) {
return (
<>
<div className="d-flex">
{renderAddHandlerBtn()}
{!hideEmptyEventsAlert ? (
<div className="text-left">
Expand All @@ -1074,7 +1074,7 @@ export const EventManager = ({
</small>
</div>
) : null}
</>
</div>
);
}

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Editor/Inspector/ManageEventButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const ManageEventButton = ({
}) => {
const [isHovered, setIsHovered] = useState(false);
return (
<div style={{ marginBottom: '8px' }}>
<div style={{ marginBottom: '4px' }}>
<div
className="manage-event-btn border-0"
onMouseEnter={() => setIsHovered(true)}
Expand Down
61 changes: 36 additions & 25 deletions frontend/src/Editor/Inspector/manageEventButton.scss
Original file line number Diff line number Diff line change
@@ -1,29 +1,40 @@
.query-manager {
.manage-event-btn {
width: 330px;
}
}

.manage-event-btn {
border-radius: 6px;
background-color: var(--slate3);
&:hover {
background-color: var(--slate4);
}
.event-handler-text {
font-size: 12px;
line-height: 20px;
color: var(--slate12);
font-weight: 500;
}
.event-name-text {
font-size: 12px;
line-height: 20px;
color: var(--slate11);
font-weight: 400;
display: flex;
align-items: center;
}
.event-action {
border-radius: 6px;
background-color: var(--interactive-default);

&:hover {
background-color: var(--interactive-hover);
}

.event-handler-text {
font-size: 12px;
line-height: 20px;
color: var(--text-default);
font-weight: 500;
}

.event-name-text {
font-size: 12px;
line-height: 20px;
color: var(--text-default);
font-weight: 400;
display: flex;
align-items: center;
}

.event-action {
margin-right: 4px;
}
color: var(--text-placeholder);
}

.list-menu-option-btn {
margin-left: 20px;
}

.list-menu-option-btn {
margin-left: 20px;
}

}
2 changes: 1 addition & 1 deletion frontend/src/Editor/LeftSidebar/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ export const LeftSidebar = forwardRef((props, ref) => {

<ConfirmDialog
show={showLeaveDialog}
message={'The unsaved changes will be lost if you leave the editor, do you want to leave?'}
message={'The unsaved changes will be lost if you leave the editor, do you want to leave'}
onConfirm={() => router.push('/')}
onCancel={() => setShowLeaveDialog(false)}
darkMode={darkMode}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const CustomToggleSwitch = ({
<label htmlFor={action} className="slider round"></label>
</label>
{label && (
<span className={`${darkMode ? 'color-white' : 'color-light-slate-12'}`} data-cy={`${dataCy}-toggle-label`}>
<span className={`text-default`} data-cy={`${dataCy}-toggle-label`}>
{label}
</span>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,17 @@ function DataSourceSelect({ isDisabled, selectRef, closePopup }) {
</div>
)}
<DataSourceIcon source={sources?.[0]} height={16} />
<span className="ms-1 small">{dataSourcesKinds.find((dsk) => dsk.kind === kind)?.name || kind}</span>
<span className="ms-1 small" style={{ fontSize: '13px' }}>
{dataSourcesKinds.find((dsk) => dsk.kind === kind)?.name || kind}
</span>
</div>
),
options: sources.map((source) => ({
label: (
<div
key={source.id}
className="py-2 px-2 rounded option-nested-datasource-selector small text-truncate"
style={{ fontSize: '13px' }}
data-tooltip-id="tooltip-for-add-query-dd-option"
data-tooltip-content={decodeEntities(source.name)}
data-cy={`ds-${source.name.toLowerCase()}`}
Expand Down Expand Up @@ -116,7 +119,7 @@ function DataSourceSelect({ isDisabled, selectRef, closePopup }) {
label: (
<div>
<DataSourceIcon source={source} height={16} />{' '}
<span data-cy={`ds-${source.name.toLowerCase()}`} className="ms-1 small">
<span data-cy={`ds-${source.name.toLowerCase()}`} className="ms-1 small" style={{ fontSize: '13px' }}>
{source.name}
</span>
</div>
Expand Down
15 changes: 8 additions & 7 deletions frontend/src/Editor/QueryManager/Components/ParameterDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,15 @@ const ParameterDetails = ({ darkMode, onSubmit, isEdit, name, defaultValue, onRe
) : (
<button
onClick={() => setShowModal((show) => !show)}
className="ms-2"
className=""
id="runjs-param-add-btn"
data-cy="runjs-add-param-button"
style={{ background: 'none' }}
data-cy={`runjs-add-param-button`}
style={{ background: 'none', border: 'none' }}
>
<span className="m-0">
<PlusRectangle fill={darkMode ? '#9BA1A6' : '#687076'} width={15} />
</span>
<p className="m-0 text-default">
<PlusRectangle fill={'var(--icons-default)'} width={15} />
<span style={{ marginLeft: '6px' }}>Add</span>
</p>
</button>
)}
</span>
Expand All @@ -101,7 +102,7 @@ export const PillButton = ({ name, onClick, onRemove, marginBottom, className, s
<ButtonGroup
aria-label="Parameter"
className={cx({ 'mb-2': marginBottom, ...(className && { [className]: true }) })}
style={{ borderRadius: '6px', marginLeft: '6px', height: '24px', background: '#A1A7AE1F' }}
style={{ borderRadius: '6px', marginRight: '6px', height: '24px', background: 'var(--interactive-default)' }}
>
<Button
size="sm"
Expand Down
9 changes: 7 additions & 2 deletions frontend/src/Editor/QueryManager/Components/ParameterList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,13 @@ const ParameterList = ({
}, [showMore]);

return (
<div className="card-header">
<p style={{ marginRight: '4px', margin: '0px' }}>Parameters</p>
<div className="d-flex">
<p
className="text-placeholder font-weight-medium"
style={{ marginRight: '16px', marginBottom: '0px', width: '140px' }}
>
Parameters
</p>
{formattedParameters
.filter((param) => param.isVisible)
.map((parameter) => {
Expand Down
Loading
Loading