1- import classic from 'ember-classic-decorator' ;
1+ // Finish conversion of this component to a @glimmer component.
22import { action , computed } from '@ember/object' ;
33import PersonBaseComponent from './person-base-component' ;
44import { pascalCase } from 'pascal-case' ;
55import humanizeString from 'humanize-string' ;
66import { isBlank } from '@ember/utils' ;
7+ import { tracked } from '@glimmer/tracking' ;
78
89const contributorTypes = [
910 'ContactPerson' ,
@@ -54,22 +55,21 @@ const personalContributorTypes = [
5455 'WorkPackageLeader'
5556] ;
5657
57- @classic
5858export default class DoiContributor extends PersonBaseComponent {
5959 humanContributorTypes = humanContributorTypes ;
6060
6161 @computed ( 'fragment.contributorType' )
6262 get humanContributorType ( ) {
63- return isBlank ( this . get ( ' fragment.contributorType' ) )
63+ return isBlank ( this . fragment . contributorType )
6464 ? null
65- : humanizeString ( this . get ( ' fragment.contributorType' ) ) ;
65+ : humanizeString ( this . fragment . contributorType ) ;
6666 }
6767
6868 selectContributorType ( contributorType ) {
6969 if ( contributorType ) {
7070 let contributorTypeId = pascalCase ( contributorType ) ;
71- this . fragment . set ( ' contributorType' , contributorTypeId ) ;
72- this . set ( ' contributorType' , contributorType ) ;
71+ this . fragment . contributorType = contributorTypeId ;
72+ this . contributorType = contributorType ;
7373
7474 if ( organizationalContributorTypes . includes ( contributorTypeId ) ) {
7575 this . selectNameType ( 'Organizational' ) ;
@@ -79,14 +79,14 @@ export default class DoiContributor extends PersonBaseComponent {
7979 this . selectNameType ( 'Personal' ) ;
8080 }
8181 } else {
82- this . fragment . set ( ' contributorType' , null ) ;
82+ this . fragment . contributorType = null ;
8383 }
84- this . set ( ' humanContributorTypes' , humanContributorTypes ) ;
84+ this . humanContributorTypes = humanContributorTypes ;
8585 }
8686
8787 @action
8888 deleteContributorAction ( ) {
89- this . model . get ( ' contributors' ) . removeObject ( this . fragment ) ;
89+ this . model . contributors . removeObject ( this . fragment ) ;
9090 }
9191
9292 @action
0 commit comments