Fix some merge stuff

[ci skip]
This commit is contained in:
shamoon 2025-03-20 16:39:47 -07:00
parent 6dc6c6c7bb
commit 8a907c2868
No known key found for this signature in database
3 changed files with 36 additions and 12 deletions

View File

@ -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<CustomFieldsComponent>
describe('CustomFieldsListComponent', () => {
let component: CustomFieldsListComponent
let fixture: ComponentFixture<CustomFieldsListComponent>
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')

View File

@ -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<CustomField> {
permissionsDisabled = true

View File

@ -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),
]