Skip to content

[ui-sb] Port sb from mako based to pure frontend #4129

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

Merged
merged 3 commits into from
May 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
27 changes: 0 additions & 27 deletions apps/filebrowser/src/filebrowser/templates/storage_browser.mako

This file was deleted.

1 change: 0 additions & 1 deletion apps/filebrowser/src/filebrowser/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

# Catch-all for viewing a file (display) or a directory (listdir)
re_path(r'^view=(?P<path>.*)$', filebrowser_views.view, name='filebrowser.views.view'),
re_path(r'^new$', filebrowser_views.view_new, name='filebrowser.views.new_view'),

re_path(r'^listdir=(?P<path>.*)$', filebrowser_views.listdir, name='listdir'),
re_path(r'^display=(?P<path>.*)$', filebrowser_views.display, name='display'),
Expand Down
4 changes: 0 additions & 4 deletions apps/filebrowser/src/filebrowser/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,6 @@ def download(request, path):
return response


def view_new(request):
return render('storage_browser.mako', request, None)


def view(request, path):
"""Dispatches viewing of a path to either index() or fileview(), depending on type."""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,3 @@
overflow: auto;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,34 @@
// limitations under the License.

@use 'variables' as vars;

.hue-storage-browser__root-container {
height: 100%;
}
@use 'mixins';

