Skip to content

Commit 33ee95a

Browse files
committed
feat(): update ui permissions
1 parent 7965adf commit 33ee95a

File tree

12 files changed

+129
-5
lines changed

12 files changed

+129
-5
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<div class="mt-1 mb-2 notification --info">
2+
Type and press enter to input permission key(s):
3+
</div>
4+
5+
<div class="mb-2">
6+
<div class="mb-1 text-500">Read Permission(s)</div>
7+
<mix-input-tag></mix-input-tag>
8+
</div>
9+
10+
<div class="mb-2">
11+
<div class="mb-1 text-500">Create Permission(s)</div>
12+
<mix-input-tag></mix-input-tag>
13+
</div>
14+
15+
<div class="mb-2">
16+
<div class="mb-1 text-500">Update Permission(s)</div>
17+
<mix-input-tag></mix-input-tag>
18+
</div>
19+
20+
<div class="mb-2">
21+
<div class="mb-1 text-500">Delete Permission(s)</div>
22+
<mix-input-tag></mix-input-tag>
23+
</div>

apps/mix-cms/src/app/pages/portal/database/components/database-permission/database-permission.component.scss

Whitespace-only changes.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { CommonModule } from '@angular/common';
2+
import { ChangeDetectionStrategy, Component } from '@angular/core';
3+
import { MixInputTagComponent } from '@mixcore/ui/input-tag';
4+
5+
@Component({
6+
selector: 'mix-database-permission',
7+
standalone: true,
8+
imports: [CommonModule, MixInputTagComponent],
9+
templateUrl: './database-permission.component.html',
10+
styleUrl: './database-permission.component.scss',
11+
changeDetection: ChangeDetectionStrategy.OnPush,
12+
})
13+
export class DatabasePermissionComponent {}

apps/mix-cms/src/app/pages/portal/database/database-detail/database-detail.component.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,20 @@
106106
<div class="mix-progress-bar-value"></div>
107107
</div>
108108
}
109+
110+
<!-- Permissions -->
111+
@defer(when activeTabIndex === 3) {
112+
<div
113+
class="data-detail-page__main-content"
114+
[class.d-none]="activeTabIndex !== 3"
115+
>
116+
<mix-database-permission></mix-database-permission>
117+
</div>
118+
} @loading (after 100ms; minimum 1s) {
119+
<div class="mix-progress-bar">
120+
<div class="mix-progress-bar-value"></div>
121+
</div>
122+
}
109123
</div>
110124
</tui-loader>
111125
</div>

apps/mix-cms/src/app/pages/portal/database/database-detail/database-detail.component.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,26 +34,28 @@ import { DetailPageKit } from '../../../../shares/kits/page-detail-base-kit.comp
3434
import { DatabaseStore } from '../../../../stores/database.store';
3535
import { DatabaseEntityComponent } from '../components/database-entity/database-entity.component';
3636
import { DatabaseInfoComponent } from '../components/database-info/database-info.component';
37+
import { DatabasePermissionComponent } from '../components/database-permission/database-permission.component';
3738
import { DatabaseRelationshipComponent } from '../components/database-relationship/database-relationship.component';
3839

3940
@Component({
4041
selector: 'mix-database-detail',
4142
standalone: true,
4243
imports: [
4344
CommonModule,
44-
MixInputComponent,
45+
ReactiveFormsModule,
4546
TuiTabsModule,
46-
MixButtonComponent,
4747
TuiLoaderModule,
48-
ReactiveFormsModule,
48+
MixInputComponent,
49+
MixButtonComponent,
4950
MixSelectComponent,
50-
EntityFormComponent,
5151
MixFormErrorComponent,
52+
MixInlineInputComponent,
5253
DatabaseSelectComponent,
54+
EntityFormComponent,
5355
DatabaseRelationshipComponent,
5456
DatabaseEntityComponent,
5557
DatabaseInfoComponent,
56-
MixInlineInputComponent,
58+
DatabasePermissionComponent,
5759
],
5860
templateUrl: './database-detail.component.html',
5961
styleUrls: ['./database-detail.component.scss'],

libs/mix-ui/src/input-tag/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './input-tag.component';
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<tui-input-tag
2+
[formControl]="control"
3+
[tuiTextfieldLabelOutside]="true"
4+
[tuiTextfieldCleaner]="closable"
5+
[tuiTextfieldSize]="size"
6+
>
7+
{{ placeHolder }}
8+
</tui-input-tag>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
:host {
2+
display: block;
3+
width: 100%;
4+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { CommonModule } from '@angular/common';
2+
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
3+
import {
4+
ControlValueAccessor,
5+
FormControl,
6+
ReactiveFormsModule,
7+
} from '@angular/forms';
8+
import { TuiTextfieldControllerModule } from '@taiga-ui/core';
9+
import { TuiInputTagModule } from '@taiga-ui/kit';
10+
import { BaseTextControl } from '../base';
11+
12+
@Component({
13+
selector: 'mix-input-tag',
14+
templateUrl: './input-tag.component.html',
15+
styleUrls: ['./input-tag.component.scss'],
16+
standalone: true,
17+
imports: [
18+
CommonModule,
19+
TuiInputTagModule,
20+
TuiTextfieldControllerModule,
21+
ReactiveFormsModule,
22+
],
23+
changeDetection: ChangeDetectionStrategy.OnPush,
24+
})
25+
export class MixInputTagComponent
26+
extends BaseTextControl<string[]>
27+
implements ControlValueAccessor
28+
{
29+
override defaultValue = [];
30+
override defaultControl = new FormControl([]);
31+
32+
@Input() override placeHolder = 'Type';
33+
@Input() size: 'm' | 's' | 'l' = 'm';
34+
@Input() closable = true;
35+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"lib": {
3+
"entryFile": "index.ts"
4+
}
5+
}

0 commit comments

Comments
 (0)