public inbox for [email protected]  
help / color / mirror / Atom feed
From: Pradip Parkale <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: Re: [pgAdmin][RM7255]:Update select control UI
Date: Fri, 8 Apr 2022 17:11:56 +0530
Message-ID: <CAJ9T6Sup5Q0Jvf2nZR4B_dPxW+n_wb+_WAdXeREc4Gw=1e3Oow@mail.gmail.com> (raw)
In-Reply-To: <CAJ9T6StpmU+rZ5AzsY4k_=m_S2ie=X4gXPb957XajtT+4guyiw@mail.gmail.com>
References: <CAJ9T6StpmU+rZ5AzsY4k_=m_S2ie=X4gXPb957XajtT+4guyiw@mail.gmail.com>

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
+        }
+      />
     );
   }
 });


view thread (3+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: [pgAdmin][RM7255]:Update select control UI
  In-Reply-To: <CAJ9T6Sup5Q0Jvf2nZR4B_dPxW+n_wb+_WAdXeREc4Gw=1e3Oow@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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