From 8a907c286881c0dafc7bdedb2f6adbf26eed6c82 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Thu, 20 Mar 2025 16:39:47 -0700 Subject: [PATCH] Fix some merge stuff [ci skip] --- ...s => custom-fields-list.component.spec.ts} | 18 ++++++------- .../custom-fields-list.component.ts | 26 ++++++++++++++++++- ...insensitive_customfield_match_and_more.py} | 4 +-- 3 files changed, 36 insertions(+), 12 deletions(-) rename src-ui/src/app/components/manage/custom-fields-list/{custom-fields.component.spec.ts => custom-fields-list.component.spec.ts} (92%) rename src/documents/migrations/{1061_customfield_is_insensitive_customfield_match_and_more.py => 1066_customfield_is_insensitive_customfield_match_and_more.py} (93%) diff --git a/src-ui/src/app/components/manage/custom-fields-list/custom-fields.component.spec.ts b/src-ui/src/app/components/manage/custom-fields-list/custom-fields-list.component.spec.ts similarity index 92% rename from src-ui/src/app/components/manage/custom-fields-list/custom-fields.component.spec.ts rename to src-ui/src/app/components/manage/custom-fields-list/custom-fields-list.component.spec.ts index 30ecf9472..9e6d80836 100644 --- a/src-ui/src/app/components/manage/custom-fields-list/custom-fields.component.spec.ts +++ b/src-ui/src/app/components/manage/custom-fields-list/custom-fields-list.component.spec.ts @@ -28,7 +28,7 @@ import { ToastService } from 'src/app/services/toast.service' import { ConfirmDialogComponent } from '../../common/confirm-dialog/confirm-dialog.component' import { CustomFieldEditDialogComponent } from '../../common/edit-dialog/custom-field-edit-dialog/custom-field-edit-dialog.component' import { PageHeaderComponent } from '../../common/page-header/page-header.component' -import { CustomFieldsComponent } from './custom-fields-list.component' +import { CustomFieldsListComponent } from './custom-fields-list.component' const fields: CustomField[] = [ { @@ -43,9 +43,9 @@ const fields: CustomField[] = [ }, ] -describe('CustomFieldsComponent', () => { - let component: CustomFieldsComponent - let fixture: ComponentFixture +describe('CustomFieldsListComponent', () => { + let component: CustomFieldsListComponent + let fixture: ComponentFixture let customFieldsService: CustomFieldsService let modalService: NgbModal let toastService: ToastService @@ -61,7 +61,7 @@ describe('CustomFieldsComponent', () => { NgbModalModule, NgbPopoverModule, NgxBootstrapIconsModule.pick(allIcons), - CustomFieldsComponent, + CustomFieldsListComponent, IfPermissionsDirective, PageHeaderComponent, ConfirmDialogComponent, @@ -94,7 +94,7 @@ describe('CustomFieldsComponent', () => { settingsService = TestBed.inject(SettingsService) settingsService.currentUser = { id: 0, username: 'test' } - fixture = TestBed.createComponent(CustomFieldsComponent) + fixture = TestBed.createComponent(CustomFieldsListComponent) component = fixture.componentInstance fixture.detectChanges() jest.useFakeTimers() @@ -106,7 +106,7 @@ describe('CustomFieldsComponent', () => { modalService.activeInstances.subscribe((m) => (modal = m[m.length - 1])) const toastErrorSpy = jest.spyOn(toastService, 'showError') const toastInfoSpy = jest.spyOn(toastService, 'showInfo') - const reloadSpy = jest.spyOn(component, 'reload') + const reloadSpy = jest.spyOn(component, 'reloadData') const createButton = fixture.debugElement.queryAll(By.css('button'))[1] createButton.triggerEventHandler('click') @@ -131,7 +131,7 @@ describe('CustomFieldsComponent', () => { modalService.activeInstances.subscribe((m) => (modal = m[m.length - 1])) const toastErrorSpy = jest.spyOn(toastService, 'showError') const toastInfoSpy = jest.spyOn(toastService, 'showInfo') - const reloadSpy = jest.spyOn(component, 'reload') + const reloadSpy = jest.spyOn(component, 'reloadData') const editButton = fixture.debugElement.queryAll(By.css('button'))[2] editButton.triggerEventHandler('click') @@ -156,7 +156,7 @@ describe('CustomFieldsComponent', () => { modalService.activeInstances.subscribe((m) => (modal = m[m.length - 1])) const toastErrorSpy = jest.spyOn(toastService, 'showError') const deleteSpy = jest.spyOn(customFieldsService, 'delete') - const reloadSpy = jest.spyOn(component, 'reload') + const reloadSpy = jest.spyOn(component, 'reloadData') const deleteButton = fixture.debugElement.queryAll(By.css('button'))[5] deleteButton.triggerEventHandler('click') diff --git a/src-ui/src/app/components/manage/custom-fields-list/custom-fields-list.component.ts b/src-ui/src/app/components/manage/custom-fields-list/custom-fields-list.component.ts index daa9bb314..e44be6359 100644 --- a/src-ui/src/app/components/manage/custom-fields-list/custom-fields-list.component.ts +++ b/src-ui/src/app/components/manage/custom-fields-list/custom-fields-list.component.ts @@ -1,11 +1,21 @@ +import { NgClass, TitleCasePipe } from '@angular/common' import { Component } from '@angular/core' -import { NgbModal } from '@ng-bootstrap/ng-bootstrap' +import { FormsModule, ReactiveFormsModule } from '@angular/forms' +import { + NgbDropdownModule, + NgbModal, + NgbPaginationModule, +} from '@ng-bootstrap/ng-bootstrap' +import { NgxBootstrapIconsModule } from 'ngx-bootstrap-icons' import { CustomField, DATA_TYPE_LABELS } from 'src/app/data/custom-field' import { CustomFieldQueryLogicalOperator, CustomFieldQueryOperator, } from 'src/app/data/custom-field-query' import { FILTER_CUSTOM_FIELDS_QUERY } from 'src/app/data/filter-rule-type' +import { IfPermissionsDirective } from 'src/app/directives/if-permissions.directive' +import { SortableDirective } from 'src/app/directives/sortable.directive' +import { SafeHtmlPipe } from 'src/app/pipes/safehtml.pipe' import { DocumentListViewService } from 'src/app/services/document-list-view.service' import { PermissionsService, @@ -14,12 +24,26 @@ import { import { CustomFieldsService } from 'src/app/services/rest/custom-fields.service' import { ToastService } from 'src/app/services/toast.service' import { CustomFieldEditDialogComponent } from '../../common/edit-dialog/custom-field-edit-dialog/custom-field-edit-dialog.component' +import { PageHeaderComponent } from '../../common/page-header/page-header.component' import { ManagementListComponent } from '../management-list/management-list.component' @Component({ selector: 'pngx-custom-fields-list', templateUrl: './../management-list/management-list.component.html', styleUrls: ['./../management-list/management-list.component.scss'], + imports: [ + SortableDirective, + PageHeaderComponent, + TitleCasePipe, + IfPermissionsDirective, + SafeHtmlPipe, + FormsModule, + ReactiveFormsModule, + NgClass, + NgbDropdownModule, + NgbPaginationModule, + NgxBootstrapIconsModule, + ], }) export class CustomFieldsListComponent extends ManagementListComponent { permissionsDisabled = true diff --git a/src/documents/migrations/1061_customfield_is_insensitive_customfield_match_and_more.py b/src/documents/migrations/1066_customfield_is_insensitive_customfield_match_and_more.py similarity index 93% rename from src/documents/migrations/1061_customfield_is_insensitive_customfield_match_and_more.py rename to src/documents/migrations/1066_customfield_is_insensitive_customfield_match_and_more.py index dea14ae4a..3003c988b 100644 --- a/src/documents/migrations/1061_customfield_is_insensitive_customfield_match_and_more.py +++ b/src/documents/migrations/1066_customfield_is_insensitive_customfield_match_and_more.py @@ -1,4 +1,4 @@ -# Generated by Django 5.1.4 on 2024-12-13 21:21 +# Generated by Django 5.1.6 on 2025-03-20 23:37 import django.db.models.deletion from django.conf import settings @@ -8,7 +8,7 @@ from django.db import models class Migration(migrations.Migration): dependencies = [ - ("documents", "1060_alter_customfieldinstance_value_select"), + ("documents", "1065_workflowaction_assign_custom_fields_values"), migrations.swappable_dependency(settings.AUTH_USER_MODEL), ]