-
Notifications
You must be signed in to change notification settings - Fork 480
#26696 adding a jsp to render a custom field #26716
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
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.
Check if this is not showing in the portlets in the tools and groups
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.
Did somebody checked this?
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.
?
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.
We need to add the partial /core/dotCMS/src/main/webapp/html/common/top_inc.jsp
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.
we should not need the top_inc?
…ore into issue-26696-legacy-custom-field
…dotCMS/core into issue-26696-legacy-custom-field
| %> | ||
|
|
||
| <%-- |
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.
you can remove this comment
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.
Done!
...t-content/src/lib/components/dot-edit-content-field/dot-edit-content-field.component.spec.ts
Outdated
Show resolved
Hide resolved
core-web/libs/edit-content/src/lib/services/dot-edit-content.service.ts
Outdated
Show resolved
Hide resolved
|
|
||
|
|
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.
remove
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.
Done!
| this.variables = this.field.fieldVariables.reduce((result, item) => { | ||
| result[item.key] = item.value; | ||
|
|
||
| return result; | ||
| }, {}); |
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.
We are using this in multiple places. Should we create a global util?
...nt/src/lib/fields/dot-edit-content-custom-field/dot-edit-content-custom-field.component.scss
Outdated
Show resolved
Hide resolved
| switch (event.data.type) { | ||
| case 'turnOnFullScreen': | ||
| this.isFullscreen = true; | ||
| break; | ||
|
|
||
| case 'turnOffFullScreen': | ||
| this.isFullscreen = false; | ||
| break; | ||
|
|
||
| default: | ||
| break; | ||
| } |
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.
can we avoid the use of switch/case ?
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.
Should we call this toggleFullScreen? and just do !... maybe?
...nt/src/lib/fields/dot-edit-content-custom-field/dot-edit-content-custom-field.component.scss
Outdated
Show resolved
Hide resolved
| } | ||
| }, | ||
| mockProvider(DotContentTypeService), | ||
| mockProvider(DotWorkflowActionsFireService) |
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.
I just check, is because the DotEditContentService uses DotWorkflowActionsFireService and you are not mocking DotEditContentService.
But now the questions here is bigger, why are you bringing all these services to the test if at first look the component you are testing here is no use to any of those, I think.
Also, I just noticed that this component is importing BlockEditorModule and DotEditContentBinaryFieldComponent, should those not be included in the DotEditContentFieldsModule as well?
| switch (event.data.type) { | ||
| case 'turnOnFullScreen': | ||
| this.isFullscreen = true; | ||
| break; | ||
|
|
||
| case 'turnOffFullScreen': | ||
| this.isFullscreen = false; | ||
| break; | ||
|
|
||
| default: | ||
| break; | ||
| } |
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.
Should we call this toggleFullScreen? and just do !... maybe?
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.
Did somebody checked this?
...t-content/src/lib/components/dot-edit-content-field/dot-edit-content-field.component.spec.ts
Outdated
Show resolved
Hide resolved
| } | ||
| }, | ||
| mockProvider(DotContentTypeService), | ||
| mockProvider(DotWorkflowActionsFireService) |
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.
We should talk about this in the next meeting.
| data-testId="iframe" | ||
| frameborder="0"></iframe> | ||
|
|
||
| <dot-icon *ngIf="isFullscreen" (click)="isFullscreen = false" name="close"></dot-icon> |
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 needs a <button> to make sure sematically ie clickable. We can use the primeng button with an icon https://primeng.org/button#icons
| } | ||
| }, | ||
| mockProvider(DotContentTypeService), | ||
| mockProvider(DotWorkflowActionsFireService) |
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.
Why this test all the fields? we should be testing each field independently... I might be missing something.
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.
?
| providers: [ | ||
| mockProvider(DotContentTypeService), | ||
| mockProvider(DotWorkflowActionsFireService) | ||
| ] |
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 is weird to me... I can't find any relationship between DotEditContentCustomFieldComponent and this services... there have to be something leaking somewhere or I am missing something.
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.
For me what looks like that needs to be mocked is DotEditContentService which is the only service in DotEditContentCustomFieldComponent
| [FIELD_TYPES.JSON]: { | ||
| component: DotEditContentJsonFieldComponent, | ||
| declarations: [MockComponent(DotEditContentJsonFieldComponent)] | ||
| } |
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.
Why do you pass the component and then mock it?
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.
cc: @rjvelazco you have more context of this case
| mockProvider(DotContentTypeService), | ||
| mockProvider(DotWorkflowActionsFireService) |
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.
I remove this 2, run the tests and passed... and also to make sure it wasn't cache or anything I changed the currentContentType from test to test123 and failed.
|
|

0.0% Coverage on New Code
0.0% Duplication on New Code
Adding a jsp to render a legacy custom field