mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-11-18 03:41:24 +00:00
Chore: ditch the abandoned ngx-bootstrap-icons, roll our own (#14665)
This commit is contained in:
1 parent
786eac0b22
commit
7cdf8ec3c2
249 files changed
+1092
-1216
No files matched your search
+2
-2
@@ -33,9 +33,9 @@
|
||||
i18n-title
|
||||
>
|
||||
@if (copiedIndex() === $index) {
|
||||
<i-bs name="clipboard-check"></i-bs>
|
||||
<pngx-bs-icon name="clipboard-check"></pngx-bs-icon>
|
||||
} @else {
|
||||
<i-bs name="clipboard"></i-bs>
|
||||
<pngx-bs-icon name="clipboard"></pngx-bs-icon>
|
||||
}
|
||||
<span class="visually-hidden" i18n>Copy content</span>
|
||||
</button>
|
||||
|
||||
+7
-11
@@ -1,6 +1,5 @@
|
||||
import { Clipboard } from '@angular/cdk/clipboard'
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing'
|
||||
import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons'
|
||||
import { DocumentBarcodesComponent } from './document-barcodes.component'
|
||||
|
||||
const barcodes = [
|
||||
@@ -16,10 +15,7 @@ describe('DocumentBarcodesComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
DocumentBarcodesComponent,
|
||||
NgxBootstrapIconsModule.pick(allIcons),
|
||||
],
|
||||
imports: [DocumentBarcodesComponent],
|
||||
}).compileComponents()
|
||||
|
||||
fixture = TestBed.createComponent(DocumentBarcodesComponent)
|
||||
@@ -53,15 +49,15 @@ describe('DocumentBarcodesComponent', () => {
|
||||
fixture.detectChanges()
|
||||
expect(copySpy).toHaveBeenCalledWith('ASN00123')
|
||||
expect(component.copiedIndex()).toEqual(0)
|
||||
expect(buttons[0].querySelector('i-bs').getAttribute('name')).toEqual(
|
||||
'clipboard-check'
|
||||
)
|
||||
expect(
|
||||
buttons[0].querySelector('pngx-bs-icon').getAttribute('name')
|
||||
).toEqual('clipboard-check')
|
||||
jest.advanceTimersByTime(3000)
|
||||
fixture.detectChanges()
|
||||
expect(component.copiedIndex()).toBeNull()
|
||||
expect(buttons[0].querySelector('i-bs').getAttribute('name')).toEqual(
|
||||
'clipboard'
|
||||
)
|
||||
expect(
|
||||
buttons[0].querySelector('pngx-bs-icon').getAttribute('name')
|
||||
).toEqual('clipboard')
|
||||
jest.useRealTimers()
|
||||
})
|
||||
|
||||
|
||||
+2
-2
@@ -1,12 +1,12 @@
|
||||
import { Clipboard } from '@angular/cdk/clipboard'
|
||||
import { Component, inject, input, OnDestroy, signal } from '@angular/core'
|
||||
import { NgxBootstrapIconsModule } from 'ngx-bootstrap-icons'
|
||||
import { BootstrapIconComponent } from 'src/app/components/common/bootstrap-icon/bootstrap-icon.component'
|
||||
import { DocumentBarcode } from 'src/app/data/document-barcode'
|
||||
|
||||
@Component({
|
||||
selector: 'pngx-document-barcodes',
|
||||
templateUrl: './document-barcodes.component.html',
|
||||
imports: [NgxBootstrapIconsModule],
|
||||
imports: [BootstrapIconComponent],
|
||||
})
|
||||
export class DocumentBarcodesComponent implements OnDestroy {
|
||||
private readonly clipboard = inject(Clipboard)
|
||||
|
||||
Reference in new issue
Block a user