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

Projects redesign/project details #2183

Open
wants to merge 29 commits into
base: projects-redesign/list-screen
Choose a base branch
from

Conversation

sunilsabatp
Copy link
Contributor

@sunilsabatp sunilsabatp commented Aug 18, 2024

This PR takes care the Project info section which includes

  • project card
  • about us
  • project review
  • project info
  • contact details
  • dive to map (only for mobile)

how to test ?
visit -> /locale/prd/[project slug]

  • project details sidebar (base PR) (in review)
    • conservation
    • restoration - tree
    • restoration - m2
  • unsupported project types (bouquet, funding) redirect to /prd with an error
  • site functionality (in review)
    • site selection on map
    • dropdown
    • zoom into site
  • mobile controls
    • explore (to check layout, comment out before release)
    • sites dropdown
  • plant location functionality (excluding selection on mobile)
  • sample plant location functionality (temporary)
  • show satellite layer by default if no plant locations exist
  • hide plant locations if satellite view is selected
  • static image of site on map (backend?)
  • use existing slide up view (mobile) for plant location details
  • direct url visit with ploc parameter
  • direct url visit with site parameter
  • sample plant location/ plant location functionality (swipeable layout) - not finalized

Copy link

vercel bot commented Aug 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
planet-webapp-multi-tenancy-setup ✅ Ready (Inspect) Visit Preview Sep 18, 2024 10:17am
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
planet-webapp ⬜️ Ignored (Inspect) Sep 18, 2024 10:17am
planet-webapp-temp ⬜️ Ignored (Inspect) Sep 18, 2024 10:17am

Copy link
Contributor

coderabbitai bot commented Aug 18, 2024

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    -- I pushed a fix in commit <commit_id>, please review it.
    -- Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    -- @coderabbitai generate unit testing code for this file.
    -- @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    -- @coderabbitai generate interesting stats about this repository and render them as a table.
    -- @coderabbitai read src/utils.ts and generate unit testing code.
    -- @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    -- @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@sunilsabatp sunilsabatp marked this pull request as draft August 18, 2024 12:42
@mariahosfeld
Copy link
Contributor

Check again for design consistency.
On mobile: Some components are not taking the same width as others, e.g., the image slider and the video are more width.

Copy link
Contributor

@mariahosfeld mariahosfeld left a comment

Choose a reason for hiding this comment

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

Looks good to merge. Once in complete context we will need to review fontsizes, some seem quite small.

@sunilsabatp sunilsabatp marked this pull request as ready for review August 27, 2024 05:30
@mohitb35
Copy link
Collaborator

mohitb35 commented Sep 14, 2024

@mariahosfeld I think we need to list down information that should be seen in the project details for conservation and tree projects. We have 2 main sections below the image slider (KeyInfo and AdditionalInfo), and currently KeyInfo is shown only for tree projects. That logic isn't correct, but I think we need a definite list of information that can be seen.

Copy link
Collaborator

@mohitb35 mohitb35 left a comment

Choose a reason for hiding this comment

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

@sunilsabatp Please go through my feedback.

Copy link
Collaborator

@mohitb35 mohitb35 left a comment

Choose a reason for hiding this comment

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

@sunilsabatp Please go through my feedback.

@mariahosfeld
Copy link
Contributor

Please make sure that all datapoint available via the API response are shown in the project details. For a conservation project several are missing.

@mariahosfeld
Copy link
Contributor

For Site Ownership it needs to be ensured that we have an automatic break point if the space runs out, currently it is just cut off
image

Comment on lines +26 to +41
.projectInfoSection {
padding: 15px;
background: rgba(255, 255, 255, 1);
border-radius: 16px;
margin-top: 20px;
display: flex;
flex-direction: column;
grid-area: 15px;
gap: 15px;
box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);
@include xsPhoneView {
box-shadow: none;
margin-left: 0px;
padding: 15px 30px;
}
}
Copy link
Collaborator

