(pgBrowser, serverInformation)
| 297 | } |
| 298 | |
| 299 | export function hasBinariesConfiguration(pgBrowser, serverInformation) { |
| 300 | const module = 'paths'; |
| 301 | let preference_name = 'pg_bin_dir'; |
| 302 | let msg = gettext('Please configure the PostgreSQL Binary Path in the Preferences.'); |
| 303 | |
| 304 | if ((serverInformation.type && serverInformation.type === 'ppas') || |
| 305 | serverInformation.server_type === 'ppas') { |
| 306 | preference_name = 'ppas_bin_dir'; |
| 307 | msg = gettext('Please configure the EDB Advanced Server Binary Path in the Preferences.'); |
| 308 | } |
| 309 | |
| 310 | const preference = usePreferences.getState().getPreferences(module, preference_name); |
| 311 | |
| 312 | if (preference) { |
| 313 | if (_.isUndefined(preference.value) || !checkBinaryPathExists(preference.value, serverInformation.version)) { |
| 314 | pgAdmin.Browser.notifier.alert(gettext('Configuration required'), msg); |
| 315 | return false; |
| 316 | } |
| 317 | } else { |
| 318 | pgAdmin.Browser.notifier.alert( |
| 319 | gettext('Preferences Error'), |
| 320 | gettext('Failed to load preference %s of module %s', preference_name, module) |
| 321 | ); |
| 322 | return false; |
| 323 | } |
| 324 | return true; |
| 325 | } |
| 326 | |
| 327 | function checkBinaryPathExists(binaryPathArray, selectedServerVersion) { |
| 328 | let foundDefaultPath = false, |
no test coverage detected