-
Notifications
You must be signed in to change notification settings - Fork 12
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
Populate submitted values in site details #1043
Conversation
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 pull request was sent to the PullRequest network for review. Expert reviewers are now being matched to your request based on the code's requirements. Stay tuned!
What to expect from this code review:
- Comments posted to any areas of potential concern or improvement.
- Detailed feedback or actions needed to resolve issues that are found.
- Turnaround times vary, but we aim to be swift.
@K-Markopoulos you can click here to see the review status or cancel the code review job.
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.
PullRequest Breakdown
Reviewable lines of change
+ 88
- 46
58% TSX
35% TypeScript
7% TypeScript (tests)
Type of change
Feature - These changes are adding a new feature or improvement to existing code.
Build succeeded and deployed at https://aqualink-app-1043.surge.sh |
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.
Hi @K-Markopoulos, Regarding the second point in your changes, I didn’t fully understand it. If it's possible to show the last values that were entered for the API token, that's great. If not, that's fine and no need to do too much work on it. This view is locked to the SuperAdmin and the Site Manager for the specific site, so there's no need to mask the token or anything fancy (unless it has already been done). The "EDIT SITE DETAILS" view is only for the site manager of the specific site and the SuperAdmins to keep track of and troubleshoot what data has been entered into the database. |
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.
PullRequest reviewed the updates made to #1043 since our last review was posted. This includes comments that have been posted by non-PullRequest reviewers. No further issues were found.
Reviewed by:
Hi @Caesarh97, The 2nd point is describing some technical things about the implementation. Basically, with the current implementation, once the token is persisted, it won't be fully visible in the UI. The user will be able to see only the last 4 characters of it. If they set "123456789", they will see "****6789". |
Hi @K-Markopoulos, I tried it out, and it looks great! Thank you for all of your help. |
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 pull request was sent to the PullRequest network for review. Expert reviewers are now being matched to your request based on the code's requirements. Stay tuned!
What to expect from this code review:
- Comments posted to any areas of potential concern or improvement.
- Detailed feedback or actions needed to resolve issues that are found.
- Turnaround times vary, but we aim to be swift.
@K-Markopoulos you can click here to see the review status or cancel the code review job.
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.
@@ -151,10 +151,12 @@ export class Site { | |||
@Column({ nullable: true, select: false, type: 'character varying' }) | |||
contactInformation?: string | null; | |||
|
|||
hasHobo: boolean; | |||
hasHobo?: boolean; |
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.
Was this change needed?
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, since it was a required property in Site
TS expected sites.service.ts::findeOne to return this property as well. The spread operator ...site
tricked TS into thinking that hasHobo
is included in the response, even though it was actually not. After removing the spread operator and explicitly defining the properties, TS throws an error that hasHobo
is missing. I had to make this property optional to overcome this error and since it's not always defined, it makes sense to be optional.
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, the alternative would be to actually have it defined no? Since it can only be true or false?
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, we can calculate the value and have it defined. I didn't add it in the first place, because I didn't want to change the structure of the response (the initial response didn't have hasHobo
property) and it seems like it requires another query to calculate it.
const hasHoboDataSet = await hasHoboDataSubQuery(this.sourceRepository); |
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.
PullRequest reviewed the updates made to #1043 since our last review was posted. This includes comments that have been posted by non-PullRequest reviewers. No further issues were found.
Reviewed by:
Issue #1038
Status and custom spotter api token values are not displayed in site details.
Changes
spotterApiToken
is not selected and therefore accessible by default, so we select all site properties and whitelist the properties we want to return.Note the logged
spotterApiToken
, whennull
the token is deleted, whenundefined
it's not changed and when it has value, the value is persisted.Screencast.from.23-10-2024.05.16.05.webm