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

SDK: Improve @dotcms/angular Documentation #29212

Closed
fmontes opened this issue Jul 12, 2024 · 13 comments · Fixed by #29884, #30481 or #30508
Closed

SDK: Improve @dotcms/angular Documentation #29212

fmontes opened this issue Jul 12, 2024 · 13 comments · Fixed by #29884, #30481 or #30508

Comments

@fmontes
Copy link
Member

fmontes commented Jul 12, 2024

Task description

As a developer using the @dotcms/angular library, I want the documentation to be clear and easy to follow, so that I can easily understand how to use the library in my projects.

Acceptance Criteria

  1. The README file should provide a clear introduction to the library and its purpose.
  2. The README should include full step by step on how to use the library.
  3. Update the README of the example/angular, include env variables, tokens, everything needed to start the example
  4. Comprehensive JSDoc comments on all the components inputs, properties, classes, methods etc...
  5. Any dependencies or prerequisites needed to use the library should be clearly stated.

Problem

For example the library have this:

Add the dotcms config in the Angular app ApplicationConfig

export const appConfig: ApplicationConfig = {
    providers: [
        provideDotcmsClient(DOTCMS_CLIENT_CONFIG),
        provideRouter(routes),
    ],
};

But is not explaining where provideDotcmsClient is coming from, or how to create or anything, is missing to much context.

Assumptions & Initiation Needs

N/A

@fmontes fmontes moved this from New to Next 1-3 Sprints in dotCMS - Product Planning Jul 12, 2024
@github-project-automation github-project-automation bot moved this from In Review to Internal QA in dotCMS - Product Planning Sep 6, 2024
@nollymar nollymar reopened this Sep 7, 2024
@github-project-automation github-project-automation bot moved this from Internal QA to Current Sprint Backlog in dotCMS - Product Planning Sep 7, 2024
@nollymar nollymar moved this from Current Sprint Backlog to Internal QA in dotCMS - Product Planning Sep 7, 2024
@dcolina dcolina self-assigned this Sep 9, 2024
@dcolina
Copy link
Contributor

dcolina commented Sep 9, 2024

Internal QA: Passed.

@dcolina dcolina closed this as completed Sep 9, 2024
@dcolina dcolina removed their assignment Sep 9, 2024
@dcolina dcolina moved this from Internal QA to QA - Backlog in dotCMS - Product Planning Sep 9, 2024
@jdcmsd
Copy link
Contributor

jdcmsd commented Sep 27, 2024

The writing is clear, with only a couple of small snags:

  • A set of Angular components developer for dotCMS page rendering and editor integration.
  • developer -> "developed"

Configutarion

  • "Configuration"

Under "Client Usage":

For more information to how to use DotCms Client

  • "For more information on how to use the dotCMS Client,"

Otherwise, the copy itself reads well.

As far as testing the code samples myself, I'm unable to even install the library due to dependency tree issues. Any suggestions on this?

jamie@Jamies-MacBook-Air ~ % npm install @dotcms/angular
npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: undefined@undefined
npm error Found: @angular/[email protected]
npm error node_modules/@angular/common
npm error   peer @angular/common@"^17.1.0" from @dotcms/[email protected]
npm error   node_modules/@dotcms/angular
npm error     @dotcms/angular@"*" from the root project
npm error   peer @angular/common@"17.3.12" from @angular/[email protected]
npm error   node_modules/@angular/router
npm error     peer @angular/router@"^17.1.0" from @dotcms/[email protected]
npm error     node_modules/@dotcms/angular
npm error       @dotcms/angular@"*" from the root project
npm error   2 more (@angular/platform-browser, @tinymce/tinymce-angular)
npm error
npm error Could not resolve dependency:
npm error peer @angular/common@"18.2.6" from @angular/[email protected]
npm error node_modules/@angular/forms
npm error   peer @angular/forms@">=16.0.0" from @tinymce/[email protected]
npm error   node_modules/@tinymce/tinymce-angular
npm error     peer @tinymce/tinymce-angular@"^8.0.0" from @dotcms/[email protected]
npm error     node_modules/@dotcms/angular
npm error       @dotcms/angular@"*" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.

EDIT: Note, same outcome after ensuring @angular/cli installation

@rjvelazco
Copy link
Contributor

