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

feat: created basic section and their forms #355

Closed
wants to merge 11 commits into from

Conversation

sivangbagri
Copy link
Contributor

@sivangbagri sivangbagri commented Aug 22, 2024

Description

Fixes #(issue)

Checklist

  • My code follows the contributing guidelines of this project.
  • I am aware that all my commits will be squashed into a single commit, using the PR title as the commit message.
  • I have performed a self-review of my own code.
  • I have commented my code in hard-to-understand areas.
  • I have updated the user-facing documentation to describe any new or changed behavior.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have not reduced the existing code coverage.

Comments

Summary by Sourcery

Add a new 'ECCCLientRoCrateAbout' component with tabbed forms for managing metadata sections, and provide demo HTML files for component demonstration.

New Features:

  • Introduce a new web component 'ECCCLientRoCrateAbout' using LitElement, which includes forms for 'About', 'Related People, Orgs & Works', and 'Structure' sections.

Enhancements:

  • Add a tabbed interface to switch between different sections ('About', 'Related People, Orgs & Works', and 'Structure') within the 'ECCCLientRoCrateAbout' component.

Documentation:

  • Add demo HTML files to showcase the usage of the new 'ECCCLientRoCrateAbout' component, including a basic setup and integration example.

Copy link

changeset-bot bot commented Aug 22, 2024

⚠️ No Changeset found

Latest commit: d39e6f1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Aug 22, 2024

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

Name Status Preview Comments Updated (UTC)
elixir-cloud-components ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 12, 2024 9:22pm

Copy link
Contributor

sourcery-ai bot commented Aug 22, 2024

Reviewer's Guide by Sourcery

This pull request implements a new feature for creating basic sections and their forms in the ecc-client-elixir-ro-crate package. The changes introduce a new LitElement-based component called ECCCLientRoCrateAbout, which creates a tabbed interface for displaying and editing information about RO-Crate metadata. The implementation uses the @elixir-cloud/design library for form components and defines several form fields for different sections of the RO-Crate metadata.

File-Level Changes

Files Changes
packages/ecc-client-elixir-ro-crate/src/components/about/about.ts Created a new LitElement-based component ECCCLientRoCrateAbout with a tabbed interface for RO-Crate metadata editing
packages/ecc-client-elixir-ro-crate/src/components/about/about.ts Defined form fields for 'About', 'Related People', and 'Structure' sections of RO-Crate metadata
packages/ecc-client-elixir-ro-crate/src/components/about/about.ts Implemented tab switching functionality in the ECCCLientRoCrateAbout component
packages/ecc-client-elixir-ro-crate/demo/about/index.html Added a demo HTML file for the new ECCCLientRoCrateAbout component
packages/ecc-client-elixir-ro-crate/src/components/about/index.ts Created an index file for exporting the ECCCLientRoCrateAbout component and defining it as a custom element
packages/ecc-client-elixir-ro-crate/demo/index.html Added a main demo page with a link to the 'About' component demo

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @sivangbagri - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider improving naming consistency. The main class name ECCCLientRoCrateAbout should likely be ECCClientRoCrateAbout, and there's a mix of snake_case and camelCase in the code that could be standardized.
  • The field definitions are currently hardcoded. Consider loading these from a configuration file or API for better flexibility and maintainability.
  • There are several TODO comments in the code. It's generally better to resolve these before submitting a pull request, or at least provide more context about why they're left as TODOs.
Here's what I looked at during the review
  • 🟡 General issues: 3 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

import "@elixir-cloud/design/dist/components/form/index.js";
import { Field } from "@elixir-cloud/design/dist/components/form/form";

