mirror of https://github.com/portainer/portainer
feat(teams): teams page css UI update. (#7402)
* feat(teams): teams page css UI update. * feat(teams): added `required` attr to team name field * feat(teams): fixed remove and search bar position * feat(teams): fixed CreateTeamForm unit testpull/7429/head
parent
dfb398d091
commit
78ce176268
|
@ -2,38 +2,51 @@
|
||||||
<rd-widget>
|
<rd-widget>
|
||||||
<rd-widget-body classes="no-padding">
|
<rd-widget-body classes="no-padding">
|
||||||
<div class="toolBar">
|
<div class="toolBar">
|
||||||
<div class="toolBarTitle"> <i class="fa" ng-class="$ctrl.titleIcon" aria-hidden="true" style="margin-right: 2px"></i> {{ $ctrl.titleText }} </div>
|
<div class="toolBarTitle vertical-center">
|
||||||
</div>
|
<pr-icon icon="$ctrl.titleIcon" feather="true" class-name="'icon-white icon-primary icon-nested-blue'"></pr-icon>
|
||||||
<div class="actionBar" ng-show="$ctrl.isAdmin">
|
{{ $ctrl.titleText }}
|
||||||
<button type="button" class="btn btn-sm btn-danger" ng-disabled="$ctrl.state.selectedItemCount === 0" ng-click="$ctrl.removeAction($ctrl.state.selectedItems)">
|
</div>
|
||||||
<i class="fa fa-trash-alt space-right" aria-hidden="true"></i>Remove
|
<div class="searchBar vertical-center">
|
||||||
</button>
|
<pr-icon icon="'search'" feather="true"></pr-icon>
|
||||||
</div>
|
<input
|
||||||
<div class="searchBar">
|
type="text"
|
||||||
<i class="fa fa-search searchIcon" aria-hidden="true"></i>
|
class="searchInput"
|
||||||
<input
|
ng-model="$ctrl.state.textFilter"
|
||||||
type="text"
|
ng-change="$ctrl.onTextFilterChange()"
|
||||||
class="searchInput"
|
placeholder="Search..."
|
||||||
ng-model="$ctrl.state.textFilter"
|
ng-model-options="{ debounce: 300 }"
|
||||||
ng-change="$ctrl.onTextFilterChange()"
|
/>
|
||||||
placeholder="Search..."
|
</div>
|
||||||
ng-model-options="{ debounce: 300 }"
|
<div class="actionBar" ng-show="$ctrl.isAdmin">
|
||||||
/>
|
<button
|
||||||
|
type="button"
|
||||||
|
class="btn btn-sm btn-dangerlight vertical-center"
|
||||||
|
ng-disabled="$ctrl.state.selectedItemCount === 0"
|
||||||
|
ng-click="$ctrl.removeAction($ctrl.state.selectedItems)"
|
||||||
|
>
|
||||||
|
<pr-icon icon="'trash-2'" feather="true"></pr-icon>
|
||||||
|
Remove
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table table-hover nowrap-cells">
|
<table class="table table-hover nowrap-cells">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>
|
<th>
|
||||||
<span class="md-checkbox" ng-show="$ctrl.isAdmin">
|
<div class="vertical-center">
|
||||||
<input id="select_all" type="checkbox" ng-model="$ctrl.state.selectAll" ng-change="$ctrl.selectAll()" />
|
<span class="md-checkbox">
|
||||||
<label for="select_all"></label>
|
<input id="select_all" type="checkbox" ng-model="$ctrl.state.selectAll" ng-change="$ctrl.selectAll()" />
|
||||||
</span>
|
<label for="select_all"></label>
|
||||||
<a ng-click="$ctrl.changeOrderBy('Name')">
|
</span>
|
||||||
Name
|
<table-column-header
|
||||||
<i class="fa fa-sort-alpha-down" aria-hidden="true" ng-if="$ctrl.state.orderBy === 'Name' && !$ctrl.state.reverseOrder"></i>
|
col-title="'Name'"
|
||||||
<i class="fa fa-sort-alpha-up" aria-hidden="true" ng-if="$ctrl.state.orderBy === 'Name' && $ctrl.state.reverseOrder"></i>
|
can-sort="true"
|
||||||
</a>
|
is-sorted="$ctrl.state.orderBy === 'Name'"
|
||||||
|
is-sorted-desc="$ctrl.state.orderBy === 'Name' && $ctrl.state.reverseOrder"
|
||||||
|
ng-click="$ctrl.changeOrderBy('Name')"
|
||||||
|
></table-column-header>
|
||||||
|
</div>
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
@ -64,7 +77,7 @@
|
||||||
<div class="paginationControls">
|
<div class="paginationControls">
|
||||||
<form class="form-inline">
|
<form class="form-inline">
|
||||||
<span class="limitSelector">
|
<span class="limitSelector">
|
||||||
<span style="margin-right: 5px"> Items per page </span>
|
<span class="space-right"> Items per page </span>
|
||||||
<select class="form-control" ng-model="$ctrl.state.paginatedItemLimit" ng-change="$ctrl.changePaginationLimit()" data-cy="component-paginationSelect">
|
<select class="form-control" ng-model="$ctrl.state.paginatedItemLimit" ng-change="$ctrl.changePaginationLimit()" data-cy="component-paginationSelect">
|
||||||
<option value="0">All</option>
|
<option value="0">All</option>
|
||||||
<option value="10">10</option>
|
<option value="10">10</option>
|
||||||
|
|
|
@ -12,7 +12,7 @@ test('filling the name should make the submit button clickable and emptying it s
|
||||||
const button = await findByText('Create team');
|
const button = await findByText('Create team');
|
||||||
expect(button).toBeVisible();
|
expect(button).toBeVisible();
|
||||||
|
|
||||||
const nameField = await findByLabelText('Name');
|
const nameField = await findByLabelText('Name*');
|
||||||
expect(nameField).toBeVisible();
|
expect(nameField).toBeVisible();
|
||||||
expect(nameField).toHaveDisplayValue('');
|
expect(nameField).toHaveDisplayValue('');
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { Formik, Field, Form } from 'formik';
|
import { Formik, Field, Form } from 'formik';
|
||||||
|
|
||||||
import { UserViewModel } from '@/portainer/models/user';
|
import { UserViewModel } from '@/portainer/models/user';
|
||||||
|
import { Icon } from '@/react/components/Icon';
|
||||||
import { TeamViewModel } from '@/portainer/models/team';
|
import { TeamViewModel } from '@/portainer/models/team';
|
||||||
|
|
||||||
import { FormControl } from '@@/form-components/FormControl';
|
import { FormControl } from '@@/form-components/FormControl';
|
||||||
|
@ -32,7 +33,12 @@ export function CreateTeamForm({ users, teams, onSubmit }: Props) {
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<div className="col-lg-12 col-md-12 col-xs-12">
|
<div className="col-lg-12 col-md-12 col-xs-12">
|
||||||
<Widget>
|
<Widget>
|
||||||
<WidgetTitle icon="fa-plus" title="Add a new team" />
|
<WidgetTitle
|
||||||
|
icon="plus"
|
||||||
|
title="Add a new team"
|
||||||
|
featherIcon
|
||||||
|
className="vertical-center"
|
||||||
|
/>
|
||||||
<WidgetBody>
|
<WidgetBody>
|
||||||
<Formik
|
<Formik
|
||||||
initialValues={initialValues}
|
initialValues={initialValues}
|
||||||
|
@ -57,6 +63,7 @@ export function CreateTeamForm({ users, teams, onSubmit }: Props) {
|
||||||
inputId="team_name"
|
inputId="team_name"
|
||||||
label="Name"
|
label="Name"
|
||||||
errors={errors.name}
|
errors={errors.name}
|
||||||
|
required
|
||||||
>
|
>
|
||||||
<Field
|
<Field
|
||||||
as={Input}
|
as={Input}
|
||||||
|
@ -96,10 +103,7 @@ export function CreateTeamForm({ users, teams, onSubmit }: Props) {
|
||||||
isLoading={isSubmitting}
|
isLoading={isSubmitting}
|
||||||
loadingText="Creating team..."
|
loadingText="Creating team..."
|
||||||
>
|
>
|
||||||
<i
|
<Icon icon="plus" feather size="md" />
|
||||||
className="fa fa-plus space-right"
|
|
||||||
aria-hidden="true"
|
|
||||||
/>
|
|
||||||
Create team
|
Create team
|
||||||
</LoadingButton>
|
</LoadingButton>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -4,6 +4,6 @@
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<teams-datatable title-text="Teams" title-icon="fa-users" dataset="teams" table-key="teams" order-by="Name" remove-action="removeAction" is-admin="isAdmin"></teams-datatable>
|
<teams-datatable title-text="Teams" title-icon="users" dataset="teams" table-key="teams" order-by="Name" remove-action="removeAction" is-admin="isAdmin"></teams-datatable>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue