feat: Adding Navigation Settings Functionality (#19272)

## Description
 
> This PR implements backend model and APIs for Part 1 of Improved App
Viewer Navigation Project i.e implementing the navigation configuration
settings
> [Notion
Doc](https://www.notion.so/appsmith/Improved-app-viewer-navigation-6126afa2a3694cad84382874a3f1bd9d#9d20423e53a54ec898083ab41f388af2)
> [Figma
Design](https://www.figma.com/proto/EkPT7FdqmArkk9L7mySA5S/NAV---Designs?page-id=748%3A313757&node-id=935%3A478734&viewport=303%2C-336%2C0.04&scaling=min-zoom&starting-point-node-id=935%3A478734)


Implements #19163 

## Implementation

It reuses the following existing APIs to implement storing and fetching
navigation settings:

/api/v1/applications/{applicationId} (PUT)
/api/v1/pages?applicationId=\<applicationId>(GET)

Additional fields `unpublishedNavigationSetting` and
`publishedNavigationSetting` have been added to the `application`
collection.


## Type of change
- New feature (non-breaking change which adds functionality)


## How Has This Been Tested?
- Manual

## Testing Results
> Postman testing results attached below

**Update publishedNavigationSetting API**

- API Route: /api/v1/applications/{applicationId}
- API Method: PUT
- API JSON Response:
[http://jsonblob.com/1057577523797573632](http://jsonblob.com/1057577523797573632)

<img width="818" alt="image"
src="https://user-images.githubusercontent.com/25542733/209783302-284cc505-fd78-43c7-8cd1-10b3d7295914.png">

**Update unpublishedNavigationSetting API**

- API Route: /api/v1/applications/{applicationId}
- API Method: PUT
- API JSON Response:
[http://jsonblob.com/1057578112661078016](http://jsonblob.com/1057578112661078016)

<img width="702" alt="image"
src="https://user-images.githubusercontent.com/25542733/209783640-97189e85-04a9-490b-b766-8f8fca908633.png">

**Database Record**

<img width="566" alt="image"
src="https://user-images.githubusercontent.com/25542733/209784012-58556a22-90a1-4d79-b99a-cc652415f5a6.png">

**GET Published and Unpublished Navigation Settings API**

- API Route: /api/v1/pages?applicationId=\<applicationId>
- API Method: GET
- API JSON Response:
[http://jsonblob.com/1057580262598393856](http://jsonblob.com/1057580262598393856)

<img width="732" alt="image"
src="https://user-images.githubusercontent.com/25542733/209784732-27340689-6616-404a-8cf7-dfb60737dc5c.png">






## Checklist:
### Dev activity
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [x] PR is being merged under a feature flag


### QA activity:
- [ ] Test plan has been approved by relevant developers
- [ ] Test plan has been peer reviewed by QA
- [ ] Cypress test cases have been added and approved by either SDET or
manual QA
- [ ] Organized project review call with relevant stakeholders after
Round 1/2 of QA
- [ ] Added Test Plan Approved label after reveiwing all Cypress test
This commit is contained in:
Nilansh Bansal 2022-12-29 18:09:12 +05:30 committed by GitHub
parent 9dfba20e5b
commit 6e4805d5bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,6 +47,7 @@ public class Application extends BaseDomain {
TODO: remove default values from application.
*/
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
@Deprecated(forRemoval = true)
Boolean isPublic = false;
List<ApplicationPage> pages;
@ -109,6 +110,11 @@ public class Application extends BaseDomain {
EmbedSetting embedSetting;
NavigationSetting unpublishedNavigationSetting;
NavigationSetting publishedNavigationSetting;
/**
* Earlier this was returning value of the updatedAt property in the base domain.
* As this property is modified by the framework when there is any change in domain,
@ -251,11 +257,28 @@ public class Application extends BaseDomain {
* EmbedSetting is used for embedding Appsmith apps on other platforms
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public static class EmbedSetting {
private String height;
private String width;
private Boolean showNavigationBar;
}
/**
* NavigationSetting stores the navigation configuration for the app
*/
@Data
public static class NavigationSetting {
private Boolean showNavbar;
private String orientation;
private String navStyle;
private String position;
private String itemStyle;
private String colorStyle;
private String logoAssetId;
private String logoConfiguration;
private Boolean showSignIn;
private Boolean showShareApp;
}
}