public inbox for [email protected]  
help / color / mirror / Atom feed
[pgAdmin][RM7255]:Update select control UI
3+ messages / 2 participants
[nested] [flat]

* [pgAdmin][RM7255]:Update select control UI
@ 2022-04-08 06:51  Pradip Parkale <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: Pradip Parkale @ 2022-04-08 06:51 UTC (permalink / raw)
  To: pgadmin-hackers

Hi Hackers,

Please find the attached for #7255. I have removed the dropdown list icon
for the empty select list.


-- 
Thanks & Regards,
Pradip Parkale
Software Engineer | EnterpriseDB Corporation


Attachments:

  [application/octet-stream] RM7255.patch (2.6K, 3-RM7255.patch)
  download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/databases/static/js/database.ui.js b/web/pgadmin/browser/server_groups/servers/databases/static/js/database.ui.js
index 5b02716d3..fbc40d0a2 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/static/js/database.ui.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/static/js/database.ui.js
@@ -198,7 +198,7 @@ export default class DatabaseSchema extends BaseUISchema {
         helpMessage: gettext('Note: Changes to the schema restriction will require the Schemas node in the browser to be refreshed before they will be shown.'),
         helpMessageMode: ['edit', 'create'],
         controlProps: {
-          multiple: true, allowClear: false, creatable: true,
+          multiple: true, allowClear: false, creatable: true, noDropdown: true
         }, depChange: (state)=>{
           if(!_.isUndefined(state.oid)) {
             obj.informText = undefined;
diff --git a/web/pgadmin/static/js/components/FormComponents.jsx b/web/pgadmin/static/js/components/FormComponents.jsx
index cec2ae439..39ba9c7da 100644
--- a/web/pgadmin/static/js/components/FormComponents.jsx
+++ b/web/pgadmin/static/js/components/FormComponents.jsx
@@ -774,6 +774,18 @@ CustomSelectSingleValue.propTypes = {
   data: PropTypes.object,
 };
 
+const CustomDropDownIndicator = (props) => {
+  if (props.selectProps.isDropDown)
+    return (
+      <RSComponents.DropdownIndicator {...props} />
+    );
+  return null;
+};
+
+CustomDropDownIndicator.propTypes = {
+  selectProps: PropTypes.object,
+};
+
 export function flattenSelectOptions(options) {
   return _.flatMap(options, (option) => {
     if (option.options) {
@@ -895,6 +907,7 @@ export const InputSelect = forwardRef(({
     components: {
       Option: CustomSelectOption,
       SingleValue: CustomSelectSingleValue,
+      DropdownIndicator: CustomDropDownIndicator
     },
     isMulti: Boolean(controlProps.multiple),
     openMenuOnClick: !readonly,
@@ -906,6 +919,7 @@ export const InputSelect = forwardRef(({
     styles: styles,
     inputId: cid,
     placeholder: (readonly || disabled) ? '' : controlProps.placeholder || gettext('Select an item...'),
+    isDropDown: !controlProps.noDropdown,
     ...otherProps,
     ...props,
   };
@@ -915,7 +929,13 @@ export const InputSelect = forwardRef(({
     );
   } else {
     return (
-      <CreatableSelect ref={ref} {...commonProps} />
+      <CreatableSelect
+        ref={ref}
+        {...commonProps}
+        noOptionsMessage={() =>
+          !controlProps.noDropdown ? 'No options' : null
+        }
+      />
     );
   }
 });


^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: [pgAdmin][RM7255]:Update select control UI
@ 2022-04-08 11:41  Pradip Parkale <[email protected]>
  parent: Pradip Parkale <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: Pradip Parkale @ 2022-04-08 11:41 UTC (permalink / raw)
  To: pgadmin-hackers

Hi,
Please ignore my previous email. Please find the updated patch.

On Fri, Apr 8, 2022 at 12:21 PM Pradip Parkale <
[email protected]> wrote:

> Hi Hackers,
>
> Please find the attached for #7255. I have removed the dropdown list icon
> for the empty select list.
>
>
> --
> Thanks & Regards,
> Pradip Parkale
> Software Engineer | EnterpriseDB Corporation
>


-- 
Thanks & Regards,
Pradip Parkale
Software Engineer | EnterpriseDB Corporation


Attachments:

  [application/octet-stream] RM7255_v1.patch (2.9K, 3-RM7255_v1.patch)
  download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/databases/static/js/database.ui.js b/web/pgadmin/browser/server_groups/servers/databases/static/js/database.ui.js
index 5b02716d3..871b9db92 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/static/js/database.ui.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/static/js/database.ui.js
@@ -198,7 +198,7 @@ export default class DatabaseSchema extends BaseUISchema {
         helpMessage: gettext('Note: Changes to the schema restriction will require the Schemas node in the browser to be refreshed before they will be shown.'),
         helpMessageMode: ['edit', 'create'],
         controlProps: {
-          multiple: true, allowClear: false, creatable: true,
+          multiple: true, allowClear: false, creatable: true, noDropdown: true, placeholder: 'Specify the schemas to be restrict...'
         }, depChange: (state)=>{
           if(!_.isUndefined(state.oid)) {
             obj.informText = undefined;
diff --git a/web/pgadmin/browser/server_groups/servers/static/js/server.ui.js b/web/pgadmin/browser/server_groups/servers/static/js/server.ui.js
index f788c621e..f25986de0 100644
--- a/web/pgadmin/browser/server_groups/servers/static/js/server.ui.js
+++ b/web/pgadmin/browser/server_groups/servers/static/js/server.ui.js
@@ -415,7 +415,7 @@ export default class ServerSchema extends BaseUISchema {
         id: 'db_res', label: gettext('DB restriction'), type: 'select', group: gettext('Advanced'),
         options: [],
         mode: ['properties', 'edit', 'create'], readonly: obj.isConnected, controlProps: {
-          multiple: true, allowClear: false, creatable: true, noDropdown: true},
+          multiple: true, allowClear: false, creatable: true, noDropdown: true, placeholder: 'Specify the databases to be restrict...'},
       },
       {
         id: 'passfile', label: gettext('Password file'), type: 'file',
diff --git a/web/pgadmin/static/js/components/FormComponents.jsx b/web/pgadmin/static/js/components/FormComponents.jsx
index cec2ae439..744a8a764 100644
--- a/web/pgadmin/static/js/components/FormComponents.jsx
+++ b/web/pgadmin/static/js/components/FormComponents.jsx
@@ -895,6 +895,8 @@ export const InputSelect = forwardRef(({
     components: {
       Option: CustomSelectOption,
       SingleValue: CustomSelectSingleValue,
+      IndicatorSeparator: (props) => controlProps.noDropdown ? null: <RSComponents.IndicatorSeparator {...props} />,
+      DropdownIndicator: (props) => controlProps.noDropdown ? null: <RSComponents.DropdownIndicator {...props} />
     },
     isMulti: Boolean(controlProps.multiple),
     openMenuOnClick: !readonly,
@@ -915,7 +917,13 @@ export const InputSelect = forwardRef(({
     );
   } else {
     return (
-      <CreatableSelect ref={ref} {...commonProps} />
+      <CreatableSelect
+        ref={ref}
+        {...commonProps}
+        noOptionsMessage={() =>
+          !controlProps.noDropdown ? 'No options' : null
+        }
+      />
     );
   }
 });


^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: [pgAdmin][RM7255]:Update select control UI
@ 2022-04-09 06:36  Akshay Joshi <[email protected]>
  parent: Pradip Parkale <[email protected]>
  0 siblings, 0 replies; 3+ messages in thread

From: Akshay Joshi @ 2022-04-09 06:36 UTC (permalink / raw)
  To: Pradip Parkale <[email protected]>; +Cc: pgadmin-hackers

Thanks, the patch applied.

On Fri, Apr 8, 2022 at 5:12 PM Pradip Parkale <
[email protected]> wrote:

> Hi,
> Please ignore my previous email. Please find the updated patch.
>
> On Fri, Apr 8, 2022 at 12:21 PM Pradip Parkale <
> [email protected]> wrote:
>
>> Hi Hackers,
>>
>> Please find the attached for #7255. I have removed the dropdown list icon
>> for the empty select list.
>>
>>
>> --
>> Thanks & Regards,
>> Pradip Parkale
>> Software Engineer | EnterpriseDB Corporation
>>
>
>
> --
> Thanks & Regards,
> Pradip Parkale
> Software Engineer | EnterpriseDB Corporation
>


-- 
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Principal Software Architect*
*EDB Postgres <http://edbpostgres.com>*

*Mobile: +91 976-788-8246*


^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2022-04-09 06:36 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-04-08 06:51 [pgAdmin][RM7255]:Update select control UI Pradip Parkale <[email protected]>
2022-04-08 11:41 ` Pradip Parkale <[email protected]>
2022-04-09 06:36   ` Akshay Joshi <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox