-
Notifications
You must be signed in to change notification settings - Fork 5
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
MARXAN-545 MARXAN-644 specification repository #423
MARXAN-545 MARXAN-644 specification repository #423
Conversation
This pull request is being automatically deployed with Vercel (learn more). marxan – ./app🔍 Inspect: https://vercel.com/vizzuality1/marxan/7T4EJvfNAxEPyHDx7NnGRUoMZsx2 marxan-storybook – ./app🔍 Inspect: https://vercel.com/vizzuality1/marxan-storybook/EfT9hatCLnqaqW2wAwG2vKj9Ag8W |
9f5166b
to
c40aebc
Compare
be34c05
to
899cc73
Compare
899cc73
to
3d1e1eb
Compare
3d1e1eb
to
eca05dc
Compare
eca05dc
to
a2578fa
Compare
a2578fa
to
4f5b3f6
Compare
), | ||
}), | ||
); | ||
return; |
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.
return; |
@@ -69,7 +69,7 @@ export class ApiEvent { | |||
*/ | |||
@ApiProperty() | |||
@IsEnum(Object.values(API_EVENT_KINDS)) | |||
@Column('enum') | |||
@Column('enum', { enum: API_EVENT_KINDS }) |
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.
not true, it's varchar
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.
Could be that actual state isn't matched to what we have in entity declaration - still wanted a short route just o keep migration-generation to return results.
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.
then it's better to update it to varchar
:D
} from 'typeorm'; | ||
import { SpecificationFeatureConfigApiEntity } from './specification-feature-config.api.entity'; | ||
|
||
@Entity(`specification_feature`) |
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.
the kept convention is to use plurals
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.
Since this is a full entity now, we will also need an order
(or something like that) column to keep the ordering of features in a specification consistent with what API clients send (or the frontend to start with may see features jumping around depending on contingent factors such as order of insert/update in db)
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.
@hotzevzl sorting on serializer/controller level should be enough, shouldn't it?
if it is needed at all (https://vizzuality.slack.com/archives/C01G7PRQB96/p1628593316134400)
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, so if we are echoing back (with any augmentation) the specification as received in the request payload then we don't need to keep an order of the children of specification_features
as stored in db.
if we are composing the response from the data we have in db, then keeping the same order of geofeatures as provided in the request payload would be preferable for a consistent user experience - we could sort at serializer level, but without other order hints we could only order alphabetically here, unless I am misunderstanding what you suggest.
api/apps/api/src/migrations/api/1628585506694-ScenarioSpecification.ts
Outdated
Show resolved
Hide resolved
} from 'typeorm'; | ||
import { SpecificationFeatureConfigApiEntity } from './specification-feature-config.api.entity'; | ||
|
||
@Entity(`specification_feature`) |
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.
Since this is a full entity now, we will also need an order
(or something like that) column to keep the ordering of features in a specification consistent with what API clients send (or the frontend to start with may see features jumping around depending on contingent factors such as order of insert/update in db)
Substitute this line for a meaningful title for your changes
Overview
Please write a description. If the PR is hard to understand, provide a quick explanation of the code.
Designs
Link to the related design prototypes (if applicable)
Testing instructions
Please explain how to test the PR: ID of a dataset, steps to reach the feature, etc.
Feature relevant tickets
Link to the related task manager tickets
Checklist before submitting
develop
.deploying to staging/production, please add brief testing instructions
to the deploy checklist (
docs/deployment-checklist.md
)