Skip to content

Commit 5fa2f9d

Browse files
committed
removed logs, used global parameter in panes instead of modifing label, unregistered dashboard pane
1 parent 120be7b commit 5fa2f9d

7 files changed

Lines changed: 20 additions & 8 deletions

File tree

src/dashboard/dashboardPane.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ import { DataBrowserContext, PaneDefinition } from 'pane-registry'
77
export const dashboardPane: PaneDefinition = {
88
icon: icons.iconBase + 'noun_547570.svg',
99
name: 'dashboard',
10-
label: () => { return 'Dashboard' }, // we do not care if it is a WebID or not, not yet
10+
label: subject => {
11+
if (subject.termType === 'NamedNode' && subject.uri === subject.site().uri) {
12+
return 'Dashboard'
13+
}
14+
return null
15+
},
1116
render: (subject, context) => {
1217
console.log('Dashboard Pane Render')
1318
const dom = context.dom

src/dashboard/homepage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function createTitle (uri: string, name: string): HTMLElement {
4343
profileLink.innerText = name
4444

4545
const profileLinkPost = document.createElement('span')
46-
profileLinkPost.innerText = '\'s Pod'
46+
profileLinkPost.innerText = '\'s Profile'
4747

4848
const title = document.createElement('h1')
4949
title.appendChild(profileLink)

src/mainPage/menu.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,6 @@ async function openDashboardPane (subject, outliner: any, pane: string): Promise
242242
}
243243
subject = await loadProfileFromURI(subject, store, fetcher)
244244
}
245-
console.log(`-----Opening dashboard pane ${pane} for`, subject)
246245
outliner.showDashboard(subject, {
247246
pane
248247
})

src/outline/manager.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2294,7 +2294,6 @@ export default function (context) {
22942294
@param table -- option -- default is an HTML table element in which to put the outline.
22952295
*/
22962296
this.GotoSubject = function (subject, expand, pane, solo, referrer, table) {
2297-
console.log('-----GotoSubject ', subject.termType, subject.value)
22982297
table = table || getOutlineContainer() // if does not exist create a compatible host in the current shell
22992298
if (solo) {
23002299
UI.utils.emptyNode(table)

src/profileUtils/ownerProfile.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export async function loadProfileFromURI (
1717
// TODO: This is a hack - we cannot assume that the profile is at this document, but we will live with it for now
1818
const webId = sym(`${pod}${DEFAULT_PROFILE_PATH}`)
1919
try {
20-
console.log('-----Trying to load prefixed pod profile', webId)
2120
await fetcher.load(webId)
2221
return webId
2322
} catch (err) {
@@ -31,7 +30,6 @@ export async function loadProfileFromURI (
3130
if (pathSegments.length > 0) {
3231
const derivedPod = `${uriUrl.origin}/${pathSegments[0]}/`
3332
const derivedWebId = sym(`${derivedPod}${DEFAULT_PROFILE_PATH}`)
34-
console.log('-----Trying to load suffixed pod profile', derivedWebId)
3533
await fetcher.load(derivedWebId)
3634
return derivedWebId
3735
}

src/registerPanes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export function registerPanes (register) {
5656
}
5757

5858
register(trustedApplications) // must be registered before basicPreferences
59-
register(dashboardPane)
59+
// register(dashboardPane)
6060
register(basicPreferences)
6161
register(issuePane)
6262
register(contactsPane)

src/socialPane.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,18 @@ export const socialPane = {
1818

1919
name: 'social',
2020

21-
label: () => { return 'Friends' }, // we do not care if it is a webID or not
21+
label: function (subject, context) {
22+
const kb = context.session.store
23+
const types = kb.findTypeURIs(subject)
24+
if (
25+
types[UI.ns.foaf('Person').uri] ||
26+
types[UI.ns.vcard('Individual').uri]
27+
) {
28+
return 'Friends'
29+
}
30+
return null
31+
},
32+
global: true, // doe snot add it to the nav tray in OutlineView
2233

2334
render: function (s, context) {
2435
const dom = context.dom

0 commit comments

Comments
 (0)