mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
Enhancement: improve layout, button labels for custom fields dropdown (#6362)
This commit is contained in:
parent
40db1065dc
commit
78f338484f
@ -2692,18 +2692,14 @@
|
|||||||
<source>Create New Field</source>
|
<source>Create New Field</source>
|
||||||
<context-group purpose="location">
|
<context-group purpose="location">
|
||||||
<context context-type="sourcefile">src/app/components/common/custom-fields-dropdown/custom-fields-dropdown.component.html</context>
|
<context context-type="sourcefile">src/app/components/common/custom-fields-dropdown/custom-fields-dropdown.component.html</context>
|
||||||
<context context-type="linenumber">21</context>
|
<context context-type="linenumber">22</context>
|
||||||
</context-group>
|
</context-group>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="3249513483374643425" datatype="html">
|
<trans-unit id="601575001006419615" datatype="html">
|
||||||
<source>Add</source>
|
<source>Add to document</source>
|
||||||
<context-group purpose="location">
|
<context-group purpose="location">
|
||||||
<context context-type="sourcefile">src/app/components/common/custom-fields-dropdown/custom-fields-dropdown.component.html</context>
|
<context context-type="sourcefile">src/app/components/common/custom-fields-dropdown/custom-fields-dropdown.component.html</context>
|
||||||
<context context-type="linenumber">24</context>
|
<context context-type="linenumber">25</context>
|
||||||
</context-group>
|
|
||||||
<context-group purpose="location">
|
|
||||||
<context context-type="sourcefile">src/app/components/common/permissions-select/permissions-select.component.html</context>
|
|
||||||
<context context-type="linenumber">7</context>
|
|
||||||
</context-group>
|
</context-group>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="7827616268749044116" datatype="html">
|
<trans-unit id="7827616268749044116" datatype="html">
|
||||||
@ -4097,7 +4093,7 @@
|
|||||||
</context-group>
|
</context-group>
|
||||||
<context-group purpose="location">
|
<context-group purpose="location">
|
||||||
<context context-type="sourcefile">src/app/components/common/input/select/select.component.ts</context>
|
<context context-type="sourcefile">src/app/components/common/input/select/select.component.ts</context>
|
||||||
<context context-type="linenumber">155</context>
|
<context context-type="linenumber">158</context>
|
||||||
</context-group>
|
</context-group>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="6423278459497515329" datatype="html">
|
<trans-unit id="6423278459497515329" datatype="html">
|
||||||
@ -4307,6 +4303,13 @@
|
|||||||
<context context-type="linenumber">45</context>
|
<context context-type="linenumber">45</context>
|
||||||
</context-group>
|
</context-group>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
|
<trans-unit id="3249513483374643425" datatype="html">
|
||||||
|
<source>Add</source>
|
||||||
|
<context-group purpose="location">
|
||||||
|
<context context-type="sourcefile">src/app/components/common/permissions-select/permissions-select.component.html</context>
|
||||||
|
<context context-type="linenumber">7</context>
|
||||||
|
</context-group>
|
||||||
|
</trans-unit>
|
||||||
<trans-unit id="1230154438678955604" datatype="html">
|
<trans-unit id="1230154438678955604" datatype="html">
|
||||||
<source>Change</source>
|
<source>Change</source>
|
||||||
<context-group purpose="location">
|
<context-group purpose="location">
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<div ngbDropdownMenu aria-labelledby="customFieldsDropdown" class="shadow custom-fields-dropdown">
|
<div ngbDropdownMenu aria-labelledby="customFieldsDropdown" class="shadow custom-fields-dropdown">
|
||||||
<ul class="list-group list-group-flush">
|
<ul class="list-group list-group-flush">
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
<pngx-input-select class="mb-3"
|
<pngx-input-select
|
||||||
[items]="unusedFields"
|
[items]="unusedFields"
|
||||||
bindLabel="name"
|
bindLabel="name"
|
||||||
[(ngModel)]="field"
|
[(ngModel)]="field"
|
||||||
@ -14,14 +14,15 @@
|
|||||||
[notFoundText]="notFoundText"
|
[notFoundText]="notFoundText"
|
||||||
[disableCreateNew]="!canCreateFields"
|
[disableCreateNew]="!canCreateFields"
|
||||||
(createNew)="createField($event)"
|
(createNew)="createField($event)"
|
||||||
|
[hideAddButton]="true"
|
||||||
bindValue="id">
|
bindValue="id">
|
||||||
</pngx-input-select>
|
</pngx-input-select>
|
||||||
<div class="btn-toolbar" role="toolbar">
|
<div class="btn-toolbar" role="toolbar">
|
||||||
<button class="btn btn-sm btn-outline-secondary me-auto" type="button" (click)="createField()" [disabled]="!canCreateFields">
|
<button class="btn btn-sm btn-outline-secondary me-auto" type="button" (click)="createField()" [disabled]="!canCreateFields">
|
||||||
<i-bs width="1em" height="1em" name="asterisk"></i-bs> <ng-container i18n>Create New Field</ng-container>
|
<i-bs width="1em" height="1em" name="asterisk"></i-bs> <ng-container i18n>Create New Field</ng-container>
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-sm btn-outline-primary me-1" type="button" (click)="addField(); fieldDropdown.close()" [disabled]="field === undefined">
|
<button class="btn btn-sm btn-outline-primary" type="button" (click)="addField(); fieldDropdown.close()" [disabled]="field === undefined">
|
||||||
<i-bs width="1.2em" height="1.2em" name="plus-circle"></i-bs> <ng-container i18n>Add</ng-container>
|
<i-bs width="1.2em" height="1.2em" name="plus-circle"></i-bs> <ng-container i18n>Add to document</ng-container>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
.custom-fields-dropdown {
|
.custom-fields-dropdown {
|
||||||
min-width: 350px;
|
min-width: 380px;
|
||||||
|
|
||||||
// correct position on mobile
|
// correct position on mobile
|
||||||
@media (max-width: 575.98px) {
|
@media (max-width: 575.98px) {
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing'
|
import { ComponentFixture, TestBed } from '@angular/core/testing'
|
||||||
|
|
||||||
import { CustomFieldsDropdownComponent } from './custom-fields-dropdown.component'
|
import { CustomFieldsDropdownComponent } from './custom-fields-dropdown.component'
|
||||||
import {
|
import { HttpClientTestingModule } from '@angular/common/http/testing'
|
||||||
HttpClientTestingModule,
|
|
||||||
HttpTestingController,
|
|
||||||
} from '@angular/common/http/testing'
|
|
||||||
import { ToastService } from 'src/app/services/toast.service'
|
import { ToastService } from 'src/app/services/toast.service'
|
||||||
import { CustomFieldsService } from 'src/app/services/rest/custom-fields.service'
|
import { CustomFieldsService } from 'src/app/services/rest/custom-fields.service'
|
||||||
import { of } from 'rxjs'
|
import { of } from 'rxjs'
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
<span [title]="item[bindLabel]">{{item[bindLabel]}}</span>
|
<span [title]="item[bindLabel]">{{item[bindLabel]}}</span>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</ng-select>
|
</ng-select>
|
||||||
@if (allowCreateNew) {
|
@if (allowCreateNew && !hideAddButton) {
|
||||||
<button class="btn btn-outline-secondary" type="button" (click)="addItem()" [disabled]="disabled">
|
<button class="btn btn-outline-secondary" type="button" (click)="addItem()" [disabled]="disabled">
|
||||||
<i-bs width="1.2em" height="1.2em" name="plus"></i-bs>
|
<i-bs width="1.2em" height="1.2em" name="plus"></i-bs>
|
||||||
</button>
|
</button>
|
||||||
|
@ -94,6 +94,9 @@ export class SelectComponent extends AbstractInputComponent<number> {
|
|||||||
@Input()
|
@Input()
|
||||||
disableCreateNew: boolean = false
|
disableCreateNew: boolean = false
|
||||||
|
|
||||||
|
@Input()
|
||||||
|
hideAddButton: boolean = false
|
||||||
|
|
||||||
@Output()
|
@Output()
|
||||||
createNew = new EventEmitter<string>()
|
createNew = new EventEmitter<string>()
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
--page-margin: 10px auto;
|
--page-margin: 10px auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
::ng-deep .ng-select-taggable {
|
::ng-deep form .ng-select-taggable {
|
||||||
max-width: calc(100% - 90px); // fudge factor for (2x) ng-select button width
|
max-width: calc(100% - 90px); // fudge factor for (2x) ng-select button width
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user