-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7875 from owncloud/introduce-meta-auth-context
Introduce meta authContext
- Loading branch information
Showing
27 changed files
with
451 additions
and
362 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Enhancement: Auth context in route meta props | ||
|
||
The route meta prop has been extended by a new "meta.authContext" property (can be one out of "anonymous", "user", "publicLink" or "hybrid"). With this, app developers can now define anonymous routes, which was hardcoded to a few well known route names before. | ||
Anonymous routes are rendered in the application layout, i.e. with the top bar, as the ownCloud Web Chrome should always be visible to the user (except for a few handpicked exceptions in the web runtime, which are still rendered in the plain layout). | ||
|
||
https://github.com/owncloud/web/issues/7234 | ||
https://github.com/owncloud/web/issues/7863 | ||
https://github.com/owncloud/web/pull/7874 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,19 @@ | ||
import { RouteMeta } from 'vue-router' | ||
|
||
type Dictionary<T> = { [key: string]: T } | ||
|
||
export type QueryValue = string | (string | null)[] | ||
export type LocationQuery = Dictionary<QueryValue> | ||
|
||
export type ParamValue = string | ||
export type LocationParams = Dictionary<ParamValue> | ||
|
||
export const authContextValues = ['anonymous', 'user', 'publicLink', 'hybrid'] as const | ||
export type AuthContext = typeof authContextValues[number] | ||
|
||
export interface WebRouteMeta extends RouteMeta { | ||
title?: string | ||
authContext?: AuthContext | ||
patchCleanPath?: boolean | ||
contextQueryItems?: string[] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,35 @@ | ||
<template> | ||
<div> | ||
<div | ||
class="oc-login oc-height-viewport" | ||
:style="{ backgroundImage: 'url(' + backgroundImg + ')' }" | ||
> | ||
<h1 class="oc-invisible-sr" v-text="pageTitle" /> | ||
<router-view /> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent } from '@vue/composition-api' | ||
import { computed, defineComponent, unref } from '@vue/composition-api' | ||
import { useRouteMeta, useStore, useTranslations } from 'web-pkg' | ||
export default defineComponent({ | ||
name: 'PlainLayout' | ||
name: 'PlainLayout', | ||
setup() { | ||
const store = useStore() | ||
const { $gettext } = useTranslations() | ||
const title = useRouteMeta('title') | ||
const pageTitle = computed(() => { | ||
return $gettext(unref(title)) | ||
}) | ||
const backgroundImg = computed(() => { | ||
return store.getters.configuration?.currentTheme?.loginPage?.backgroundImg | ||
}) | ||
return { | ||
pageTitle, | ||
backgroundImg | ||
} | ||
} | ||
}) | ||
</script> |
Oops, something went wrong.