-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: remove usage of probability field #5877
fix: remove usage of probability field #5877
Conversation
siiddhantt
commented
Jun 15, 2024
- fixes [Timebox] Remove "Probability" Field from Opportunities #5735
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
- Removed 'probability' field from filter definitions and related utilities
- Eliminated 'probability' field from GraphQL queries and mock data
- Updated type definitions and validation logic to exclude 'probability' field
- Removed 'probability' field from database seed data and workspace migrations
- Adjusted test cases to no longer include 'probability' field
@Bonapara Should we remove the entire probability type from Twenty or just this particular field on opportunity ? |
@lucasbordeau we should keep the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
(updates since last review)
- Commented out
FieldMetadataType.Probability
inSettingsObjectNewFieldStep2.tsx
- Added
PROBABILITY
field type handling asnumber
incomputeInputFields.ts
- Added
PROBABILITY
toFieldMetadataType
enum indata.types.ts
hi! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
(updates since last review)
- Removed usage of the probability field
- Deleted imports and logic for
isFieldRating
andisFieldRatingValue
- Updated field validation and persistence logic
@siiddhantt Hi, please could you keep everything related to this field type, we don't want to remove the probability field type, which is a backend metadata feature level, we just want to remove a particular standard field which is on the standard seed data level. I'll explain in more details what we want here :
For the migration, you might want to test it on your local install, and we will test it on our side before running it for all workspaces. This is a bit complex, don't hesitate to ask for more details and you can reach us on our Discord also. |
@siiddhantt @lucasbordeau Taking a look at this one: As Lucas said there are different aspects in this work:
Could you restrict the scope of this PR to removing PROBABILITY field type + stop seeding opportunity probability field? |
@@ -29,11 +29,6 @@ export const formatFieldMetadataItemsAsFilterDefinitions = ({ | |||
return acc; | |||
} | |||
|
|||
// Todo: remove once Rating fieldtype is implemented |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is fine as we will deprecate the field, let's keep it
@@ -466,23 +466,6 @@ export const getObjectMetadataItemsMock = () => { | |||
fromRelationMetadata: null, | |||
toRelationMetadata: null, | |||
}, | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok :)
packages/twenty-front/src/modules/object-record/hooks/__mocks__/useFindManyRecords.ts
Outdated
Show resolved
Hide resolved
@@ -5517,29 +5517,6 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = | |||
"toRelationMetadata": null | |||
} | |||
}, | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
@@ -166,7 +166,7 @@ export const SettingsObjectNewFieldStep2 = () => { | |||
// FieldMetadataType.FullName, | |||
// FieldMetadataType.Link, | |||
FieldMetadataType.Numeric, | |||
FieldMetadataType.Probability, | |||
// FieldMetadataType.Probability, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
@@ -142,14 +142,6 @@ export const mockedViewFieldsData = [ | |||
isVisible: true, | |||
size: 180, | |||
}, | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
@@ -25,7 +25,6 @@ export const seedOpportunity = async ( | |||
'amountAmountMicros', | |||
'amountCurrencyCode', | |||
'closeDate', | |||
'probability', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's keep it for now
@@ -145,13 +145,6 @@ const fieldNumericMock = { | |||
defaultValue: null, | |||
}; | |||
|
|||
const fieldProbabilityMock = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
(updates since last review)
- Exclude 'probability' field from filter definitions
- Add support for 'Rating' field type in
usePersistField
- Reintroduce 'probability' field in opportunity seed data with default value 0.5
3 file(s) reviewed, no comment(s)
cc @ijreilly could you please take over this PR as it's related to yours? Also fyi #3531 we do want to remove the probability field type so this PR might get us there. We have the rating field type which is good enough to represent this. Eventually at some point we'll have display options on the rating field type "stars, progress bar, etc." Thanks @siiddhantt for the contribution! |
Hi @siiddhantt, thank you for your contribution! |
Hi @ijreilly thanks for the update! I appreciate your help on this. |
Got it, @siiddhantt thanks a lot for your contribution and interest in twenty! |
Closes #6259 |
Thanks @siiddhantt for your contribution! |