Skip to content

Commit

Permalink
feat: group + filter implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
domiSchenk committed Nov 6, 2021
1 parent 524ee96 commit 82f745d
Show file tree
Hide file tree
Showing 8 changed files with 278 additions and 120 deletions.
153 changes: 80 additions & 73 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,75 +1,82 @@
{
"name": "commandos",
"version": "0.7.6",
"description": "Commandos is a multi git repo client",
"scripts": {
"preinstall": "npx only-allow yarn",
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"tauri": "tauri",
"dev": "npm run tauri dev",
"build:prod": "ng build --configuration production",
"build:prod:sme": "ng build --configuration production --sourceMap=true",
"build:release": "yarn run build:prod && yarn tauri build",
"build:release:debug": "yarn run build:prod && yarn tauri build --debug",
"postinstall": "patch-package",
"release": "standard-version"
},
"private": true,
"dependencies": {
"@angular/animations": "^12.2.9",
"@angular/cdk": "^12.2.9",
"@angular/common": "~12.2.9",
"@angular/compiler": "~12.2.9",
"@angular/core": "~12.2.9",
"@angular/forms": "~12.2.9",
"@angular/platform-browser": "~12.2.9",
"@angular/platform-browser-dynamic": "~12.2.9",
"@angular/router": "~12.2.9",
"@cds/angular": "5.5.7",
"@cds/city": "^1.1.0",
"@cds/core": "5.5.7",
"@josee9988/filter-pipe-ngx": "^1.1.0",
"@ng-select/ng-select": "^7.2.0",
"@ngneat/until-destroy": "^8.0.4",
"@ngx-translate/core": "^13.0.0",
"@ngx-translate/http-loader": "^6.0.0",
"@tauri-apps/api": "^1.0.0-beta.6",
"angular-split": "^5.0.0",
"dayjs": "^1.10.4",
"diff2html": "^3.4.0",
"fuse.js": "^6.4.6",
"gitdiff-parser": "ecomfe/gitdiff-parser#7/head",
"marked": "^3.0.2",
"modern-normalize": "^1.1.0",
"ngx-autosize": "^1.8.4",
"ngx-pipes": "^2.7.5",
"ngx-scrollbar": "^7.5.4",
"ngx-tippy-wrapper": "^3.0.1",
"ngx-virtual-scroller": "^4.0.3",
"normalize.css": "^8.0.1",
"patch-package": "^6.4.7",
"rxjs": "~6.6.7",
"tippy.js": "^6.3.1",
"tslib": "^2.0.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "~12.2.9",
"@angular/cli": "~12.2.9",
"@angular/compiler-cli": "~12.2.9",
"@tauri-apps/cli": "^1.0.0-beta.9",
"@types/hogan.js": "^3.0.0",
"@types/marked": "^3.0.0",
"@types/node": "^12.11.1",
"codelyzer": "^6.0.0",
"standard-version": "^9.3.1",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "~4.2.4"
}
"name": "commandos",
"version": "0.7.6",
"description": "Commandos is a multi git repo client",
"scripts": {
"preinstall": "npx only-allow yarn",
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"tauri": "tauri",
"dev": "npm run tauri dev",
"build:prod": "ng build --configuration production",
"build:prod:sme": "ng build --configuration production --sourceMap=true",
"build:release": "yarn run build:prod && yarn tauri build",
"build:release:debug": "yarn run build:prod && yarn tauri build --debug",
"postinstall": "patch-package",
"release": "standard-version"
},
"private": true,
"dependencies": {
"@angular/animations": "^12.2.9",
"@angular/cdk": "^12.2.9",
"@angular/common": "~12.2.9",
"@angular/compiler": "~12.2.9",
"@angular/core": "~12.2.9",
"@angular/forms": "~12.2.9",
"@angular/platform-browser": "~12.2.9",
"@angular/platform-browser-dynamic": "~12.2.9",
"@angular/router": "~12.2.9",
"@cds/angular": "5.5.7",
"@cds/city": "^1.1.0",
"@cds/core": "5.5.7",
"@josee9988/filter-pipe-ngx": "^1.1.0",
"@ng-select/ng-select": "^7.2.0",
"@ngneat/until-destroy": "^8.0.4",
"@ngx-translate/core": "^13.0.0",
"@ngx-translate/http-loader": "^6.0.0",
"@tauri-apps/api": "^1.0.0-beta.6",
"angular-split": "^5.0.0",
"dayjs": "^1.10.4",
"diff2html": "^3.4.0",
"fuse.js": "^6.4.6",
"gitdiff-parser": "ecomfe/gitdiff-parser#7/head",
"marked": "^3.0.2",
"modern-normalize": "^1.1.0",
"ngx-autosize": "^1.8.4",
"ngx-pipes": "^2.7.5",
"ngx-scrollbar": "^7.5.4",
"ngx-tippy-wrapper": "^3.0.1",
"ngx-virtual-scroller": "^4.0.3",
"normalize.css": "^8.0.1",
"patch-package": "^6.4.7",
"rxjs": "~6.6.7",
"tippy.js": "^6.3.1",
"tslib": "^2.0.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "~12.2.9",
"@angular/cli": "~12.2.9",
"@angular/compiler-cli": "~12.2.9",
"@tauri-apps/cli": "^1.0.0-beta.9",
"@types/hogan.js": "^3.0.0",
"@types/marked": "^3.0.0",
"@types/node": "^12.11.1",
"codelyzer": "^6.0.0",
"standard-version": "^9.3.1",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "~4.2.4"
},
"prettier": {
"trailingComma": "all",
"bracketSameLine": true,
"tabWidth": 4,
"singleQuote": true,
"printWidth": 130
}
}
123 changes: 108 additions & 15 deletions src/app/routes/home/home.component.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
<div class="parent" cds-layout="vertical align:stretch p:lg" *ngIf="repositoriesGrouped?.length > 0;else noRepos">
<div class="commandos-grid-home-meta">
<p cds-text="heading" cds-layout="m-t:none m-b:lg">
<div class="parent" cds-layout="vertical align:stretch p:lg" *ngIf="repositoriesGrouped?.length > 0; else noRepos">
<div class="commandos-grid-home-meta" cds-layout="m-b:lg">
<p cds-text="heading" cds-layout="m-t:none">
{{ 'PAGES.HOME.TITLE' | translate }}
</p>
<div class="grid-item-end">
<div class="grid-item-end commandos-meta-bar">
<a
(click)="isGroupOpen = !isGroupOpen"
cdkOverlayOrigin
#groupTrigger="cdkOverlayOrigin"
class="action clickable"
aria-label="minimize"
role="button">
<cds-icon shape="slider" size="20"></cds-icon>
</a>
<a
(click)="isFilterOpen = !isFilterOpen"
cdkOverlayOrigin
#filterTrigger="cdkOverlayOrigin"
class="action clickable"
aria-label="minimize"
role="button"
cds-layout="m-l:lg">
<cds-icon shape="filter" size="20"></cds-icon>
</a>
<cds-search control-width="shrink">
<label></label>
<input type="search" [(ngModel)]="searchText" />
Expand All @@ -25,37 +44,112 @@
<ng-scrollbar class="virtual-scroll">
<ng-container *ngFor="let group of repositoriesGrouped">
<p cds-text="subsection" cds-layout="m-t:lg m-b:md" *ngIf="group.title">
<b cds-layout="p-r:md">{{group.title}}</b>
<small *ngIf="group.path"><i>{{group.path}}</i></small>
<b cds-layout="p-r:md">{{ group.title }}</b>
<small *ngIf="group.path"
><i>{{ group.path }}</i></small
>
</p>
<div class="commander-grid commander-overview-grid ">
<div class="commander-grid commander-overview-grid">
<div class="commander-row-title commander-overview-row-title sticky" cds-text="body bold">
<div>Name</div>
<div>Folder</div>
<div>Tags</div>
</div>
<div class="commander-row commander-overview-row" *ngFor="let repo of group.repositories"
cds-text="body" (click)="openRepository(repo.id)" (contextmenu)="openContext($event, repo)">
<div
class="commander-row commander-overview-row"
*ngFor="let repo of group.repositories"
cds-text="body"
(click)="openRepository(repo.id)"
(contextmenu)="openContext($event, repo)">
<div class="lh overflow-ellipsis" [innerHTML]="repo.name"></div>
<div class="lh overflow-ellipsis" [innerHTML]="repo.path"></div>
<div>
<div cds-layout="horizontal gap:sm">
<cds-tag readonly *ngFor="let tag of repo.tags" color="gray">{{tag}}</cds-tag>
<cds-tag readonly *ngFor="let tag of repo.tags" color="gray">{{ tag }}</cds-tag>
</div>
</div>
</div>
</div>
</ng-container>
</ng-scrollbar>

