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

#22418 Page Manager (first attempt) - Create Favorite Page #22424

Merged
merged 41 commits into from Aug 8, 2022

Conversation

jdotcms
Copy link
Contributor

@jdotcms jdotcms commented Jun 16, 2022

  • Adding permissions to the workflow
  • Creating favorite page contentlet functionality

@github-actions
Copy link

github-actions bot commented Jun 29, 2022

Unit Tests Report

1 318 tests   1 308 ✔️  3m 4s ⏱️
   127 suites       10 💤
   127 files           0

Results for commit 94b06c7.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Jun 29, 2022

Integration Tests [postgres] Report

   378 files     378 suites   57m 55s ⏱️
3 690 tests 3 641 ✔️ 23 💤 26
3 709 runs  3 660 ✔️ 23 💤 26

For more details on these failures, see this check.

Results for commit 94b06c7.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Jun 29, 2022

Integration Tests [mssql] Report

   377 files     377 suites   1h 22m 53s ⏱️
3 685 tests 3 620 ✔️ 23 💤 42
3 704 runs  3 639 ✔️ 23 💤 42

For more details on these failures, see this check.

Results for commit 94b06c7.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Jun 29, 2022

Postman Tests Report

     60 files  1 089 suites   2h 47m 20s ⏱️
   464 tests    459 ✔️ 0 💤 5
1 793 runs  1 784 ✔️ 0 💤 9

For more details on these failures, see this check.

Results for commit 94b06c7.

♻️ This comment has been updated with latest results.

@alfredo-dotcms alfredo-dotcms force-pushed the issue-22418-wfapi-permission branch from bea8c96 to cc3f200 Compare Jul 15, 2022
@alfredo-dotcms
Copy link
Contributor

alfredo-dotcms commented Jul 28, 2022

QA

  1. When try to save for a second time, it fail, but error is behind the dialog.
    Fixed

UX

  1. When is saved, we should show the star "active" to indicate that is already saved.
    this will be done on the next PR --> Edit Favorite Page
  2. The design needs work, for example the screenshot on the top and the hidden form below is no-no
    A new task needs to be created to do UI redesign

@alfredo-dotcms alfredo-dotcms force-pushed the issue-22418-wfapi-permission branch from 82137ca to d7f940e Compare Jul 28, 2022
form: FormGroup;
isFormValid$: Observable<boolean>;
pageRenderedHtml: string;
Copy link
Member

@fmontes fmontes Jul 28, 2022

Choose a reason for hiding this comment

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

private?

Copy link
Contributor

@alfredo-dotcms alfredo-dotcms Jul 30, 2022

Choose a reason for hiding this comment

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

done

loading: boolean;
closeDialog: boolean;
}

export const enum LoadingState {
INIT = 'INIT',
LOADING = 'LOADING',
LOADED = 'LOADED'
}
Copy link
Member

@fmontes fmontes Jul 28, 2022

Choose a reason for hiding this comment

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

We should unify LoadingState and loading being a boolean, makes no sense to have two, check this post: https://indepth.dev/posts/1033/ngrx-how-and-where-to-handle-loading-and-error-states-of-ajax-calls

// This is needed to wait until the Web Component is rendered
setTimeout(() => {
const dotHtmlToImageElement = document.querySelector('dot-html-to-image');
dotHtmlToImageElement.addEventListener('pageThumbnail', (event: CustomEvent) => {
Copy link
Member

@fmontes fmontes Jul 28, 2022

Choose a reason for hiding this comment

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

Are you testing this?

Copy link
Contributor

@alfredo-dotcms alfredo-dotcms Jul 30, 2022

Choose a reason for hiding this comment

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

done

}, '*')
});
}).catch(function (error) {
console.error('oops, something went wrong!', error);
Copy link
Contributor

@hmoreras hmoreras Jul 28, 2022

Choose a reason for hiding this comment

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

improve this message ?

Copy link
Contributor

@rjvelazco rjvelazco Jul 30, 2022

Choose a reason for hiding this comment

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

Shouldn't we show a popup? So the user can see the message. We can also use an alert.

Copy link
Contributor

@alfredo-dotcms alfredo-dotcms Aug 1, 2022

Choose a reason for hiding this comment

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

done

forkJoin([this.dotRolesService.search(), this.dotCurrentUser.getCurrentUser()])
.pipe(take(1))
.subscribe(([roles, currentUser]: [DotRole[], DotCurrentUser]): void => {
console.log(roles, currentUser);
Copy link
Contributor

@hmoreras hmoreras Jul 28, 2022

Choose a reason for hiding this comment

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

remove

Copy link
Contributor

@alfredo-dotcms alfredo-dotcms Jul 29, 2022

Choose a reason for hiding this comment

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

done

pageState: DotPageRenderState;
}

export interface DotFavoritePageFormData {
Copy link
Contributor

@hmoreras hmoreras Jul 28, 2022

Choose a reason for hiding this comment

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

move these interfaces to other file ?

Copy link
Contributor

@alfredo-dotcms alfredo-dotcms Jul 29, 2022

Choose a reason for hiding this comment

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

this is only used on this component due to its props and form

Copy link
Member

@fmontes fmontes Aug 1, 2022

Choose a reason for hiding this comment

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

Then export is not need it.

Copy link
Contributor

@alfredo-dotcms alfredo-dotcms Aug 5, 2022

Choose a reason for hiding this comment

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

Then export is not need it.

it's also used on the STORE (that's why the export), still don't think it's needed to be put on a separate file

Copy link
Member

@fmontes fmontes Aug 8, 2022

Choose a reason for hiding this comment

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

@oidacra and I are working in a structure for this... will be out soon.

}
});

// This is needed to wait until the Web Component is rendered
Copy link
Contributor

@hmoreras hmoreras Jul 28, 2022

Choose a reason for hiding this comment

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

ca we use ngAfterViewInit ?

Copy link
Contributor

@alfredo-dotcms alfredo-dotcms Jul 30, 2022

Choose a reason for hiding this comment

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

done

@@ -5,6 +5,11 @@
[url]="pageState.page.pageURI"
[apiLink]="apiLink"
></dot-edit-page-info>
<!-- <dot-icon-button
Copy link
Contributor

@hmoreras hmoreras Jul 28, 2022

Choose a reason for hiding this comment

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

remove ?

Copy link
Contributor

@alfredo-dotcms alfredo-dotcms Jul 29, 2022

Choose a reason for hiding this comment

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

this is hidden while it gets ready for release

forkJoin([this.dotRolesService.search(), this.dotCurrentUser.getCurrentUser()])
.pipe(take(1))
.subscribe(([roles, currentUser]: [DotRole[], DotCurrentUser]): void => {
console.log(roles, currentUser);
Copy link
Contributor

@rjvelazco rjvelazco Jul 30, 2022

Choose a reason for hiding this comment

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

Remove console.log

});

// This is needed to wait until the Web Component is rendered
setTimeout(() => {
Copy link
Contributor

@rjvelazco rjvelazco Jul 30, 2022

Choose a reason for hiding this comment

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

Maybe we can use requestAnimationFrame instead of setTimeout. doc

}, '*')
});
}).catch(function (error) {
console.error('oops, something went wrong!', error);
Copy link
Contributor

@rjvelazco rjvelazco Jul 30, 2022

Choose a reason for hiding this comment

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

Shouldn't we show a popup? So the user can see the message. We can also use an alert.

@alfredo-dotcms alfredo-dotcms force-pushed the issue-22418-wfapi-permission branch from 4730bca to 93d651e Compare Aug 1, 2022
pageState: DotPageRenderState;
}

export interface DotFavoritePageFormData {
Copy link
Member

@fmontes fmontes Aug 1, 2022

Choose a reason for hiding this comment

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

Then export is not need it.

isAdmin: props.pageState.user.admin,
imgWidth: parseInt(props.pageState.params.viewAs.device?.cssWidth, 10) || 1024,
imgHeight:
parseInt(props.pageState.params.viewAs.device?.cssHeight, 10) ||
(parseInt(props.pageState.params.viewAs.device?.cssWidth, 10) || 1024) /
IMG_RATIO_43
};
Copy link
Member

@fmontes fmontes Aug 1, 2022

Choose a reason for hiding this comment

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

Still think that is an overhead send the pageState to use 3 props.

Copy link
Contributor

@alfredo-dotcms alfredo-dotcms Aug 5, 2022

Choose a reason for hiding this comment

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

changed!

<dot-icon-button
data-testId="addFavoritePageButton"
icon="star_outline"
(click)="addFavoritePage()"
></dot-icon-button>
Copy link
Member

@fmontes fmontes Aug 1, 2022

Choose a reason for hiding this comment

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

We need to hide this at this point no?

Copy link
Contributor

@alfredo-dotcms alfredo-dotcms Aug 5, 2022

Choose a reason for hiding this comment

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

fixed


doc.body.append(scriptLib);

window.addEventListener('message', (event) => {
Copy link
Member

@fmontes fmontes Aug 2, 2022

Choose a reason for hiding this comment

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

Take a look at this video: https://youtu.be/YDU_3WdfkxA?t=681

I think this code will result in the same issue.

Copy link
Contributor

@alfredo-dotcms alfredo-dotcms Aug 5, 2022

Choose a reason for hiding this comment

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

fixed!

fmontes
fmontes approved these changes Aug 8, 2022
@alfredo-dotcms alfredo-dotcms force-pushed the issue-22418-wfapi-permission branch from 5e959ca to 94b06c7 Compare Aug 8, 2022
fmontes
fmontes approved these changes Aug 8, 2022
@nollymar nollymar merged commit 4d53ab4 into master Aug 8, 2022
13 of 24 checks passed
@delete-merged-branch delete-merged-branch bot deleted the issue-22418-wfapi-permission branch Aug 8, 2022
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.

None yet

6 participants