Skip to content
This repository has been archived by the owner on Jun 10, 2023. It is now read-only.

Routing #57

Merged
merged 6 commits into from
Jun 16, 2022
Merged

Routing #57

merged 6 commits into from
Jun 16, 2022

Conversation

hkaintz
Copy link
Collaborator

@hkaintz hkaintz commented Jul 2, 2021

No description provided.

@hkaintz hkaintz requested a review from vobu July 2, 2021 09:54
@hkaintz hkaintz self-assigned this Jul 2, 2021

With **targets**, you define where a view or a component is loaded and where the view or component is shown on the UI. By referring to one or multiple targets in a route's definition, you can load and show the views or components once the route's pattern matches the current hash.

It is best practice to configure the routing in the descriptor file (`manifest.json`) while it is also possible to do it in the `Component.js` file or locally by calling the constructors of the classes, for example under the `sap.ui.core.routing` and `sap.m.routing` namespaces.
Copy link
Collaborator

Choose a reason for hiding this comment

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

even though technically true of course, i find the bare mention of the non-manifest options rather confusing to the reader. so IMHO i'd either elaborate on both (component, sub-classed routing) in configuration or similar

title: Configuration
name: configuration
parent: Routing and Navigation
nav_order: 3
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd suggest to make this the first sub-nav item after index: config is essential before anything :)

@@ -0,0 +1,71 @@
---
Copy link
Collaborator

Choose a reason for hiding this comment

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

all of the route pattern items need a code exmaple IMO - it's really difficult for the reader to translate the prose to code him-/herself


</div>

## Config
Copy link
Collaborator

Choose a reason for hiding this comment

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

same comment as in patterns: this needs code example to make it "visible" for the reader what the options are all about


## Methods

Navigation can be triggered by method the [navTo](https://sapui5.hana.ondemand.com/#/api/sap.ui.core.routing.Router%23methods/navTo){:target="_blank"} on `sap.ui.core.routing.Router`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

the method

Copy link
Collaborator

Choose a reason for hiding this comment

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

also, try using https://ui5.sap.com as the documentation domain - b/c reasons, you know ... :)


Navigation can be triggered by method the [navTo](https://sapui5.hana.ondemand.com/#/api/sap.ui.core.routing.Router%23methods/navTo){:target="_blank"} on `sap.ui.core.routing.Router`.

You can use a generic navTo method in your BaseController and call it from any controller within your applicataion:
Copy link
Collaborator

Choose a reason for hiding this comment

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

typo "application"


return Controller.extend("myApp.controller.BaseController",

navTo: function(sName, oParameters, oComponentTargetInfo, bReplace) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

what about ES6-ing things, à la:

sap.ui.require(..., (Controller) => {
    navTo(sName, oParameters, ...) { }
})

but this just a hint, not a necessity :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I personally would also prefer always programming ES6, but still a lot of customers I have require apps to also run in IE. Hence I always provide examples in ES5 style.


### RouteMatched

The routeMatched event is fired if a pattern of any route in the routing configuration is matched.
Copy link
Collaborator

Choose a reason for hiding this comment

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

code fence routeMatched

Copy link
Collaborator

Choose a reason for hiding this comment

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

and: the code example shows the handler for the patternMatched event, not the routeMatched

});
```

### Matched
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is actually the routeMatched event, right? (see above)


## Titles in Targets

Routing in SAPUI5 allows you to define titles declaratively in the configuration. The title can be set with valid binding syntax which is then resolved under the scope of the target to which it belongs. This means that the title can be translated when it’s bound to the i18n model or resolved dynamically under the current binding context.
Copy link
Collaborator

Choose a reason for hiding this comment

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

supercool!

@marianfoo marianfoo linked an issue Aug 12, 2021 that may be closed by this pull request
@marianfoo
Copy link
Member

Hi @hkaintz
what´s the current status here?
You need any help?

@github-actions
Copy link

github-actions bot commented Oct 27, 2021

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@hkaintz
Copy link
Collaborator Author

hkaintz commented Oct 29, 2021

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Oct 29, 2021
@hkaintz
Copy link
Collaborator Author

hkaintz commented Oct 29, 2021

I have read the CLA Document and I hereby sign the CLA

@treee111
Copy link
Collaborator

Hi @hkaintz you can try this to rewrite the commits.
For example the last 10 commits:
git rebase -i HEAD~10

If it fails you can reset hard from the remote to reset your local branch

@hkaintz
Copy link
Collaborator Author

hkaintz commented Dec 2, 2021

@marianfoo Ich habs gerade mit git rebase versucht, hat leider nicht funktioniert. Die neuen commits haben zwar den richtigen User, aber die Alten sind immer noch da.
Ist es möglich vorübergehend den check zu disablen?

@hkaintz
Copy link
Collaborator Author

hkaintz commented Dec 2, 2021

I have read the CLA Document and I hereby sign the CLA

@marianfoo
Copy link
Member

@marianfoo Ich habs gerade mit git rebase versucht, hat leider nicht funktioniert. Die neuen commits haben zwar den richtigen User, aber die Alten sind immer noch da. Ist es möglich vorübergehend den check zu disablen?

Hi @hkaintz, ja wir können für diesen Fall trotzdem mergen. Mit deinen GitHub User hast du ja unterschrieben.
@vobu ist mit dem PR alles ok?

@marianfoo marianfoo added the new topic create a new topic label Jan 16, 2022
hkaintz and others added 2 commits January 23, 2022 15:51
feat: initial commit for routing

fix: removed non-manifest routing options

fix: changed nav order of confi chapter

feat: added examples for patterns

feat: added example for config

fix: minor fixes

fix: changed user

fix: changed user

feat: initial commit for routing

fix: removed non-manifest routing options

fix: changed nav order of confi chapter

feat: added examples for patterns

feat: added example for config

fix: minor fixes

fix: changed user

fix: changed user
@marianfoo
Copy link
Member

@hkaintz fixed Error with "CLA Assistant" by sqashing your commits into one

@marianfoo marianfoo merged commit 69cc536 into 1DSAG:main Jun 16, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jun 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
new topic create a new topic
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Herbert to the Topic Collection under the topic Navigation
4 participants