From 9b16de6f4036b5b6114417ab944187fbda288bf8 Mon Sep 17 00:00:00 2001 From: at055612 <22818309+at055612@users.noreply.github.com> Date: Tue, 15 Oct 2024 10:45:47 +0100 Subject: [PATCH] gh-4527 Fix styling for Recent Items screen --- .../src/main/resources/ui/css/components.css | 5 +++++ .../client/presenter/FindResultCell.java | 13 +++++++---- .../presenter/RecentItemsPresenter.java | 22 ++++++++++++++++++- 3 files changed, 35 insertions(+), 5 deletions(-) diff --git a/stroom-app/src/main/resources/ui/css/components.css b/stroom-app/src/main/resources/ui/css/components.css index 9dbb9db9f96..384760d6093 100644 --- a/stroom-app/src/main/resources/ui/css/components.css +++ b/stroom-app/src/main/resources/ui/css/components.css @@ -2088,6 +2088,11 @@ button.main-menu svg { white-space: pre; color: var(--navigation__text-color); user-select: text; +} + +/* findCell-name is used for both Find In Content and Recent Items + so only add the margin when used in Find In Content */ +.findCell-sample + .findCell-name { margin-left: 6rem; } diff --git a/stroom-core-client/src/main/java/stroom/explorer/client/presenter/FindResultCell.java b/stroom-core-client/src/main/java/stroom/explorer/client/presenter/FindResultCell.java index ec50e593926..b5603ccb515 100644 --- a/stroom-core-client/src/main/java/stroom/explorer/client/presenter/FindResultCell.java +++ b/stroom-core-client/src/main/java/stroom/explorer/client/presenter/FindResultCell.java @@ -1,11 +1,11 @@ /* - * Copyright 2017 Crown Copyright + * Copyright 2024 Crown Copyright * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -59,8 +59,10 @@ public void render(final Context context, final FindResult value, final SafeHtml } // Add name - main.append(template.div(getCellClassName() + "-name", - SafeHtmlUtil.from(docRef.getName()))); + final String name = docRef.getName(); + main.append(template.divWithTitle(getCellClassName() + "-name", + value.getPath() + " / " + name, + SafeHtmlUtil.from(name))); row.append(template.div(getCellClassName() + "-main", main.toSafeHtml())); @@ -90,5 +92,8 @@ public interface Template extends SafeHtmlTemplates { @Template("
{1}
") SafeHtml div(String className, SafeHtml content); + + @Template("
{2}
") + SafeHtml divWithTitle(String className, String title, SafeHtml content); } } diff --git a/stroom-core-client/src/main/java/stroom/explorer/client/presenter/RecentItemsPresenter.java b/stroom-core-client/src/main/java/stroom/explorer/client/presenter/RecentItemsPresenter.java index 5caf7debf1a..24f25c52e67 100644 --- a/stroom-core-client/src/main/java/stroom/explorer/client/presenter/RecentItemsPresenter.java +++ b/stroom-core-client/src/main/java/stroom/explorer/client/presenter/RecentItemsPresenter.java @@ -1,3 +1,19 @@ +/* + * Copyright 2024 Crown Copyright + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package stroom.explorer.client.presenter; import stroom.data.grid.client.PagerView; @@ -41,7 +57,7 @@ public void onShowRecentItems(final ShowRecentItemsEvent event) { showing = true; focusText = true; refresh(); - final PopupSize popupSize = PopupSize.resizable(800, 600); + final PopupSize popupSize = PopupSize.resizable(800, 800); ShowPopupEvent.builder(this) .popupType(PopupType.CLOSE_DIALOG) .popupSize(popupSize) @@ -61,6 +77,10 @@ protected void updateFilter(final ExplorerTreeFilterBuilder explorerTreeFilterBu explorerTreeFilterBuilder.setNameFilter(explorerTreeFilterBuilder.build().getNameFilter(), true); } + + // -------------------------------------------------------------------------------- + + @ProxyCodeSplit public interface RecentItemsProxy extends Proxy {