<ng-template
cdkConnectedOverlay
[cdkConnectedOverlayOrigin]="filterTrigger"
[cdkConnectedOverlayOpen]="isFilterOpen"
[cdkConnectedOverlayHasBackdrop]="true"
(backdropClick)="isFilterOpen = false">
<section class="contextmenu" cds-layout="p:xs">
<div cds-text="secondary" cds-layout="p:sm" class="">Filter by:</div>
<cds-divider></cds-divider>
<div class="action-list">
<div
*ngFor="let tag of tags"
(click)="toggle(tag)"
cds-text="secondary"
cds-layout="p:sm"
class="clickable contextmenu-action"
[ngClass]="{ active: tag.selected }">
{{ tag.name }}
</div>
</div>
<cds-divider></cds-divider>
<div (click)="clearTagFilter()" cds-text="secondary" cds-layout="p:sm" class="clickable contextmenu-action">
Clear filter
</div>

<!-- <cds-divider></cds-divider> -->
<!-- <div cds-text="secondary" cds-layout="p:sm" class="clickable contextmenu-action">Settings</div>
<div cds-text="secondary" cds-layout="p:sm" class="clickable contextmenu-action">Check for updates</div>
<cds-divider></cds-divider>
<div cds-text="secondary" cds-layout="p:sm" class="clickable contextmenu-action">About</div> -->
</section>
</ng-template>
<ng-template
cdkConnectedOverlay
[cdkConnectedOverlayOrigin]="groupTrigger"
[cdkConnectedOverlayOpen]="isGroupOpen"
[cdkConnectedOverlayHasBackdrop]="true"
(backdropClick)="isGroupOpen = false">
<section class="contextmenu" cds-layout="p:xs">
<div cds-text="secondary" cds-layout="p:sm" class="">Group by:</div>
<cds-divider></cds-divider>
<div class="action-list">
<div
(click)="toggleFolderGroup()"
cds-text="secondary"
cds-layout="p:sm"
[ngClass]="{ active: selectedGroup === 'folder' }"
class="clickable contextmenu-action">
Folder
</div>
<div
(click)="toggleTagsGroup()"
cds-text="secondary"
cds-layout="p:sm"
[ngClass]="{ active: selectedGroup === 'tags' }"
class="clickable contextmenu-action">
Tags
</div>
</div>
<cds-divider></cds-divider>
<div
(click)="handleGroupAndFilter('none')"
cds-text="secondary"
cds-layout="p:sm"
class="clickable contextmenu-action">
Clear Group
</div>
</section>
</ng-template>
</div>

<ng-template #noRepos>
<div class="center-region text-center">
<p>
Thank you for using Commandos!<br>
Start adding repositories to Commandos, to use the awesome features!<br>
<br>
Thank you for using Commandos!<br />
Start adding repositories to Commandos, to use the awesome features!<br />
<br />
<cds-button [routerLink]="['/add-repository']">Add Repository</cds-button>
</p>
</div>
Expand All @@ -70,8 +164,7 @@
<div (click)="openCode(repo.path)" cds-text="secondary" cds-layout="p:sm" class="clickable contextmenu-action">
Open in VSCode
</div>
<div (click)="openTerminal(repo.path)" cds-text="secondary" cds-layout="p:sm"
class="clickable contextmenu-action">
<div (click)="openTerminal(repo.path)" cds-text="secondary" cds-layout="p:sm" class="clickable contextmenu-action">
Open in Terminal
</div>
<cds-divider></cds-divider>
Expand Down
14 changes: 14 additions & 0 deletions src/app/routes/home/home.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,17 @@
grid-template-columns: 1fr 1fr;
grid-gap: 10px;
}

.commandos-meta-bar {
display: flex;
flex-direction: row;
align-items: center;
flex-wrap: nowrap;
}

.action-list {
display: flex;
flex-direction: column;
flex-wrap: nowrap;
gap: 2px;
}
Loading

0 comments on commit 82f745d

Please sign in to comment.