Skip to content

Commit

Permalink
Fix: search prefill and missing tab on publisher admin pages. (#7338)
Browse files Browse the repository at this point in the history
  • Loading branch information
isoos authored Jan 2, 2024
1 parent 240ab3e commit b43eacd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
7 changes: 7 additions & 0 deletions app/lib/frontend/templates/publisher.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import 'package:_pub_shared/data/page_data.dart';
import 'package:_pub_shared/data/publisher_api.dart' as api;
import 'package:_pub_shared/search/search_form.dart' show SearchForm;
import 'package:_pub_shared/search/tags.dart';

import '../../audit/models.dart';
import '../../frontend/templates/views/account/activity_log_table.dart';
Expand Down Expand Up @@ -137,6 +138,7 @@ String renderPublisherAdminPage({
}) {
final tabs = <Tab>[
_packagesLinkTab(publisher.publisherId),
_unlistedPackagesLinkTab(publisher.publisherId),
Tab.withContent(
id: 'admin',
title: 'Admin',
Expand Down Expand Up @@ -165,6 +167,8 @@ String renderPublisherAdminPage({
),
canonicalUrl: urls.publisherAdminUrl(publisher.publisherId),
noIndex: true,
searchForm: SearchForm()
.toggleRequiredTag(PackageTags.publisherTag(publisher.publisherId)),
mainClasses: [wideHeaderDetailPageClassName],
);
}
Expand All @@ -182,6 +186,7 @@ String renderPublisherActivityLogPage({
);
final tabs = <Tab>[
_packagesLinkTab(publisher.publisherId),
_unlistedPackagesLinkTab(publisher.publisherId),
_adminLinkTab(publisher.publisherId),
Tab.withContent(
id: 'activity-log',
Expand All @@ -206,6 +211,8 @@ String renderPublisherActivityLogPage({
),
canonicalUrl: urls.publisherActivityLogUrl(publisher.publisherId),
noIndex: true,
searchForm: SearchForm()
.toggleRequiredTag(PackageTags.publisherTag(publisher.publisherId)),
mainClasses: [wideHeaderDetailPageClassName],
);
}
Expand Down
5 changes: 4 additions & 1 deletion app/test/frontend/golden/publisher_activity_log_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ <h3 class="foldable-button">
<div class="_banner-bg">
<div class="container">
<form class="search-bar banner-item" action="/packages">
<input class="input" name="q" placeholder="Search packages" autocomplete="on" autofocus="autofocus" title="Search"/>
<input class="input" name="q" placeholder="Search packages" autocomplete="on" value="publisher:example.com" title="Search"/>
<span class="icon"></span>
</form>
</div>
Expand Down Expand Up @@ -144,6 +144,9 @@ <h1 class="title">example.com</h1>
<li class="detail-tab tab-link detail-tab-packages-title">
<a href="/publishers/example.com/packages" role="button">Packages</a>
</li>
<li class="detail-tab tab-link detail-tab-unlisted-packages-title">
<a href="/publishers/example.com/unlisted-packages" role="button">Unlisted packages</a>
</li>
<li class="detail-tab tab-link detail-tab-admin-title -private">
<a href="/publishers/example.com/admin" role="button">Admin</a>
</li>
Expand Down
5 changes: 4 additions & 1 deletion app/test/frontend/golden/publisher_admin_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ <h3 class="foldable-button">
<div class="_banner-bg">
<div class="container">
<form class="search-bar banner-item" action="/packages">
<input class="input" name="q" placeholder="Search packages" autocomplete="on" autofocus="autofocus" title="Search"/>
<input class="input" name="q" placeholder="Search packages" autocomplete="on" value="publisher:example.com" title="Search"/>
<span class="icon"></span>
</form>
</div>
Expand Down Expand Up @@ -144,6 +144,9 @@ <h1 class="title">example.com</h1>
<li class="detail-tab tab-link detail-tab-packages-title">
<a href="/publishers/example.com/packages" role="button">Packages</a>
</li>
<li class="detail-tab tab-link detail-tab-unlisted-packages-title">
<a href="/publishers/example.com/unlisted-packages" role="button">Unlisted packages</a>
</li>
<li class="detail-tab tab-button detail-tab-admin-title -active -private">Admin</li>
<li class="detail-tab tab-link detail-tab-activity-log-title -private">
<a href="/publishers/example.com/activity-log" role="button">Activity log</a>
Expand Down

0 comments on commit b43eacd

Please sign in to comment.