-
Notifications
You must be signed in to change notification settings - Fork 29
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
Modify company data schema to include licensing details #1146
Modify company data schema to include licensing details #1146
Conversation
e58c200
to
db4386e
Compare
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.
I will circle back to review the frontend once the backend changes are finalized.
@@ -40,6 +40,9 @@ | |||
<column name="legal_contact" type="varchar(255)"> | |||
<constraints nullable="true" /> | |||
</column> | |||
<column name="additional_info" type="${clobType}"> |
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.
To work with the production database, we need to create a new changeSet instead of adding to the old one.
<!-- jhipster-needle-liquibase-add-loadcolumn - JHipster (and/or extensions) can add load columns here --> | ||
</loadData> | ||
</changeSet> | ||
<changeSet id="20210927165433-2-data" author="calvin" context="faker"> |
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 should not be deleted I believe
@@ -41,9 +41,11 @@ public class CompanyDTO implements Serializable { | |||
|
|||
@NotEmpty | |||
private Set<String> companyDomains = new HashSet<>(); | |||
@Lob | |||
private String additionalInfo; |
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.
We should have an AdditionalInfo class to host all properties, similar to AdditionalInfoDTO under useradditionalinfo
@@ -0,0 +1 @@ | |||
{} |
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 don't include hipster.png and hipster.txt under the fake-data folder.
"additionalInfo": { | ||
"license": { | ||
"termination": { | ||
"date": "2024-09-21", |
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.
I know this is a fake data, but can we have termination date after activation date? 😃
import java.time.LocalDate; | ||
|
||
public class CompanyLicense implements Serializable { | ||
private LocalDate activation; |
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.
We have been suing Instant for dates, let's do that.
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.
I'm using LocalDate since it represents a date only. I'm assuming we don't want to deal with time zones?
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.
We've been using instant with timezone and map it to local in the frontend.
|
||
public class CompanyTermination implements Serializable { | ||
private Integer notificationDays; | ||
private LocalDate date; |
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.
Here too
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" | ||
xmlns:pro="http://www.liquibase.org/xml/ns/pro" |
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.
IntelliJ indicates these two are not used.
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.
I copy and pasted from liquibase's doc. I guess they need to update them. 😆
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd | ||
http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-latest.xsd"> |
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.
IntelliJ indicates these two are not used.
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd | ||
http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-latest.xsd"> | ||
|
||
<changeSet author="john" id="20240829165533"> |
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.
We seem to use jhipster in the author field in the past which is wrong. Let's use oncokb going forward.
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.
so author="oncokb"
?
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.
yeah
import { CompanyAdditionalInfoDTO } from 'app/shared/api/generated/API'; | ||
import { FormTextAreaField } from 'app/shared/textarea/FormTextAreaField'; | ||
|
||
const defaultAdditionalInfo: CompanyAdditionalInfoDTO = { |
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.
Having a default means we will always have companyAdditionalInfo populated in the DB correct? Historically we don't add the default but leave the filed empty in the 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.
Yes, but shouldn't we always have it populated going forward?
When you say empty do you mean that you don't include the empty field at all in the json?
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.
Yeah, if the user does not have any additional info, the DB has no content.
<FormInputField | ||
id="termination.date" | ||
label="Termination Date" | ||
type="date" |
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 newly added components seem to have different height than others?
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.
I was trying to copy FormTextAreaField is that a bad example?
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 sure. If this component comes from us, we need to examine why it looks differently from others.
@@ -1,23 +1,25 @@ | |||
import React from 'react'; | |||
import Select from 'react-select'; | |||
|
|||
export type IFormSelectWithLabelProps = { | |||
onSelection: (selectedOption: any) => void; | |||
export type IFormSelectWithLabelProps<Label, Value> = { |
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.
Thanks
@observable companyAdditionalInfo: CompanyAdditionalInfoDTO = { | ||
license: { | ||
...defaultInfo.license, | ||
activation: new Date().toISOString().split('T')[0], |
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.
only if creating a regular company
activation: '', | ||
termination: { | ||
date: '', | ||
notificationDays: 60, |
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.
30
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.
auto-renew true
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.
add warning to user that email will be sent if inside of notification window when the user updates the company page.
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.
- after selecting activation, the auto-renewal should be Yes
- Termination Notification Days and notes should not be editable if termination date is not available
- termination date should not be earlier than activation
add warning to user that email will be sent if inside of notification window when the user updates the company page.
this is not implemented. See the modal when converting license status from regular to trial as an example
@zhx828 I addressed everything but " |
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.
Thanks! LGTM.
* Modify company data schema to include licensing details (#1146) * Added termination warning email button (#1151) * Added endpoints to send company notification email (#1152) * Bump elliptic from 6.5.2 to 6.5.7 Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.2 to 6.5.7. - [Commits](indutny/elliptic@v6.5.2...v6.5.7) --- updated-dependencies: - dependency-name: elliptic dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> * allow keypress events for textareas * Fix data download (#1162) * User is granted API access on approval (#1163) * Added endpoints to send notification email * Data version is now displayed (#1165) * Addressed PR comments * Updated Setup Java in Git Actions (#1166) --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Hongxin <[email protected]> Co-authored-by: bprize15 <[email protected]> Co-authored-by: bprize15 <[email protected]> Co-authored-by: Calvin Lu <[email protected]> --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Hongxin <[email protected]> Co-authored-by: bprize15 <[email protected]> Co-authored-by: bprize15 <[email protected]> Co-authored-by: Calvin Lu <[email protected]>
closes oncokb/oncokb-pipeline#442