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

Site/Folder Field: The host path is invalid #31126

Closed
nicobytes opened this issue Jan 14, 2025 · 2 comments · Fixed by #31187
Closed

Site/Folder Field: The host path is invalid #31126

nicobytes opened this issue Jan 14, 2025 · 2 comments · Fixed by #31187

Comments

@nicobytes
Copy link
Contributor

Parent Issue

No response

Problem Statement

The path doesn't have a path by default:

Image

An error is displayed as a result:

Image

Steps to Reproduce

Steps to reproduce:

  1. Enable the new editor content by setting DOT_FEATURE_FLAG_NEW_EDIT_PAGE and DOT_CONTENT_EDITOR2_ENABLED to true.
  2. Create a new content type: navigate to Content Model > Content Type > Create Content.
  3. Enable the Edit Content Beta feature.
  4. Open the content created previously.
  5. Add a Site/Folder field
  6. Create a content type

Acceptance Criteria

The field should either retrieve a proper host or set a default host appropriately

dotCMS Version

lastest

Proposed Objective

User Experience

Proposed Priority

Please Select

External Links... Slack Conversations, Support Tickets, Figma Designs, etc.

No response

Assumptions & Initiation Needs

No response

Quality Assurance Notes & Workarounds

No response

Sub-Tasks & Estimates

No response

@nicobytes nicobytes self-assigned this Jan 14, 2025
@nicobytes nicobytes removed the Triage label Jan 14, 2025
@nicobytes nicobytes moved this from New to Current Sprint Backlog in dotCMS - Product Planning Jan 14, 2025
@nicobytes nicobytes changed the title The host path in invalid The host path is invalid Jan 14, 2025
@nicobytes nicobytes changed the title The host path is invalid Site/Folder Field: The host path is invalid Jan 15, 2025
@nicobytes nicobytes moved this from Current Sprint Backlog to In Progress in dotCMS - Product Planning Jan 16, 2025
@nicobytes nicobytes added on hold In Progress, but paused to work on higher priority card and removed on hold In Progress, but paused to work on higher priority card labels Jan 21, 2025
@nicobytes nicobytes linked a pull request Jan 22, 2025 that will close this issue
3 tasks
Copy link

@nicobytes nicobytes moved this from In Progress to In Review in dotCMS - Product Planning Jan 24, 2025
github-merge-queue bot pushed a commit that referenced this issue Jan 28, 2025
### Parent Issue

#31126 

### Proposed Changes

This pull request includes various changes to improve the functionality
and structure of the `dot-edit-content-host-folder-field` component. The
changes mainly focus on replacing the `DotEditContentService` with the
new `HostFieldService`, updating the component's HTML and TypeScript
files, and introducing new models and services.

Key changes include:

### Service Replacement and Updates:
* Replaced `DotEditContentService` with `HostFieldService` across
multiple files to handle site and folder data retrieval and
transformation.
(`core-web/libs/edit-content/src/lib/fields/dot-edit-content-host-folder-field/dot-edit-content-host-folder-field.component.spec.ts`,
`core-web/libs/edit-content/src/lib/fields/dot-edit-content-host-folder-field/store/host-folder-field.store.spec.ts`,
`core-web/libs/edit-content/src/lib/fields/dot-edit-content-host-folder-field/store/host-folder-field.store.ts`)
[[1]](diffhunk://#diff-138ef348fe4a2b7031ca80e92abbe34be1c09ed8f026b1c15d15f471661e5879L33-R34)
[[2]](diffhunk://#diff-eb09552f71fb3d3ed34915fb21cb49d26f3d15753b64c8c370d82a0373c6cab3L9-R34)
[[3]](diffhunk://#diff-62eb8decc8d976468da0c15dc971d8d5e0cdbe34e61763c1a088eab45ebc93f5L65-R91)

### HTML Template Updates:
* Updated the HTML template to include a new `ng-template` for
displaying the value with a double slash prefix and added a minimum
height style to the component.
(`core-web/libs/edit-content/src/lib/fields/dot-edit-content-host-folder-field/dot-edit-content-host-folder-field.component.html`)
[[1]](diffhunk://#diff-cef779df6c3f6af56f40c207b991830641de70ef229426851bd644556be8bb81L15-R16)
[[2]](diffhunk://#diff-cef779df6c3f6af56f40c207b991830641de70ef229426851bd644556be8bb81R25-R27)

### Utility Function and Type Updates:
* Modified the utility function in `utils.ts` to return the final path
without a double slash prefix.
(`core-web/libs/edit-content/src/lib/components/dot-edit-content-form/utils.ts`)
* Introduced new types and interfaces in `tree-item.model.ts` to define
the structure of tree nodes and related data.
(`core-web/libs/edit-content/src/lib/fields/dot-edit-content-host-folder-field/models/tree-item.model.ts`)

### Component and Service Enhancements:
* Implemented the `HostFieldService` to manage site and folder data
retrieval, including methods for fetching sites, current site, folders,
and building a hierarchical tree structure.
(`core-web/libs/edit-content/src/lib/fields/dot-edit-content-host-folder-field/services/host-field.service.ts`)
* Updated the `HostFolderFiledStore` to use the new `HostFieldService`
and adjusted the state management logic.
(`core-web/libs/edit-content/src/lib/fields/dot-edit-content-host-folder-field/store/host-folder-field.store.ts`)
[[1]](diffhunk://#diff-62eb8decc8d976468da0c15dc971d8d5e0cdbe34e61763c1a088eab45ebc93f5R10-L23)
[[2]](diffhunk://#diff-62eb8decc8d976468da0c15dc971d8d5e0cdbe34e61763c1a088eab45ebc93f5L36-R34)
[[3]](diffhunk://#diff-62eb8decc8d976468da0c15dc971d8d5e0cdbe34e61763c1a088eab45ebc93f5L47-R46)

### Checklist
- [x] Tests
- [x] Translations
- [x] Security Implications Contemplated (add notes if applicable)

### Additional Info
** any additional useful context or info **

### Screenshots
Original             |  Updated
:-------------------------:|:-------------------------:
** original screenshot **  |  ** updated screenshot **
@github-project-automation github-project-automation bot moved this from In Review to Done in dotCMS - Product Planning Jan 28, 2025
@nicobytes nicobytes moved this from Done to Internal QA in dotCMS - Product Planning Jan 28, 2025
@oidacra oidacra assigned oidacra and unassigned nicobytes Jan 28, 2025
@oidacra
Copy link
Member

oidacra commented Jan 28, 2025

IQA PASSED

  • The site/host field does not a default path
  • If you change it, store the value
  • Retrieve the value stored properly.
CleanShot.2025-01-28.at.11.40.57.mp4

@oidacra oidacra moved this from Internal QA to Done in dotCMS - Product Planning Jan 28, 2025
@nicobytes nicobytes self-assigned this Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment