Meeds-io / MIPs

The Meeds Improvement Proposal repository
0 stars 0 forks source link

Single Note View #93

Closed srenault-meeds closed 1 year ago

srenault-meeds commented 1 year ago

Rationale

As a platform admin, it is not possible to add text and to display it in a page. Yet, we aime to deliver a public page soon and we need to have something available so the admin can add texts.

1. Functional Requirements

Top User Stories

As a platform admin or a space host, I can add text in a page using "Single Note View Portlet".

Precision

First I have no need to edit the layout as I have no access to do such action. So I have an edit option proposed so I can open a WYSIWYG inline with simple options in the editor toolbar:

image

Then I can decide to open the advanced editor in a new tab. Thus, the notes pages opens. This note is not in any space for now.

image

Once I save my edition, the content is displayed as expected (WYSIWYG speaking)

AND I can edit or remove it thanks to a three dots option displayed when hovering it.

image

Impacts

NA

Gamification

NA

Notifications

NA

Analytics

NA

Unified Search

NA

2. Technical Requirements

Security

The SNV portlet (same as Links) content access has to follow the following ACL rules:

Who can Edit it

Who can Access it

Upgradability

(Same as Links Portlet) When the merge or overwrite import mode are applied to pages, the portlet settings has to remain as was set using UI.

Feature Flags

No feature flag

3. Software Architecture

Security

The BaseCMSPortlet introduced in #92 will be reused to rely on the same Permission settings of CMS portlets. The permissions algorithm as LinkService#hasAccessPermission and LinkService#hasEditPermission has to be reused to secure the access to REST endpoint.

Access

A new REST endpoint has to be implemented in order to allow adding and retrieving notes content by portlet setting name (this name is stored in portlet preferences as unique identifier of the portlet settings). This REST endpoint will apply the CMS based applications Access Control List algorithm check (See above).

Services & processing

Knowing that the Notes Service API has been reworked recently to manage only Pages/Notes from Spaces, an adaptation has to be made to allow storing system notes that aren't accessible via regular notes Tree.

To do this, a system user owner will be used instead. When editing in FullPage mode, the UI components are quite different from regular edition mode. Thus a small adaptation will be made on Notes Editor to hide the title and display the target page name in top of Editor.

As done for LinkPortlet, a NotePageView portlet will be added that will rely on a unique Setting Name attached to each Portlet instance and stored in preferences. A dedicated REST Endpoint will be used to retrieve and modify the note page by name switch CMS Based Permission algorithm. The name of the page will be exactly the same as Setting Name stored in Portlet preference to allow retrieving the note.

In order to simplify re-using the same strategy as Links portlet, a CMSService will be added to centralize the Access & Edit permissions check switch space identifier & pageReference. At the same time, this Service will implement a reusable strategy to allow associating a setting name to a page reference and space identifier using MetadataService. In fact a new MetadataType will be defined to allow such association to not having to change existing data models to add references to pages where the content has been added. Using the new CMSService Service, a generic CMSPortlet can be added to simplify future implementations for CMS based portlets in order to centralize the ACL & Page association computing by reducing at the same time the complexity of developing new CMS portlets.

Data and persistence

No change is needed in Notes DB entities.

srenault-meeds commented 1 year ago

@margondicco for review

margondicco commented 1 year ago

ok go func

boubaker commented 1 year ago

@srenault-meeds 1/ should we consider the edit permissions designed in this MIP comment: https://github.com/Meeds-io/MIPs/issues/92#issuecomment-1742425191

...I have an edit option proposed so I can open a WYSIWYG inline with simple options in the editor toolbar ...I can decide to open the advanced editor in a new tab. Thus, the notes pages opens ...I save my edition, the content is displayed as expected

As you may know, eXo is reworking the notes editor style to be specific to Notes CKEditor (in MIP #71). How can we deal with this difference knwing that the description style in edition will be different from view mode style ? Should we bring this difference of style in Inline CKEditor as well ? Should we fix the work done in MIP #71 to make the style compliant and giving a real WYSIWYG effect ?

We may need to wait for MIP #71 to be finished in order to work this switch the result made.

srenault-meeds commented 1 year ago

1/ yes for permissions indeed. I will update the description.

2/ Regarding your concern regarding MIP #71 yes, let's talk about it during product committee today.

boubaker commented 1 year ago

Ready for Review by DAO members (eXo: @rdenarie )

boubaker commented 1 year ago

Ready for Review by DAO members (eXo: @rdenarie )

Modified to enhance productivity and common components centralization in order to allow reusing stuff for future CMS Based Portlets.

rdenarie commented 1 year ago

Go tech

boubaker commented 1 year ago

A small adaptation has been made in Tech Spec knowing that the changes to make on Notes editor will not generate too much conflict with #71 @rdenarie

The modification is about this updated section:

Thus a dedicated set of UI component has to be defined to allow the extensibility of current Notes Editor application. To do this, the Notes Editor shouldn't be altered but redefined in a new UI component which will reuse some components for the whole display

to

Thus a small adaptation will be made on Notes Editor to hide the title and display the target page name in top of Editor.

boubaker commented 1 year ago

PRs ready to review by DAO members ( eXo: @rdenarie )

boubaker commented 1 year ago

PRs ready to review by DAO members ( eXo: @rdenarie )

Two feedbacks are received that will be considered in this MIP:

rdenarie commented 1 year ago

All PR validated

boubaker commented 1 year ago

All PR validated

Thanks, merged.