Merge branch 'main' of github.com:ghostfolio/ghostfolio
All checks were successful
Docker image CD / build_and_push (push) Successful in 21m12s
All checks were successful
Docker image CD / build_and_push (push) Successful in 21m12s
This commit is contained in:
commit
bbcef36abe
@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
|
- Extended the tags selector component by a `readonly` attribute
|
||||||
- Added global styles to the _Storybook_ setup
|
- Added global styles to the _Storybook_ setup
|
||||||
|
|
||||||
## 2.138.0 - 2025-02-08
|
## 2.138.0 - 2025-02-08
|
||||||
|
@ -366,33 +366,12 @@
|
|||||||
</mat-tab>
|
</mat-tab>
|
||||||
</mat-tab-group>
|
</mat-tab-group>
|
||||||
|
|
||||||
<div
|
|
||||||
class="row"
|
|
||||||
[ngClass]="{
|
|
||||||
'd-none': !data.hasPermissionToUpdateOrder
|
|
||||||
}"
|
|
||||||
>
|
|
||||||
<div class="col">
|
|
||||||
<gf-tags-selector
|
<gf-tags-selector
|
||||||
|
[readonly]="!data.hasPermissionToUpdateOrder"
|
||||||
[tags]="activityForm.get('tags')?.value"
|
[tags]="activityForm.get('tags')?.value"
|
||||||
[tagsAvailable]="tagsAvailable"
|
[tagsAvailable]="tagsAvailable"
|
||||||
(tagsChanged)="onTagsChanged($event)"
|
(tagsChanged)="onTagsChanged($event)"
|
||||||
/>
|
/>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@if (!data.hasPermissionToUpdateOrder && tagsAvailable?.length > 0) {
|
|
||||||
<div class="row">
|
|
||||||
<div class="col">
|
|
||||||
<div class="h5" i18n>Tags</div>
|
|
||||||
<mat-chip-listbox>
|
|
||||||
@for (tag of tags; track tag) {
|
|
||||||
<mat-chip-option disabled>{{ tag.name }}</mat-chip-option>
|
|
||||||
}
|
|
||||||
</mat-chip-listbox>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
|
|
||||||
@if (
|
@if (
|
||||||
dataSource?.data.length > 0 &&
|
dataSource?.data.length > 0 &&
|
||||||
|
@ -1,4 +1,18 @@
|
|||||||
<mat-form-field appearance="outline" class="w-100 without-hint">
|
<div class="row">
|
||||||
|
<div class="col">
|
||||||
|
@if (readonly) {
|
||||||
|
<div class="h5" i18n>Tags</div>
|
||||||
|
@if (tags?.length > 0) {
|
||||||
|
<mat-chip-listbox>
|
||||||
|
@for (tag of tags; track tag) {
|
||||||
|
<mat-chip-option disabled>{{ tag.name }}</mat-chip-option>
|
||||||
|
}
|
||||||
|
</mat-chip-listbox>
|
||||||
|
} @else {
|
||||||
|
<div>-</div>
|
||||||
|
}
|
||||||
|
} @else {
|
||||||
|
<mat-form-field appearance="outline" class="w-100 without-hint">
|
||||||
<mat-label i18n>Tags</mat-label>
|
<mat-label i18n>Tags</mat-label>
|
||||||
<mat-chip-grid #tagsChipList>
|
<mat-chip-grid #tagsChipList>
|
||||||
@for (tag of tagsSelected(); track tag.id) {
|
@for (tag of tagsSelected(); track tag.id) {
|
||||||
@ -29,4 +43,7 @@
|
|||||||
</mat-option>
|
</mat-option>
|
||||||
}
|
}
|
||||||
</mat-autocomplete>
|
</mat-autocomplete>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@ -47,6 +47,25 @@ export const Default: Story = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const Readonly: Story = {
|
||||||
|
args: {
|
||||||
|
readonly: true,
|
||||||
|
tags: [
|
||||||
|
{
|
||||||
|
id: 'EMERGENCY_FUND',
|
||||||
|
name: 'Emergency Fund',
|
||||||
|
userId: null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'RETIREMENT_FUND',
|
||||||
|
name: 'Retirement Fund',
|
||||||
|
userId: null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
tagsAvailable: OPTIONS
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
export const WithoutValue: Story = {
|
export const WithoutValue: Story = {
|
||||||
args: {
|
args: {
|
||||||
tags: [],
|
tags: [],
|
||||||
|
@ -42,6 +42,7 @@ import { BehaviorSubject, Subject, takeUntil } from 'rxjs';
|
|||||||
templateUrl: 'tags-selector.component.html'
|
templateUrl: 'tags-selector.component.html'
|
||||||
})
|
})
|
||||||
export class GfTagsSelectorComponent implements OnInit, OnChanges, OnDestroy {
|
export class GfTagsSelectorComponent implements OnInit, OnChanges, OnDestroy {
|
||||||
|
@Input() readonly = false;
|
||||||
@Input() tags: Tag[];
|
@Input() tags: Tag[];
|
||||||
@Input() tagsAvailable: Tag[];
|
@Input() tagsAvailable: Tag[];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user