feat(web): add public package browsing and organization redirect management
This commit is contained in:
@@ -39,6 +39,9 @@ export class SgAppShell extends DeesElement {
|
||||
@state()
|
||||
accessor localAuthEnabled: boolean = true;
|
||||
|
||||
@state()
|
||||
accessor showLoginForm: boolean = false;
|
||||
|
||||
private viewTabs = [
|
||||
{
|
||||
name: 'Dashboard',
|
||||
@@ -117,7 +120,24 @@ export class SgAppShell extends DeesElement {
|
||||
];
|
||||
|
||||
public render(): TemplateResult {
|
||||
if (!this.loginState.isLoggedIn) {
|
||||
// Authenticated: full appdash
|
||||
if (this.loginState.isLoggedIn) {
|
||||
return html`
|
||||
<div class="maincontainer">
|
||||
<dees-simple-appdash
|
||||
name="Stack.Gallery"
|
||||
.viewTabs=${this.resolvedViewTabs}
|
||||
.selectedView=${this.resolvedViewTabs.find(
|
||||
(t) => t.name.toLowerCase().replace(/\s+/g, '-') === this.uiState.activeView,
|
||||
) || this.resolvedViewTabs[0]}
|
||||
>
|
||||
</dees-simple-appdash>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
// Login form requested
|
||||
if (this.showLoginForm) {
|
||||
return html`
|
||||
<div class="maincontainer">
|
||||
<sg-login-view
|
||||
@@ -133,16 +153,14 @@ export class SgAppShell extends DeesElement {
|
||||
`;
|
||||
}
|
||||
|
||||
// Public browsing mode: package search + detail
|
||||
return html`
|
||||
<div class="maincontainer">
|
||||
<dees-simple-appdash
|
||||
name="Stack.Gallery"
|
||||
.viewTabs=${this.resolvedViewTabs}
|
||||
.selectedView=${this.resolvedViewTabs.find(
|
||||
(t) => t.name.toLowerCase().replace(/\s+/g, '-') === this.uiState.activeView,
|
||||
) || this.resolvedViewTabs[0]}
|
||||
<sg-public-layout
|
||||
@sign-in=${() => { this.showLoginForm = true; }}
|
||||
>
|
||||
</dees-simple-appdash>
|
||||
<sg-view-public-packages></sg-view-public-packages>
|
||||
</sg-public-layout>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user