Skip to content

Commit

Permalink
feat(admin-ui): Improve collection list & child collection creation
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbromley committed May 14, 2019
1 parent 4de2a6a commit c996fa7
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ export class CollectionDetailComponent extends BaseDetailComponent<Collection.Fr
this.detailForm,
languageCode,
) as CreateCollectionInput;
const parentId = this.route.snapshot.paramMap.get('parentId');
if (parentId) {
input.parentId = parentId;
}
return this.dataService.collection.createCollection(input);
}),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
>
<div
class="collection"
[class.private]="collection.isPrivate"
*ngFor="let collection of collectionTree.children; index as i"
cdkDrag
[cdkDragData]="collection"
Expand Down Expand Up @@ -38,13 +39,18 @@
</div>
-->
<vdr-dropdown>
<span class="trigger" vdrDropdownTrigger>
<button class="icon-button" vdrDropdownTrigger>
<clr-icon shape="ellipsis-vertical"></clr-icon>
</span>
</button>
<vdr-dropdown-menu vdrPosition="bottom-right">
<a class="dropdown-item" [routerLink]="['./', 'create', { parentId: collection.id }]">
<clr-icon shape="plus"></clr-icon>
{{ 'catalog.create-new-collection' | translate }}
</a>
<div class="dropdown-divider"></div>
<button
type="button"
class="dropdown-item"
vdrDropdownItem
[disabled]="i === 0"
(click)="moveUp(collection, i)"
>
Expand All @@ -53,7 +59,7 @@
</button>
<button
type="button"
class="dropdown-item"
vdrDropdownItem
[disabled]="i === collectionTree.children.length - 1"
(click)="moveDown(collection, i)"
>
Expand All @@ -63,7 +69,7 @@
<h4 class="dropdown-header">{{ 'catalog.move-to' | translate }}</h4>
<button
type="button"
class="dropdown-item"
vdrDropdownItem
*ngFor="let item of getMoveListItems(collection)"
(click)="move(collection, item.id)"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
color: rgba(0, 0, 0, 0.87);
transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);

&.private {
background-color: $color-grey-200;
}

.collection-detail {
padding: 6px 12px;
display: flex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
(facetValueChange)="setFacetValueIds($event)"
></vdr-product-search-input>
<vdr-dropdown class="search-settings-menu">
<button type="button" vdrDropdownTrigger>
<button type="button" class="icon-button" vdrDropdownTrigger>
<clr-icon shape="cog"></clr-icon>
</button>
<vdr-dropdown-menu vdrPosition="bottom-right">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@
}
.search-settings-menu {
margin: 0 12px;
> button {
background: none;
border: none;
cursor: pointer;
color: $color-grey-500;
}
}
td.disabled {
background-color: $color-grey-200;
Expand Down
1 change: 1 addition & 0 deletions admin-ui/src/app/data/providers/collection-data.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export class CollectionDataService {
{
input: pick(input, [
'translations',
'parentId',
'assetIds',
'featuredAssetId',
'filters',
Expand Down
6 changes: 6 additions & 0 deletions admin-ui/src/styles/theme/_theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ a:focus, button:focus {
.compact-label {
display: initial;
}
button.icon-button {
border: none;
background: none;
cursor: pointer;
color: $color-grey-500;
}
@media screen and (min-width: $breakpoint-small) {
.full-label {
display: initial;
Expand Down

0 comments on commit c996fa7

Please sign in to comment.