export default class ECCCLientRoCrateAbout extends LitElement {
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion (typo): Fix typo in class name

The class name 'ECCCLientRoCrateAbout' contains a typo. It should be 'ECCClientRoCrateAbout' for consistency and clarity.

export default class ECCClientRoCrateAbout extends LitElement {

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 also true!

fieldOptions: {
required: true,
default: "Dataset",
tooltip: "Your house number",
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: Update or remove irrelevant tooltip

The tooltip for the 'Type' field mentions 'Your house number', which seems unrelated. Consider updating this to a relevant description or removing it if not needed.

Suggested change
tooltip: "Your house number",
tooltip: "The type of dataset being described",

},
},
{
key: "pulisher",
Copy link
Contributor

Choose a reason for hiding this comment

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

issue (typo): Correct typo in 'publisher' key

There's a typo in the 'publisher' key. It's currently spelled as 'pulisher', which could cause issues when accessing or setting this field.

Copy link
Member

Choose a reason for hiding this comment

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

Incorrect Spelling!

@sivangbagri
Copy link
Contributor Author

@Salihu @anuragxxd Kindly review. Ignore naming issues , I will fix it

@SalihuDickson
Copy link
Contributor

SalihuDickson commented Aug 27, 2024

hi @sivangbagri, I'm having a bit of trouble reviewing your code, can you please create an issue that goes into detail about the goals of this project and how you are going about achieving said goals. Also include important links like the schema for the version of ro-crate you're working with, and links to any referenced projects or profiles. If there is one already please link it in the PR description.

@sivangbagri
Copy link
Contributor Author

@SalihuDickson Hii , check this out : #356 . If anything else is needed please let me know

Copy link
Member

@anuragxxd anuragxxd left a comment

Choose a reason for hiding this comment

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

Some small changes otherwise lgtm

},
},
{
key: "pulisher",
Copy link
Member

Choose a reason for hiding this comment

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

Incorrect Spelling!

import "@elixir-cloud/design/dist/components/form/index.js";
import { Field } from "@elixir-cloud/design/dist/components/form/form";

export default class ECCCLientRoCrateAbout extends LitElement {
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 also true!

@sivangbagri
Copy link
Contributor Author

@anuragxxd new commit has required changes along with improved form structure of about and hasPart sections.

Copy link
Contributor

@SalihuDickson SalihuDickson left a comment

Choose a reason for hiding this comment

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

Just a few things:

  1. The Field is @type, not Type
  2. The @id field should be required
  3. What is the "about dataset" section for? Are the fields above that not for the root data (the dataset) entity.

Some discrepancies between from the latest official Ro-Crate sepcification:

  1. The @type field is not needed as both the metadata and the dataset entities have static types, you only need the @type field when you are creating a new entity.
  2. Name, description and date published should be required, there is also a required license entity that you need to add fields for.

There are also a bunch more fields that need to be added for the dataset entity, but we can first get the required fields set up and incrementally reach achieve full support in subsequent PRs. Please create an issue stating that we need to add full support for all accepted fields in the dataset entity, we can then begin to list the fields, their categories and associated entities as well as implementation details there.

Great work so far @sivangbagri, please take a look at the specification for the latest version and make necessary adjustments. And if you have any questions please feel free to reach out.

@SalihuDickson
Copy link
Contributor

SalihuDickson commented Oct 4, 2024

The fields you've added for the Author, Publisher and Funder fields won't really work, based on the minimum requirements for the Ro-Crates.

The author object is would be an instance of a people entitiy.
The Publisher object would be an instance of an organization entity or a people entity
The Funder object can also be an Organization or a people entity

perhaps the "Related People, Orgs & Works" page can contain all contextual entities, but we would need a better design to make that clear, as the current structure implies several disjointed entities.

This is a lot at this point, my suggestion would be that you convert this to a draft and create a new PR solely adding fields for the metadata entity, another for the dataset entity and then we can address these other objects and entities in subsequent PRs.

@sivangbagri sivangbagri marked this pull request as draft October 7, 2024 09:14
@SalihuDickson SalihuDickson mentioned this pull request Oct 12, 2024
8 tasks
SalihuDickson and others added 9 commits October 12, 2024 21:27
Signed-off-by: Pratiksha Sankhe <[email protected]>
Co-authored-by: salihuDickson <[email protected]>
…oud-aai#342)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ud-components into ro-crate"

This reverts commit 5c56b96, reversing
changes made to a6e5aff.
This reverts commit 6bc6dbb, reversing
changes made to 372c42e.
@SalihuDickson
Copy link
Contributor

I was in the process of trying to revert the ro-crate changes and merge the build fixes from earlier but i just realized those have already been implemented on main. I think you can go ahead and close this PR.

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

Successfully merging this pull request may close these issues.

4 participants