.hue-storage-browser.antd.cuix {
display: flex;
flex-direction: column;
flex: 1;
height: 100%;
min-width: 300px;
@include mixins.fillAbsolute;
@include mixins.flexRowLayout;

.ant-spin-nested-loading {
height: 100%;

.ant-spin-container {
height: 100%;
}
}
min-width: 300px;

.hue-storage-browser__tab {
display: flex;
.hue-storage-browser__container {
height: 100%;
background-color: vars.$fluidx-gray-100;
overflow: auto;
padding: 0 16px;
background-color: vars.$fluidx-gray-100;

.ant-tabs-content-holder {
.hue-storage-browser__tab {
display: flex;
flex: 1;
height: 100%;

.ant-tabs-content,
.ant-tabs-tabpane-active {
.ant-tabs-content-holder {
display: flex;
flex-direction: column;
flex: 1;

.ant-tabs-content,
.ant-tabs-tabpane-active {
display: flex;
flex-direction: column;
flex: 1;
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,20 @@ const StorageBrowserPage = (): JSX.Element => {
return (
<div className="hue-storage-browser cuix antd">
<CommonHeader title={t('Storage Browser')} icon={<DataBrowserIcon />} />
<LoadingErrorWrapper loading={loading} errors={errorConfig}>
<Tabs
className="hue-storage-browser__tab"
destroyInactiveTabPane
defaultActiveKey={urlFileSystem ?? data?.[0]?.name}
items={data?.map(fileSystem => ({
label: fileSystem.name.toUpperCase(),
key: fileSystem.name,
children: <StorageBrowserTab fileSystem={fileSystem} />
}))}
/>
</LoadingErrorWrapper>
<div className="hue-storage-browser__container">
<LoadingErrorWrapper loading={loading} errors={errorConfig}>
<Tabs
className="hue-storage-browser__tab"
destroyInactiveTabPane
defaultActiveKey={urlFileSystem ?? data?.[0]?.name}
items={data?.map(fileSystem => ({
label: fileSystem.name.toUpperCase(),
key: fileSystem.name,
children: <StorageBrowserTab fileSystem={fileSystem} />
}))}
/>
</LoadingErrorWrapper>
</div>
</div>
);
};
Expand Down
27 changes: 0 additions & 27 deletions desktop/core/src/desktop/js/apps/storageBrowser/app.js

This file was deleted.

6 changes: 2 additions & 4 deletions desktop/core/src/desktop/js/components/sidebar/HueSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
mapreduce: `<i class="fa fa-fw fa-file-archive-o"></i>`,
markdown: `<svg class="hi hi-fw"><use href="#hi-markdown"></use></svg>`,
notebook: `<svg class="hi hi-fw"><use href="#hi-file-notebook"></use></svg>`,
newfilebrowser: `<svg class="hi hi-fw"><use href="#hi-data-browser"></use></svg>`,
storagebrowser: `<svg class="hi hi-fw"><use href="#hi-data-browser"></use></svg>`,
newimporter: `<svg class="hi hi-fw"><use href="#hi-data-in"></use></svg>`,
oozie: `<svg class="hi hi-fw"><use href="#hi-oozie"></use></svg>`,
'oozie-bundle': `<svg class="hi hi-fw"><use href="#hi-oozie-bundle"></use></svg>`,
Expand Down Expand Up @@ -330,9 +330,6 @@
adaptedName = 'hdfs';
}
break;
case 'newfilebrowser':
adaptedName = 'newfilebrowser';
break;
case 'jobbrowser':
adaptedName = 'yarn';
break;
Expand Down Expand Up @@ -364,6 +361,7 @@
case 'hbase':
case 'importer':
case 'newimporter':
case 'storagebrowser':
case 'indexes':
case 'kafka':
break;
Expand Down
12 changes: 11 additions & 1 deletion desktop/core/src/desktop/js/onePageViewModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import getSearchParameter from 'utils/url/getSearchParameter';
import { ASSIST_GET_DATABASE_EVENT, ASSIST_GET_SOURCE_EVENT } from 'ko/components/assist/events';
import { GLOBAL_ERROR_TOPIC } from 'reactComponents/GlobalAlert/events';
import ImporterPage from '../js/apps/newimporter/ImporterPage';
import StorageBrowserPage from '../js/apps/storageBrowser/StorageBrowserPage';

class OnePageViewModel {
constructor() {
Expand Down Expand Up @@ -764,7 +765,6 @@ class OnePageViewModel {
}
},
{ url: '/filebrowser/view=*', app: 'filebrowser' },
{ url: '/filebrowser/new', app: 'newfilebrowser' },
{
url: '/filebrowser/*',
app: function () {
Expand Down Expand Up @@ -797,6 +797,16 @@ class OnePageViewModel {
});
}
},
{
url: '/storagebrowser/',
app: function () {
showReactAppPage({
appName: 'storagebrowser',
component: StorageBrowserPage,
title: 'Storage Browser'
});
}
},
{
url: '/indexer/importer/prefill/*',
app: function (ctx) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@
.antd.cuix {
.loading-error-wrapper__spinner {
// this overrides the max-height: 400px in antd library
max-height: 100% !important;
height: 100%;

.ant-spin,
.ant-spin-nested-loading {
height: 100%;
max-height: 100%;
}
}

.loading-error-wrapper__errors {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,15 @@ const LoadingErrorWrapper = ({
}: LoadingErrorWrapperProps): JSX.Element => {
if (loading) {
return (
<Spin
spinning={loading}
indicator={<SpinnerIcon size="default" />}
data-testid="loading-error-wrapper__spinner"
className="loading-error-wrapper__spinner"
>
{hideOnLoading === false && children}
</Spin>
<div className="loading-error-wrapper__spinner">
<Spin
spinning={loading}
indicator={<SpinnerIcon size="default" />}
data-testid="loading-error-wrapper__spinner"
>
{hideOnLoading === false && children}
</Spin>
</div>
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
.hue-pagination__page-size-menu-btn {
background-color: transparent;
color: vars.$fluidx-gray-700;

.icon {
vertical-align: middle;
}
}

.hue-pagination__rows-stats-display {
Expand Down
4 changes: 2 additions & 2 deletions desktop/core/src/desktop/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2015,11 +2015,11 @@ def _get_browser(self):

if ENABLE_NEW_STORAGE_BROWSER.get():
interpreters.append({
'type': 'newfilebrowser',
'type': 'storagebrowser',
'displayName': _('Storage Browser'),
'buttonName': _('Storage Browser'),
'tooltip': _('Storage Browser'),
'page': '/filebrowser/new'
'page': '/storagebrowser'
})
else:
for hdfs_connector in hdfs_connectors:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
oozie_info: { url: '/oozie/list_oozie_info', title: '${_('Oozie')}' },
jobbrowser: { url: '/jobbrowser/apps', title: '${_('Job Browser')}' },
filebrowser: { url: '/filebrowser/view=*', title: '${_('File Browser')}' },
newfilebrowser: { url: '/filebrowser/new', title: '${_('Storage Browser')}' },
home: { url: '/home*', title: '${_('Home')}' },
catalog: { url: '/catalog', title: '${_('Catalog')}' },
indexer: { url: '/indexer/indexer/', title: '${_('Indexer')}' },
Expand Down
2 changes: 0 additions & 2 deletions desktop/core/src/desktop/templates/hue.mako
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,11 @@ ${ hueIcons.symbols() }
<div id="embeddable_oozie_info" class="embeddable"></div>
<div id="embeddable_jobbrowser" class="embeddable"></div>
<div id="embeddable_filebrowser" class="embeddable"></div>
<div id="embeddable_newfilebrowser" class="embeddable hue-storage-browser__root-container"></div>
<div id="embeddable_home" class="embeddable"></div>
<div id="embeddable_catalog" class="embeddable"></div>
<div id="embeddable_indexer" class="embeddable"></div>
<div id="embeddable_kafka" class="embeddable"></div>
<div id="embeddable_importer" class="embeddable"></div>
<div id="embeddable_newimporter" class="embeddable"></div>
<div id="embeddable_collections" class="embeddable"></div>
<div id="embeddable_indexes" class="embeddable"></div>
<div id="embeddable_useradmin_users" class="embeddable"></div>
Expand Down
4 changes: 0 additions & 4 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ const config = {
import: './desktop/core/src/desktop/js/apps/tableBrowser/app.js',
dependOn: 'hue'
},
storageBrowser: {
import: './desktop/core/src/desktop/js/apps/storageBrowser/app.js',
dependOn: 'hue'
},
jobBrowser: { import: './desktop/core/src/desktop/js/apps/jobBrowser/app.js', dependOn: 'hue' }
},
mode: 'development',
Expand Down