Skip to content

Commit

Permalink
Warn if there is only one member in publisher (dart-lang#7386)
Browse files Browse the repository at this point in the history
  • Loading branch information
sigurdm authored Jan 22, 2024
1 parent 9b0b6e1 commit 11d293d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/lib/frontend/templates/views/publisher/admin_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ d.Node publisherAdminPageNode({
),
),
d.h2(text: 'Members'),
if (members.length == 1)
d.p(
text: 'This publisher only has a single member. '
'Consider adding more members to protect against losing control of the publisher.',
classes: ['warning'],
),
material.dataTable<api.PublisherMember>(
id: '-pub-publisher-admin-members-table',
ariaLabel: 'Members of publisher',
Expand Down
1 change: 1 addition & 0 deletions app/test/frontend/golden/publisher_admin_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ <h2>Publisher information</h2>
<button id="-publisher-update-button" class="mdc-button mdc-button--raised" data-mdc-auto-init="MDCRipple">Update</button>
</div>
<h2>Members</h2>
<p class="warning">This publisher only has a single member. Consider adding more members to protect against losing control of the publisher.</p>
<div id="-pub-publisher-admin-members-table" class="mdc-data-table">
<table class="mdc-data-table__table" aria-label="Members of publisher">
<thead>
Expand Down
5 changes: 5 additions & 0 deletions pkg/web_css/lib/src/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ p {
font-size: 16px;
}

p.warning {
border-left: 0.25em solid $color-input-danger;
padding-left: 10px;
}

body,
.markdown-body {
font-weight: 400;
Expand Down

0 comments on commit 11d293d

Please sign in to comment.