Skip to content
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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

siiddhantt
Copy link
Contributor

Copy link

@greptile-apps greptile-apps bot left a 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

@lucasbordeau
Copy link
Contributor

@Bonapara Should we remove the entire probability type from Twenty or just this particular field on opportunity ?

@Bonapara
Copy link
Member

@lucasbordeau we should keep the Rating field type but remove this probability field from the opportunity object.

Copy link

@greptile-apps greptile-apps bot left a 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 in SettingsObjectNewFieldStep2.tsx
  • Added PROBABILITY field type handling as number in computeInputFields.ts
  • Added PROBABILITY to FieldMetadataType enum in data.types.ts

@siiddhantt
Copy link
Contributor Author

hi!
made changes so the probability field is only removed from the front and server in opportunity, and also the rating field is already present there

Copy link

@greptile-apps greptile-apps bot left a 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 and isFieldRatingValue
  • Updated field validation and persistence logic

@lucasbordeau lucasbordeau self-assigned this Jun 21, 2024
@lucasbordeau
Copy link
Contributor

@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 :

  • Keep everything related to field types rating and probability
  • Remove this field from the seeds of standard field we have in the code, so it doesn't get created on new Twenty installations
  • Propose a way to migrate properly this field if it already exists in a workspace to a custom field, so it will be the same for users who use this field, except this field will turn into a custom field.

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.

@charlesBochet
Copy link
Member

@siiddhantt @lucasbordeau Taking a look at this one:

As Lucas said there are different aspects in this work:

  • Field types: we should keep RATING type and remove PROBABILITY type which is not used actually.
  • Deprecate Field probability on opportunity: we actually don't want to remove it (as users could have data stored in it) but deprecate it. This is quite complex and @ijreilly will be leading the effort here next week. We can remove seeding logic though

Could you restrict the scope of this PR to removing PROBABILITY field type + stop seeding opportunity probability field?
I'm adding specific comments on the PR to guide you

@@ -29,11 +29,6 @@ export const formatFieldMetadataItemsAsFilterDefinitions = ({
return acc;
}

// Todo: remove once Rating fieldtype is implemented
Copy link
Member

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,
},
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok :)

@@ -233,7 +233,6 @@ export enum FieldMetadataType {
Numeric = 'NUMERIC',
Phone = 'PHONE',
Position = 'POSITION',
Probability = 'PROBABILITY',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok :)

@@ -327,7 +327,6 @@ export enum FieldMetadataType {
Numeric = 'NUMERIC',
Phone = 'PHONE',
Position = 'POSITION',
Probability = 'PROBABILITY',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok :)

@@ -5517,29 +5517,6 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"toRelationMetadata": null
}
},
{
Copy link
Member

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,
Copy link
Member

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,
},
{
Copy link
Member

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',
Copy link
Member

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 = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link

@greptile-apps greptile-apps bot left a 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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Timebox] Remove "Probability" Field from Opportunities
4 participants