@mohitb35 mohitb35 Sep 19, 2024

Choose a reason for hiding this comment

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

Move the projectInfoSection styles to ProjectInfo.module.scss - that makes more sense in terms of heirarchy, as ProjectInfoSection lies within the /components folder which uses styles from /styles.

/>
</div>
) : (
<Skeleton className={styles.projectInfoSkeleton} />
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since we have a ProjectInfoSection component, the projectInfoSkeleton class could be renamed to projectDetailsSkeleton as that is what it appears as a placeholder for

Comment on lines +33 to +36
.projectListControlsMobile {
height: 26px;
gap: 10px;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why are we giving a height of 26px here, when the contents within are 28px?

Comment on lines +38 to 44
.marginTop10 {
margin-top: 10px;
}

.marginTop20 {
margin-top: 20px;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

  1. Still not sure why we need 2 different margins.
  2. Also, while using utility classes is fine, using a mixture of utility classes and other classes can cause confusion. In this scenario, I feel it would be better to use a specific class for impersonation mode.

Comment on lines +16 to +17
const financialAndCertificationData = [
{
Copy link
Collaborator

@mohitb35 mohitb35 Sep 19, 2024

Choose a reason for hiding this comment

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

Let's rename financialAndCertificationData --> downloadsRenderConfig.

It does not represent simple data, but a configuration of what should render and when, and we can also add another item (e.g. progressReports) without having to rename everything to make sense.

Comment on lines +65 to +67
const [singleProject, setSingleProject] = useState<ProjectExtend | null>(
null
);
Copy link
Collaborator

@mohitb35 mohitb35 Sep 19, 2024

Choose a reason for hiding this comment

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

Update the ProjectExtend type to ExtendedProject here as well.

Comment on lines +50 to +57
const handleBackButton = useCallback((e: MouseEvent) => {
e.stopPropagation();
if (window.history.length > 0) {
window.history.back();
} else {
window.location.href = '/';
}
}, []);
Copy link
Collaborator

Choose a reason for hiding this comment

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

The back button logic does not seem right, perhaps this can be taken up in a separate PR though.

Comment on lines +49 to +60
return Boolean(
(isTreeProject && metadata.yearAbandoned) ||
(isTreeProject && metadata.firstTreePlanted) ||
(isTreeProject && metadata.plantingDensity) ||
(isTreeProject && metadata.maxPlantingDensity) ||
(isTreeProject &&
metadata.plantingSeasons &&
metadata.plantingSeasons.length > 0) ||
(isConservationProject &&
metadata.activitySeasons &&
metadata.activitySeasons.length > 0)
);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can this be more readable, with less duplication?

Comment on lines +63 to +87
const shouldRenderAdditionalInfo = useMemo(() => {
const {
mainChallenge,
siteOwnerName,
longTermPlan,
acquisitionYear,
motivation,
mainInterventions,
} = metadata;
return Boolean(
mainChallenge ||
siteOwnerName ||
(isTreeProject &&
metadata.siteOwnerType &&
metadata.siteOwnerType?.length > 0) ||
(isConservationProject &&
metadata.landOwnershipType &&
metadata.landOwnershipType?.length > 0) ||
(isTreeProject && metadata.degradationCause) ||
longTermPlan ||
acquisitionYear ||
motivation ||
(mainInterventions && mainInterventions?.length > 0)
);
}, [metadata]);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can this be more readable?

} = project;
const isTreeProject = purpose === 'trees';
const isConservationProject = purpose === 'conservation';
const isRestorationProject = purpose === 'trees' && unitType === 'm2';
Copy link
Collaborator

@mohitb35 mohitb35 Sep 20, 2024

Choose a reason for hiding this comment

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

The isRestorationProject condition does not depend on unitType

Copy link
Collaborator

@mohitb35 mohitb35 left a comment

Choose a reason for hiding this comment

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

@sunilsabatp Please go through all open comments, including the ones from earlier

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.

3 participants