Skip to content

Commit

Permalink
Merge branch 'master' into cdpd_66097
Browse files Browse the repository at this point in the history
  • Loading branch information
tarunjangid authored May 17, 2024
2 parents 03a480f + d32163f commit 71897e1
Show file tree
Hide file tree
Showing 20 changed files with 265 additions and 91 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
>
<button
class="sidebar-base-btn sidebar-sidebar-item"
:data-testid="`sidebar--${item.displayName.replace(/\s/g, '-').toLowerCase()}--button`"
:aria-label="item.displayName"
:class="{ 'sidebar-active': isActive, 'sidebar-accordion-item-btn-open': tooltip }"
@click="toggleOpen"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`ko.dropDown.js should render component 1`] = `
"<div data-bind=\\"descendantsComplete: descendantsComplete, component: { name: &quot;hue-drop-down&quot;, params: params }\\"><a class=\\"inactive-action hue-drop-down-active\\" href=\\"javascript:void(0)\\" data-bind=\\"toggle: dropDownVisible, css: { 'blue': dropDownVisible }\\">
"<div data-bind=\\"descendantsComplete: descendantsComplete, component: { name: &quot;hue-drop-down&quot;, params: params }\\"><a class=\\"inactive-action hue-drop-down-active\\" href=\\"javascript:void(0)\\" data-bind=\\"
attr: {
'data-testid': dataTestId
},
toggle: dropDownVisible,
css: { 'blue': dropDownVisible }\\">
<!-- ko if: icon --><!-- /ko -->
<!-- ko if: !noLabel && value --><!-- /ko -->
<i class=\\"fa fa-caret-down\\"></i>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ exports[`ko.fieldSamples.js should render component 1`] = `
</div>
<!-- ko if: showOperations -->
<div class=\\"context-popover-sample-controls\\">
<div class=\\"margin-left-10 inline-block\\" data-bind=\\"component: { name: 'hue-drop-down', params: { value: operation, entries: operations } }\\"><a class=\\"inactive-action hue-drop-down-active\\" href=\\"javascript:void(0)\\" data-bind=\\"toggle: dropDownVisible, css: { 'blue': dropDownVisible }\\">
<div class=\\"margin-left-10 inline-block\\" data-bind=\\"component: { name: 'hue-drop-down', params: { value: operation, entries: operations } }\\"><a class=\\"inactive-action hue-drop-down-active\\" href=\\"javascript:void(0)\\" data-bind=\\"
attr: {
'data-testid': dataTestId
},
toggle: dropDownVisible,
css: { 'blue': dropDownVisible }\\">
<!-- ko if: icon --><!-- /ko -->
<!-- ko if: !noLabel && value -->
<span class=\\"hue-drop-down-selected\\" data-bind=\\"text: value() &amp;&amp; typeof value()[labelAttribute] !== 'undefined' ? value()[labelAttribute] : value(), visible: ! dropDownVisible() || !searchable, attr: { 'title': titleTooltip }\\" title=\\"default\\">default</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,22 +292,22 @@ const TEMPLATE =
<!-- ko if: selectedSource().selectedNamespace() -->
<!-- ko if: selectedSource().selectedNamespace().selectedDatabase() -->
<a data-bind="click: back, appAwareTemplateContextMenu: { template: 'sql-context-items', viewModel: selectedSource().selectedNamespace().selectedDatabase() }">
<i class="fa fa-chevron-left assist-breadcrumb-back" ></i>
<i class="fa fa-chevron-left assist-breadcrumb-back" data-testid="assist-sql--tables-breadcrumb-back--button"></i>
<i class="fa assist-breadcrumb-text" data-bind="css: { 'fa-server': nonSqlType, 'fa-database': !nonSqlType }"></i>
<span class="assist-breadcrumb-text" data-bind="text: breadcrumb, attr: {'title': breadcrumbTitle }"></span>
</a>
<!-- /ko -->
<!-- ko ifnot: selectedSource().selectedNamespace().selectedDatabase() -->
<!-- ko if: window.HAS_MULTI_CLUSTER-->
<a data-bind="click: back">
<i class="fa fa-chevron-left assist-breadcrumb-back"></i>
<i class="fa fa-chevron-left assist-breadcrumb-back" data-testid="assist-sql--databases-breadcrumb-back--button"></i>
<i class="fa fa-snowflake-o assist-breadcrumb-text"></i>
<span class="assist-breadcrumb-text" data-bind="text: breadcrumb, attr: {'title': breadcrumbTitle }"></span>
</a>
<!-- /ko -->
<!-- ko ifnot: window.HAS_MULTI_CLUSTER -->
<a data-bind="click: back">
<i class="fa fa-chevron-left assist-breadcrumb-back"></i>
<i class="fa fa-chevron-left assist-breadcrumb-back" data-testid="assist-sql--databases-breadcrumb-back--button"></i>
<i class="fa fa-server assist-breadcrumb-text"></i>
<span class="assist-breadcrumb-text" data-bind="text: breadcrumb"></span>
</a>
Expand All @@ -316,7 +316,7 @@ const TEMPLATE =
<!-- /ko -->
<!-- ko ifnot: selectedSource().selectedNamespace() -->
<a data-bind="click: back">
<i class="fa fa-chevron-left assist-breadcrumb-back"></i>
<i class="fa fa-chevron-left assist-breadcrumb-back" data-testid="assist-sql--namespaces-breadcrumb-back--button"></i>
<i class="fa fa-server assist-breadcrumb-text"></i>
<span class="assist-breadcrumb-text" data-bind="text: breadcrumb"></span>
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ const TEMPLATE = `
</li>
</ul>
</span>
<a class="inactive-action" href="javascript:void(0)" data-bind="click: function () { huePubSub.publish('${ REFRESH_DOC_ASSIST_EVENT }'); }"><i class="pointer fa fa-refresh" data-bind="css: { 'fa-spin blue' : loading }" title="${I18n(
<a class="inactive-action" href="javascript:void(0)" data-bind="click: function () { huePubSub.publish('${ REFRESH_DOC_ASSIST_EVENT }'); }"><i class="pointer fa fa-refresh" data-testid="assist-sql--refresh--button" data-bind="css: { 'fa-spin blue' : loading }" title="${I18n(
'Manual refresh'
)}"></i></a>
</div>
Expand All @@ -189,7 +189,7 @@ const TEMPLATE = `
<div class="assist-flex-search">
<div class="assist-filter">
<form autocomplete="off">
<input class="clearable" type="text" ${ window.PREVENT_AUTOFILL_INPUT_ATTRS } placeholder="${I18n(
<input class="clearable" data-testid="assist-documents--filter--input" type="text" ${ window.PREVENT_AUTOFILL_INPUT_ATTRS } placeholder="${I18n(
'Filter...'
)}" data-bind="clearable: filter, value: filter, valueUpdate: 'afterkeydown'"/>
</form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const TEMPLATE = `
<div class="assist-flex-search">
<div class="assist-filter">
<form autocomplete="off">
<input class="clearable" type="text" ${ window.PREVENT_AUTOFILL_INPUT_ATTRS } placeholder="Filter..." data-bind="clearable: query, value: query, valueUpdate: 'afterkeydown'">
<input class="clearable" data-testid="assist-udfs--filter--input" type="text" ${ window.PREVENT_AUTOFILL_INPUT_ATTRS } placeholder="Filter..." data-bind="clearable: query, value: query, valueUpdate: 'afterkeydown'">
</form>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const TEMPLATE = `
<script type="text/html" id="assist-git-header-actions">
<div class="assist-db-header-actions">
<a class="inactive-action" href="javascript:void(0)" data-bind="click: function () { huePubSub.publish('assist.git.refresh'); }"><i class="pointer fa fa-refresh" data-bind="css: { 'fa-spin blue' : loading }" title="${I18n(
<a class="inactive-action" href="javascript:void(0)" data-bind="click: function () { huePubSub.publish('assist.git.refresh'); }"><i class="pointer fa fa-refresh" data-testid="assist-sql--refresh--button" data-bind="css: { 'fa-spin blue' : loading }" title="${I18n(
'Manual refresh'
)}"></i></a>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const TEMPLATE = `
<script type="text/html" id="assist-hbase-header-actions">
<div class="assist-db-header-actions">
<a class="inactive-action" href="javascript:void(0)" data-bind="click: function () { huePubSub.publish('assist.hbase.refresh'); }"><i class="pointer fa fa-refresh" data-bind="css: { 'fa-spin blue' : loading }" title="${I18n(
<a class="inactive-action" href="javascript:void(0)" data-bind="click: function () { huePubSub.publish('assist.hbase.refresh'); }"><i class="pointer fa fa-refresh" data-testid="assist-sql--refresh--button" data-bind="css: { 'fa-spin blue' : loading }" title="${I18n(
'Manual refresh'
)}"></i></a>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const TEMPLATE = `
<div class="assist-flex-search">
<div class="assist-filter">
<form autocomplete="off">
<input class="clearable" type="text" ${ window.PREVENT_AUTOFILL_INPUT_ATTRS } placeholder="Filter..." data-bind="clearable: query, value: query, valueUpdate: 'afterkeydown'">
<input class="clearable" data-testid="assist-langref--filter--input" type="text" ${ window.PREVENT_AUTOFILL_INPUT_ATTRS } placeholder="Filter..." data-bind="clearable: query, value: query, valueUpdate: 'afterkeydown'">
</form>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const TEMPLATE = `
<!-- ko if: availablePanels().length > 1 -->
<div class="assist-panel-switches">
<!-- ko foreach: availablePanels -->
<div class="inactive-action assist-type-switch" data-bind="click: function () { $parent.visiblePanel($data); }, css: { 'blue': $parent.visiblePanel() === $data }, style: { 'float': rightAlignIcon ? 'right' : 'left' }, attr: { 'title': name }">
<div class="inactive-action assist-type-switch" data-bind="click: function () { $parent.visiblePanel($data); }, css: { 'blue': $parent.visiblePanel() === $data }, style: { 'float': rightAlignIcon ? 'right' : 'left' }, attr: { 'title': name, 'data-testid': 'assist--' + type + '--button' }">
<!-- ko if: iconSvg --><span style="font-size:22px;"><svg class="hi"><use data-bind="attr: {'href': iconSvg }" href=''></use></svg></span><!-- /ko -->
<!-- ko if: !iconSvg --><i class="fa fa-fw valign-middle" data-bind="css: icon"></i><!-- /ko -->
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const TEMPLATE = `
<!-- /ko -->
<a class="inactive-action" href="javascript:void(0)" data-bind="click: function () { huePubSub.publish('assist.storage.refresh'); }" title="${I18n(
'Manual refresh'
)}"><i class="pointer fa fa-refresh" data-bind="css: { 'fa-spin blue' : loading }"></i></a>
)}"><i class="pointer fa fa-refresh" data-testid="assist-sql--refresh--button" data-bind="css: { 'fa-spin blue' : loading }"></i></a>
</div>
</script>
Expand Down Expand Up @@ -133,7 +133,7 @@ const TEMPLATE = `
<div class="assist-flex-search">
<div class="assist-filter">
<form autocomplete="off">
<input class="clearable" type="text" placeholder="${I18n(
<input class="clearable" data-testid="assist-files--filter--input" type="text" placeholder="${I18n(
'Filter...'
)}" ${ window.PREVENT_AUTOFILL_INPUT_ATTRS }
data-bind="clearable: filter, value: filter, valueUpdate: 'afterkeydown'"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ exports[`ko.linkSharing.js should render component activated 1`] = `
onSelect: changePerm.bind($data)
}
}
\\"><a class=\\"inactive-action hue-drop-down-active\\" href=\\"javascript:void(0)\\" data-bind=\\"toggle: dropDownVisible, css: { 'blue': dropDownVisible }\\">
\\"><a class=\\"inactive-action hue-drop-down-active\\" href=\\"javascript:void(0)\\" data-bind=\\"
attr: {
'data-testid': dataTestId
},
toggle: dropDownVisible,
css: { 'blue': dropDownVisible }\\">
<!-- ko if: icon --><!-- /ko -->
<!-- ko if: !noLabel && value -->
<span class=\\"hue-drop-down-selected\\" data-bind=\\"text: value() &amp;&amp; typeof value()[labelAttribute] !== 'undefined' ? value()[labelAttribute] : value(), visible: ! dropDownVisible() || !searchable, attr: { 'title': titleTooltip }\\" title=\\"read\\">read</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const TEMPLATE = `
<!-- ko if: window.getLastKnownConfig().has_computes && !hideLabels --><span class="editor-header-title">${I18n(
'Active database'
)}</span><!-- /ko -->
<div data-bind="component: { name: 'hue-drop-down', params: { titleName: 'Database', value: database, entries: availableDatabases, foreachVisible: true, searchable: true, linkTitle: '${I18n(
<div data-bind="component: { name: 'hue-drop-down', params: { dataTestId: 'editor--database-selection--dropdown', titleName: 'Database', value: database, entries: availableDatabases, foreachVisible: true, searchable: true, linkTitle: '${I18n(
'Active database'
)}' } }" style="display: inline-block"></div>
<!-- /ko -->
Expand Down
8 changes: 7 additions & 1 deletion desktop/core/src/desktop/js/ko/components/ko.dropDown.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ export const HUE_DROP_DOWN_COMPONENT = 'hue-drop-down';

const TEMPLATE = `
<!-- ko if: !menuOnly && (!dropDownVisible() || !searchable) -->
<a class="inactive-action hue-drop-down-active" href="javascript:void(0)" data-bind="toggle: dropDownVisible, css: { 'blue': dropDownVisible }">
<a class="inactive-action hue-drop-down-active" href="javascript:void(0)" data-bind="
attr: {
'data-testid': dataTestId
},
toggle: dropDownVisible,
css: { 'blue': dropDownVisible }">
<!-- ko if: icon --><i class="fa" data-bind="css: icon"></i><!-- /ko -->
<!-- ko if: !noLabel && value -->
<span class="hue-drop-down-selected" data-bind="text: value() && typeof value()[labelAttribute] !== 'undefined' ? value()[labelAttribute] : value(), visible: ! dropDownVisible() || !searchable, attr: { 'title': titleTooltip }" ></span>
Expand Down Expand Up @@ -157,6 +162,7 @@ class HueDropDown {
self.dropDownVisible = ko.observable(!!params.showOnInit);
self.menuOnly = !!params.menuOnly;
self.noLabel = !!params.noLabel;
self.dataTestId = params.dataTestId;
self.labelAttribute = params.labelAttribute || 'label';
self.icon = params.icon;
self.value = params.value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ done
set +x
if [ $exit_status == 0 ]
then
encoded_output_dir=`python -c "import urllib;print urllib.quote(raw_input())" <<< "$temp_output_dir/$ARCHIVE_NAME"`
encoded_output_dir=`python -c "import urllib.parse;print(urllib.parse.quote(input()))" <<< "$temp_output_dir/$ARCHIVE_NAME"`
echo "Copying $encoded_output_dir to '$UPLOAD_PATH' in HDFS"
hadoop fs -put -f $encoded_output_dir "$UPLOAD_PATH"
exit_status=$(echo $?)
Expand All @@ -111,4 +111,4 @@ then
exit_status = $failed
fi

exit $exit_status
exit $exit_status
Loading

0 comments on commit 71897e1

Please sign in to comment.