Skip to content

Commit

Permalink
deep-worktype-menu
Browse files Browse the repository at this point in the history
  • Loading branch information
leomendoza123 committed Jan 3, 2025
1 parent c59ba1a commit fcf2578
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 41 deletions.
7 changes: 5 additions & 2 deletions src/app/cdk/deep-select-input/deep-select-input.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import { MatLegacyFormFieldControl } from '@angular/material/legacy-form-field'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { MatLegacySelectModule } from '@angular/material/legacy-select'
import { SharedModule } from 'src/app/shared/shared.module'
import { MatLegacyMenu, MatLegacyMenuModule } from '@angular/material/legacy-menu'
import {
MatLegacyMenu,
MatLegacyMenuModule,
} from '@angular/material/legacy-menu'
import { MatMenuModule } from '@angular/material/menu'
import { MatButtonModule } from '@angular/material/button'
import { MatLegacyInputModule } from '@angular/material/legacy-input'
Expand All @@ -19,7 +22,7 @@ import { MatLegacyInputModule } from '@angular/material/legacy-input'
MatLegacySelectModule,
SharedModule,
MatLegacyMenuModule,
MatLegacyInputModule
MatLegacyInputModule,
],
exports: [DeepSelectInputComponent],
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
appearance="outline"
class="mat-form-field-min input-container"
(click)="clickHoverMenuTrigger.openMenu()"

>
<input
type="text"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,10 @@ button.mat-button-wrap-text.secondaryItem {
line-height: 18px;
}


button.mat-button-wrap-text:not(.mobile):not(.secondaryItem) {
padding: 0px 16px !important;
}


.not-selectable-label {
padding: 0 16px;
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ComponentFixture, TestBed } from '@angular/core/testing'

import { DeepSelectInputComponent } from './deep-select-input.component';
import { DeepSelectInputComponent } from './deep-select-input.component'

describe('DeepSelectInputComponent', () => {
let component: DeepSelectInputComponent;
let fixture: ComponentFixture<DeepSelectInputComponent>;
let component: DeepSelectInputComponent
let fixture: ComponentFixture<DeepSelectInputComponent>

beforeEach(() => {
TestBed.configureTestingModule({
declarations: [DeepSelectInputComponent]
});
fixture = TestBed.createComponent(DeepSelectInputComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
declarations: [DeepSelectInputComponent],
})
fixture = TestBed.createComponent(DeepSelectInputComponent)
component = fixture.componentInstance
fixture.detectChanges()
})

it('should create', () => {
expect(component).toBeTruthy();
});
});
expect(component).toBeTruthy()
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,8 @@
[menu]="workTypeMenu"
[formControlRef]="workTypeControl"
formControlName="workType"

>
</app-deep-select-input>

</div>
<!-- Title -->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -638,15 +638,9 @@ export class WorkFormComponent implements OnInit {
const workType = this.workForm.get('workType').value

if (externalIdentifier && workType) {
if (
externalIdentifier === 'isbn' &&
workType === WorkTypes.bookChapter
) {
if (externalIdentifier === 'isbn' && workType === WorkTypes.bookChapter) {
workRelationship = WorkRelationships['part-of']
} else if (
externalIdentifier === 'isbn' &&
workType === WorkTypes.book
) {
} else if (externalIdentifier === 'isbn' && workType === WorkTypes.book) {
workRelationship = WorkRelationships.self
} else if (externalIdentifier === 'issn') {
workRelationship = WorkRelationships['part-of']
Expand Down Expand Up @@ -723,7 +717,7 @@ export class WorkFormComponent implements OnInit {
this._dialogRef.close()
}

get workTypeControl() : FormControl<any> {
get workTypeControl(): FormControl<any> {
return this.workForm.get('workType') as FormControl<any>
}
}
1 change: 0 additions & 1 deletion src/app/types/record-works.endpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
import { AssertionBase } from './record.endpoint'
import { WorkTypes } from './works.endpoint'


export interface Work extends AssertionBase {
publicationDate: MonthDayYearDate
shortDescription?: Value
Expand Down
18 changes: 7 additions & 11 deletions src/app/types/works.endpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,13 @@ export enum WorkTypes {
conferenceOutput = 'conference-output',
conferencePresentation = 'conference-presentation',
conferenceProceedings = 'conference-proceedings',
design="design",
image="image",
learningObject="learning-object",
movingImage="moving-image",
musicalComposition="musical-composition",
sound="sound",
transcriptions="transcriptions",

design = 'design',
image = 'image',
learningObject = 'learning-object',
movingImage = 'moving-image',
musicalComposition = 'musical-composition',
sound = 'sound',
transcriptions = 'transcriptions',
}

export const WorkCategoriesLabel = {
Expand All @@ -91,8 +90,6 @@ export const WorkCategoriesLabel = {
[WorkCategories.teachingAndSupervision]: $localize`:@@works.teaching:Teaching and supervision`,
}



export const WorkTypesLabels = {
[WorkTypes.conferenceAbstract]: $localize`:@@works.abstract:Conference abstract`,
[WorkTypes.conferencePaper]: $localize`:@@works.paper:Conference paper`,
Expand Down Expand Up @@ -151,7 +148,6 @@ export const WorkTypesLabels = {
[WorkTypes.musicalComposition]: $localize`:@@works.musicalComposition:Musical composition`,
[WorkTypes.sound]: $localize`:@@works.sound:Sound`,
[WorkTypes.transcriptions]: $localize`:@@works.transcriptions:Transcription`,

}

export enum WorksTitleName {
Expand Down

0 comments on commit fcf2578

Please sign in to comment.