-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate remaining enums to makeEnum (#2904)
Co-authored-by: Wes Cutting <[email protected]> Co-authored-by: Carson Full <[email protected]>
- Loading branch information
1 parent
866dde4
commit daa879e
Showing
92 changed files
with
716 additions
and
758 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export * from './role.dto'; | ||
export * from './powers'; | ||
export * from './power.enum'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
import { EnumType, makeEnum } from '~/common'; | ||
|
||
export type Power = EnumType<typeof Power>; | ||
export const Power = makeEnum({ | ||
name: 'Power', | ||
values: [ | ||
'BetaFeatures', | ||
'CreateEthnoArt', | ||
'CreateFieldRegion', | ||
'CreateFieldZone', | ||
'CreateFilm', | ||
'CreateFundingAccount', | ||
'CreateLanguage', | ||
'CreateLiteracyMaterial', | ||
'CreateLocation', | ||
'CreateOrganization', | ||
'CreatePartner', | ||
'CreateProject', | ||
'CreateSong', | ||
'CreateStory', | ||
'CreateUser', | ||
{ | ||
value: 'CreateBudget', | ||
deprecationReason: 'Use `Project.budget` instead', | ||
}, | ||
{ | ||
value: 'CreateBudgetRecord', | ||
deprecationReason: 'Use `Project.budget` instead', | ||
}, | ||
{ | ||
value: 'CreateCeremony', | ||
deprecationReason: 'Use `Engagement.ceremony` instead', | ||
}, | ||
{ | ||
value: 'CreateChangeRequest', | ||
deprecationReason: 'Use `Project.changeRequests` instead', | ||
}, | ||
{ | ||
value: 'CreateDirectory', | ||
deprecationReason: 'Use something else instead', | ||
}, | ||
{ | ||
value: 'CreateEducation', | ||
deprecationReason: 'Use `User.education` instead', | ||
}, | ||
{ | ||
value: 'CreateEthnologueLanguage', | ||
deprecationReason: | ||
'Just check `CreateLanguage` instead. This is a sub-object ', | ||
}, | ||
{ value: 'CreateFile', deprecationReason: 'Use something else instead' }, | ||
{ | ||
value: 'CreateFileVersion', | ||
deprecationReason: 'Use something else instead', | ||
}, | ||
{ | ||
value: 'CreateInternshipEngagement', | ||
deprecationReason: 'Use `Project.engagements` instead', | ||
}, | ||
{ | ||
value: 'CreateLanguageEngagement', | ||
deprecationReason: 'Use `Project.engagements` instead', | ||
}, | ||
{ | ||
value: 'CreatePartnership', | ||
deprecationReason: 'Use `Project.partnerships` instead ', | ||
}, | ||
{ value: 'CreatePost', deprecationReason: 'Use `X.posts` instead' }, | ||
{ | ||
value: 'CreateProduct', | ||
deprecationReason: 'Use `Engagement.products` instead', | ||
}, | ||
{ | ||
value: 'CreateProjectEngagement', | ||
deprecationReason: 'Use `Project.engagements` instead', | ||
}, | ||
{ | ||
value: 'CreateProjectMember', | ||
deprecationReason: 'Use `Project.team` instead', | ||
}, | ||
{ | ||
value: 'CreateTranslationEngagement', | ||
deprecationReason: 'Use `Project.engagements` instead', | ||
}, | ||
{ | ||
value: 'CreateUnavailability', | ||
deprecationReason: 'Use `User.unavailabilities` instead', | ||
}, | ||
{ | ||
value: 'GrantInternRole', | ||
deprecationReason: 'Use `AuthorizedRoles.Intern` instead', | ||
}, | ||
{ | ||
value: 'GrantLiaisonRole', | ||
deprecationReason: 'Use `AuthorizedRoles.Liaison` instead', | ||
}, | ||
{ | ||
value: 'GrantMentorRole', | ||
deprecationReason: 'Use `AuthorizedRoles.Mentor` instead', | ||
}, | ||
{ | ||
value: 'GrantRegionalCommunicationsCoordinatorRole', | ||
deprecationReason: | ||
'Use `AuthorizedRoles.RegionalCommunicationsCoordinator` instead', | ||
}, | ||
{ | ||
value: 'GrantTranslatorRole', | ||
deprecationReason: 'Use `AuthorizedRoles.Translator` instead', | ||
}, | ||
], | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
import { registerEnumType } from '@nestjs/graphql'; | ||
import { EnumType, makeEnum } from '~/common'; | ||
|
||
export enum BudgetStatus { | ||
Pending = 'Pending', | ||
Current = 'Current', | ||
Superceded = 'Superceded', | ||
Rejected = 'Rejected', | ||
} | ||
|
||
registerEnumType(BudgetStatus, { name: 'BudgetStatus' }); | ||
export type BudgetStatus = EnumType<typeof BudgetStatus>; | ||
export const BudgetStatus = makeEnum({ | ||
name: 'BudgetStatus', | ||
values: ['Pending', 'Current', 'Superceded', 'Rejected'], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { EnumType, makeEnum } from '~/common'; | ||
|
||
export type CeremonyType = EnumType<typeof CeremonyType>; | ||
export const CeremonyType = makeEnum({ | ||
name: 'CeremonyType', | ||
values: [ | ||
// Language Engagements can have dedications | ||
'Dedication', | ||
// Internship Engagements can have certifications | ||
'Certification', | ||
], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export * from './create-ceremony.dto'; | ||
export * from './list-ceremony.dto'; | ||
export * from './ceremony.dto'; | ||
export * from './ceremony-type.enum'; | ||
export * from './update-ceremony.dto'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.