rjvelazco commented Oct 30, 2024

Failed IQA

  • Tested on main

Feedback

  • Fix Typo in Header: Update "Configutarion" to "Configuration" for consistency and accuracy.
  • Specify Code Language: To enhance readability, add typescript as the language specifier in code blocks where applicable, like app.config.ts and the Client Usage section.
  • Refine Client Usage Example: Modify the Client Usage example to wrap the client injection inside a YourComponent class. This makes it clearer how the client variable is used within an Angular component.

@rjvelazco rjvelazco moved this from Internal QA to In Progress in dotCMS - Product Planning Oct 30, 2024
@rjvelazco
Copy link
Contributor

rjvelazco commented Oct 30, 2024

@jdcmsd I was able to run the Angular example without any issues. Could you check if you’re still experiencing the same problem?

It’s been a while since our last update, and we’ve made updates to our npm packages, SDK, and examples.

Edited: If you run into the same error, record a video if possible

@rjvelazco rjvelazco moved this from In Progress to In Review in dotCMS - Product Planning Oct 30, 2024
@jdcmsd
Copy link
Contributor

jdcmsd commented Oct 30, 2024

@rjvelazco I can also run the example without issue; the example is great!

The issue I was running into was trying to take a brand new ng new project and use snippets from the SDK readme (this one instead of the example project) to turn a new, blank angular project into a bare-bones working dotCMS project — basically, to figure out the minimum number of changes required to interface successfully with the UVE.

But as Freddy was explaining to me earlier, that's not really the point of that readme, so we don't really need to go into step-by-step instructions, there.

That said, some of the templating commands that Freddy and Jalinson were discussing might be interesting to build at some point, to accomplish what I was thinking of. But it's not really a high priority when we have a perfectly good working example project — especially when a user can even do something like a git sparse checkout to clone only the example directory, etc.

@rjvelazco rjvelazco removed their assignment Oct 30, 2024
@rjvelazco rjvelazco moved this from In Review to Internal QA in dotCMS - Product Planning Oct 30, 2024
@rjvelazco rjvelazco reopened this Oct 30, 2024
@github-project-automation github-project-automation bot moved this from Internal QA to Current Sprint Backlog in dotCMS - Product Planning Oct 30, 2024
@rjvelazco rjvelazco moved this from Current Sprint Backlog to Internal QA in dotCMS - Product Planning Oct 30, 2024
fmontes added a commit that referenced this issue Oct 31, 2024
Related to #29212

Update `@dotcms/angular` library documentation and add comprehensive JSDoc comments.

* **README Updates**:
  - Add a clear introduction to the library and its purpose in `core-web/libs/sdk/angular/README.md`.
  - Include full step-by-step instructions on how to use the library.
  - Fix minor typos and improve clarity.
  - Update the example README in `examples/angular/README.md` to include necessary environment variables and tokens, and provide detailed instructions on how to start the example.

* **JSDoc Comments**:
  - Add comprehensive JSDoc comments for all inputs, properties, and methods in `core-web/libs/sdk/angular/src/lib/layout/column/column.component.ts`.
  - Add comprehensive JSDoc comments for all interfaces and properties in `core-web/libs/sdk/angular/src/lib/models/dotcms.model.ts`.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/dotCMS/core/issues/29212?shareId=XXXX-XXXX-XXXX-XXXX).
@zJaaal zJaaal self-assigned this Oct 31, 2024
@zJaaal
Copy link
Contributor

zJaaal commented Oct 31, 2024

IQA Passed

Documentation on code is clear and concise, the readme is well explained and the steps are clear.

@zJaaal zJaaal closed this as completed Oct 31, 2024
@zJaaal zJaaal moved this from Internal QA to QA - Backlog in dotCMS - Product Planning Oct 31, 2024
@zJaaal zJaaal removed their assignment Oct 31, 2024
@jdcmsd
Copy link
Contributor

jdcmsd commented Nov 7, 2024

This has come a long way, and it looks great! As with any doc, we can spend forever fiddling with it — or likewise return to it later if we learn about any special use-cases that a headless dev might need spelled out, etc. But right now, I'm comfortable calling this issue finished.

@bryanboza
Copy link
Contributor

Fixed, we cal close this one now based on the @jdcmsd feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment