-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
61 changed files
with
1,446 additions
and
134 deletions.
There are no files selected for viewing
13 changes: 11 additions & 2 deletions
13
libs/back/api/shared/src/lib/cqrs/queries/user/usersFind.query.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,26 @@ | ||
import { IsOptional } from 'class-validator'; | ||
import { IsEnum, IsOptional } from 'class-validator'; | ||
import { Type } from 'class-transformer'; | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { PaginationRequestDTO } from '../../../dtos'; | ||
import { PAGINATION_DEFAULTS } from '@seed/shared/constants'; | ||
import { UserRole } from '@prisma/client'; | ||
|
||
export class UsersFindQuery extends PaginationRequestDTO { | ||
@ApiProperty({ type: String, required: false }) | ||
@IsOptional() | ||
@Type(() => String) | ||
public search?: string; | ||
|
||
constructor(page = PAGINATION_DEFAULTS.page, limit = PAGINATION_DEFAULTS.limit, search?: string) { | ||
@ApiProperty({ enum: UserRole, enumName: 'UserRole', required: false }) | ||
@IsOptional() | ||
@IsEnum(UserRole, { | ||
message: `Field 'role' should be one of values: [${Object.keys(UserRole).join(', ')}]`, | ||
}) | ||
public role?: UserRole; | ||
|
||
constructor(page = PAGINATION_DEFAULTS.page, limit = PAGINATION_DEFAULTS.limit, search?: string, role?: UserRole) { | ||
super(page, limit); | ||
this.search = search; | ||
this.role = role; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
libs/front/admin/auth/src/lib/create-profile/create-profile.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<p>user-details works!</p> |
22 changes: 22 additions & 0 deletions
22
libs/front/admin/users/src/lib/detail/detail.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { DetailComponent } from './detail.component'; | ||
|
||
describe('UserDetailsComponent', () => { | ||
let component: DetailComponent; | ||
let fixture: ComponentFixture<DetailComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [DetailComponent], | ||
}).compileComponents(); | ||
|
||
fixture = TestBed.createComponent(DetailComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'seed-admin-users-details', | ||
templateUrl: './detail.component.html', | ||
encapsulation: ViewEncapsulation.None, | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class DetailComponent {} |
44 changes: 44 additions & 0 deletions
44
libs/front/admin/users/src/lib/list/filters/filters.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<!-- Tabs --> | ||
<div [ngClass]="{ 'pointer-events-none opacity-50': isLoading }"> | ||
<!-- Mobile --> | ||
<div class="p-4 sm:hidden"> | ||
<label for="tabs" class="sr-only">Select a tab</label> | ||
<select | ||
id="tabs" | ||
name="tabs" | ||
class="block w-full rounded-md border-gray-300 py-2 pl-3 pr-10 text-base focus:border-purple-500 focus:outline-none focus:ring-purple-500 sm:text-sm" | ||
[formControl]="tabControl" | ||
> | ||
<option *ngFor="let r of roleTitles" [ngValue]="r.value"> | ||
{{ r.title }} {{ !isLoading && r.value === role ? '(' + total + ')' : '' }} | ||
</option> | ||
</select> | ||
</div> | ||
|
||
<!-- Desktop --> | ||
<div class="hidden sm:block"> | ||
<div class="border-b border-gray-200"> | ||
<nav class="-mb-px flex space-x-8 px-4" aria-label="Tabs"> | ||
<a | ||
*ngFor="let r of roleTitles" | ||
(click)="changeRole(r.value)" | ||
href="javascript:;" | ||
class="whitespace-nowrap border-b-2 py-4 px-1 text-sm font-medium" | ||
[ngClass]="{ | ||
'border-purple-500 text-purple-600': r.value === role, | ||
'border-transparent text-gray-500 hover:border-gray-200 hover:text-gray-700': r.value !== role | ||
}" | ||
> | ||
{{ r.title }} | ||
<span | ||
*ngIf="r.value === role" | ||
class="ml-2 inline-flex rounded-full bg-purple-100 py-0.5 px-2.5 text-xs font-medium text-purple-600" | ||
> | ||
<i *ngIf="isLoading" class="feather-loader animate-spin"></i> | ||
<span *ngIf="!isLoading">{{ total }}</span> | ||
</span> | ||
</a> | ||
</nav> | ||
</div> | ||
</div> | ||
</div> |
Oops, something went wrong.