Skip to content
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

Fixing tag issues #3006

Merged
merged 3 commits into from
Nov 7, 2018
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
138 changes: 78 additions & 60 deletions client/app/assets/less/inc/list-group.less
Original file line number Diff line number Diff line change
@@ -1,60 +1,78 @@
.list-group {
margin-bottom: 0;

&.lg-alt .list-group-item {
border: 0;
}

&:not(.lg-alt) {
&.lg-listview .list-group-item {
border-left: 0;
border-right: 0;

&:last-child {
border-bottom: 0;
}
}
}
}

.list-group-item {
&.active {
button {
color: white;
}
}
.cr-alt {
line-height: 100%;
margin-top: 2px;
}
}

.list-group-item-heading {
margin-bottom: 2px;
color: #333;

& > small {
font-size: 11px;
color: #C5C5C5;
margin-left: 10px;
}
}

.list-group-item-heading,
.list-group-item-text {
.text-overflow();
}

.list-group-item-text {
display: block;

&:not(:last-child) {
margin-bottom: 4px;
}
}

.list-group-img {
width: 38px;
height: 38px;
border-radius: 2px;
}
.list-group {
margin-bottom: 0;

&.lg-alt .list-group-item {
border: 0;
}

&:not(.lg-alt) {
&.lg-listview .list-group-item {
border-left: 0;
border-right: 0;

&:last-child {
border-bottom: 0;
}
}
}
}

tags-list {
a {
line-height: 1.1;
}
}

.tags-list__name {
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
width: 88%;
line-height: 1.3;
}

.max-character {
.text-overflow();
}

.list-group-item {
&.active {
button {
color: white;
}
}
.cr-alt {
line-height: 100%;
margin-top: 2px;
}
}

.list-group-item-heading {
margin-bottom: 2px;
color: #333;

& > small {
font-size: 11px;
color: #C5C5C5;
margin-left: 10px;
}
}

.list-group-item-heading,
.list-group-item-text {
.text-overflow();
}

.list-group-item-text {
display: block;

&:not(:last-child) {
margin-bottom: 4px;
}
}

.list-group-img {
width: 38px;
height: 38px;
border-radius: 2px;
}
11 changes: 11 additions & 0 deletions client/app/assets/less/redash/redash-newstyle.less
Original file line number Diff line number Diff line change
Expand Up @@ -449,10 +449,20 @@ page-header, .page-header--new {
background: fade(@redash-gray, 85%);
}

.label-default-unpublished {
background: fade(@redash-gray, 85%);
display: inline-block;
overflow: hidden;
}

.label-tag {
background: fade(@redash-gray, 10%);
color: fade(@redash-gray, 75%);
margin-right: 3px;
display: inline-block;
margin-top: 2px;
max-width: 24ch;
.text-overflow();
}

.tab-nav > li > a {
Expand Down Expand Up @@ -733,6 +743,7 @@ page-header, .page-header--new {
}

.tags-list {

.badge-light {
background: fade(@redash-gray, 10%);
color: fade(@redash-gray, 75%);
Expand Down
2 changes: 1 addition & 1 deletion client/app/components/tags-control/control-template.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<span class="label label-tag" ng-repeat="tag in $ctrl.item.tags">{{ tag }}</span
<span class="label label-tag" ng-repeat="tag in $ctrl.item.tags" title="{{tag}}">{{ tag }}</span
><a ng-if="$ctrl.canEdit && $ctrl.item.tags.length == 0" class="label label-tag"
ng-click="$ctrl.editTags()"><i class="zmdi zmdi-plus"></i> Add tag</a
><a ng-if="$ctrl.canEdit && $ctrl.item.tags.length > 0" class="label label-tag"
Expand Down
4 changes: 2 additions & 2 deletions client/app/components/tags-list/tags-list.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="list-group m-t-10 tags-list tiled" ng-if="$ctrl.allTags.length > 0">
<a ng-repeat="tag in $ctrl.allTags" ng-class="{active: $ctrl.selectedTags.has(tag.name)}" class="list-group-item" ng-click="$ctrl.toggleTag($event, tag.name)">
{{ tag.name }} <span class="badge badge-light">{{ tag.count }}</span>
<a ng-repeat="tag in $ctrl.allTags" ng-class="{active: $ctrl.selectedTags.has(tag.name)}" class="list-group-item max-character" ng-click="$ctrl.toggleTag($event, tag.name)">
<span class="tags-list__name">{{ tag.name }}</span> <span class="badge badge-light">{{ tag.count }}</span>
</a>
</div>
6 changes: 4 additions & 2 deletions client/app/pages/queries-list/queries-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,10 @@
<td class="table-main-title">
<a href="queries/{{query.id}}">{{query.name}}</a>
<br>
<span class="label label-default" ng-if="query.is_draft">Unpublished</span>
<tags-control item="query"></tags-control>

<span>
<span class="label label-default-unpublished" ng-if="query.is_draft">Unpublished</span> <tags-control item="query"></tags-control>
</span>
</td>
<td class="p-r-0">
<img ng-src="{{query.user.profile_image_url}}" class="profile__image_thumb" title="Created by {{query.user.name}}" />
Expand Down