From 5380eb871d147b9a288f877329bc312e00be1c9d Mon Sep 17 00:00:00 2001 From: Erik Pearson Date: Mon, 8 Feb 2021 15:57:37 -0800 Subject: [PATCH 1/6] search by owner not creator --- src/client/utils/searchNarratives.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/utils/searchNarratives.ts b/src/client/utils/searchNarratives.ts index 6c40256..4df853d 100644 --- a/src/client/utils/searchNarratives.ts +++ b/src/client/utils/searchNarratives.ts @@ -161,13 +161,13 @@ export default async function searchNarratives( switch (category) { case 'own': params.filters.fields.push({ - field: 'creator', + field: 'owner', term: username, }); break; case 'shared': params.filters.fields.push({ - field: 'creator', + field: 'owner', not_term: username, }); params.filters.fields.push({ From 5b088c920431cc995d07fdb6fe7ee05f432fae41 Mon Sep 17 00:00:00 2001 From: Erik Pearson Date: Mon, 8 Feb 2021 15:58:53 -0800 Subject: [PATCH 2/6] Show owner rather than author --- .../dashboard/NarrativeList/NarrativeDetails.tsx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/client/components/dashboard/NarrativeList/NarrativeDetails.tsx b/src/client/components/dashboard/NarrativeList/NarrativeDetails.tsx index 53fa053..1a7d8a7 100644 --- a/src/client/components/dashboard/NarrativeList/NarrativeDetails.tsx +++ b/src/client/components/dashboard/NarrativeList/NarrativeDetails.tsx @@ -139,7 +139,7 @@ const detailsHeader = async (data: Doc, cache: KBaseCache) => { const cellTypeCounts = countCellTypes(data.cells); const [gold, silver, bronze] = countDataTypes(data); if (!('profiles' in cache)) cache.profiles = {}; - const authorProfile = await fetchProfile(data.creator, cache.profiles); + const authorProfile = await fetchProfile(data.owner, cache.profiles); const sharedWithProfiles = await fetchProfiles(sharedWith, cache.profiles); const authorName = authorProfile.user.realname; const sharedWithLinks = detailsSharedWith(sharedWith, sharedWithProfiles); @@ -147,7 +147,7 @@ const detailsHeader = async (data: Doc, cache: KBaseCache) => { <>
- {detailsHeaderItem('Author', [profileLink(data.creator, authorName)])} + {detailsHeaderItem('Author', [profileLink(data.owner, authorName)])} {detailsHeaderItem('Created on', readableDate(data.creation_date))} {detailsHeaderItem('Last saved', readableDate(data.timestamp))} {detailsHeaderItem( @@ -175,8 +175,8 @@ const detailsHeader = async (data: Doc, cache: KBaseCache) => { {data.is_public || !sharedWith.length ? ( <> ) : ( - detailsHeaderItem('Shared with', sharedWithLinks) - )} + detailsHeaderItem('Shared with', sharedWithLinks) + )}
); @@ -234,9 +234,8 @@ export class NarrativeDetails extends React.Component { return
; } const wsid = activeItem.access_group; - const narrativeHref = `${ - Runtime.getConfig().view_routes.narrative - }/${wsid}`; + const narrativeHref = `${Runtime.getConfig().view_routes.narrative + }/${wsid}`; let content: JSX.Element | string = ''; // Choose which content to show based on selected tab switch (view) { From b678a971bcb3268c0edb515e1de00b6a9db036dd Mon Sep 17 00:00:00 2001 From: Erik Pearson Date: Mon, 8 Feb 2021 17:00:30 -0800 Subject: [PATCH 3/6] revert change from author -> owner, back to "Author" with "creator" populating the value. --- .../components/dashboard/NarrativeList/NarrativeDetails.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/components/dashboard/NarrativeList/NarrativeDetails.tsx b/src/client/components/dashboard/NarrativeList/NarrativeDetails.tsx index 1a7d8a7..391e09b 100644 --- a/src/client/components/dashboard/NarrativeList/NarrativeDetails.tsx +++ b/src/client/components/dashboard/NarrativeList/NarrativeDetails.tsx @@ -139,7 +139,7 @@ const detailsHeader = async (data: Doc, cache: KBaseCache) => { const cellTypeCounts = countCellTypes(data.cells); const [gold, silver, bronze] = countDataTypes(data); if (!('profiles' in cache)) cache.profiles = {}; - const authorProfile = await fetchProfile(data.owner, cache.profiles); + const authorProfile = await fetchProfile(data.creator, cache.profiles); const sharedWithProfiles = await fetchProfiles(sharedWith, cache.profiles); const authorName = authorProfile.user.realname; const sharedWithLinks = detailsSharedWith(sharedWith, sharedWithProfiles); @@ -147,7 +147,7 @@ const detailsHeader = async (data: Doc, cache: KBaseCache) => { <>
- {detailsHeaderItem('Author', [profileLink(data.owner, authorName)])} + {detailsHeaderItem('Author', [profileLink(data.creator, authorName)])} {detailsHeaderItem('Created on', readableDate(data.creation_date))} {detailsHeaderItem('Last saved', readableDate(data.timestamp))} {detailsHeaderItem( From 4b28cccdc7583f8c22b749bc05aded1c86691644 Mon Sep 17 00:00:00 2001 From: Erik Pearson Date: Mon, 8 Feb 2021 17:04:00 -0800 Subject: [PATCH 4/6] revert the minor formatting spam --- .../dashboard/NarrativeList/NarrativeDetails.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/client/components/dashboard/NarrativeList/NarrativeDetails.tsx b/src/client/components/dashboard/NarrativeList/NarrativeDetails.tsx index 391e09b..f6d8fa3 100644 --- a/src/client/components/dashboard/NarrativeList/NarrativeDetails.tsx +++ b/src/client/components/dashboard/NarrativeList/NarrativeDetails.tsx @@ -175,8 +175,8 @@ const detailsHeader = async (data: Doc, cache: KBaseCache) => { {data.is_public || !sharedWith.length ? ( <> ) : ( - detailsHeaderItem('Shared with', sharedWithLinks) - )} + detailsHeaderItem('Shared with', sharedWithLinks) + )}
); @@ -234,8 +234,9 @@ export class NarrativeDetails extends React.Component { return
; } const wsid = activeItem.access_group; - const narrativeHref = `${Runtime.getConfig().view_routes.narrative - }/${wsid}`; + const narrativeHref = `${ + Runtime.getConfig().view_routes.narrative + }/${wsid}`; let content: JSX.Element | string = ''; // Choose which content to show based on selected tab switch (view) { @@ -300,4 +301,4 @@ export class NarrativeDetails extends React.Component {
); } -} +} \ No newline at end of file From 1e31817541dc2ccfc8b768ef4fc6d930a8e9b10d Mon Sep 17 00:00:00 2001 From: Erik Pearson Date: Mon, 8 Feb 2021 17:05:06 -0800 Subject: [PATCH 5/6] add newline to end of file --- .../dashboard/NarrativeList/NarrativeDetails.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/client/components/dashboard/NarrativeList/NarrativeDetails.tsx b/src/client/components/dashboard/NarrativeList/NarrativeDetails.tsx index f6d8fa3..391e09b 100644 --- a/src/client/components/dashboard/NarrativeList/NarrativeDetails.tsx +++ b/src/client/components/dashboard/NarrativeList/NarrativeDetails.tsx @@ -175,8 +175,8 @@ const detailsHeader = async (data: Doc, cache: KBaseCache) => { {data.is_public || !sharedWith.length ? ( <> ) : ( - detailsHeaderItem('Shared with', sharedWithLinks) - )} + detailsHeaderItem('Shared with', sharedWithLinks) + )}
); @@ -234,9 +234,8 @@ export class NarrativeDetails extends React.Component { return
; } const wsid = activeItem.access_group; - const narrativeHref = `${ - Runtime.getConfig().view_routes.narrative - }/${wsid}`; + const narrativeHref = `${Runtime.getConfig().view_routes.narrative + }/${wsid}`; let content: JSX.Element | string = ''; // Choose which content to show based on selected tab switch (view) { @@ -301,4 +300,4 @@ export class NarrativeDetails extends React.Component { ); } -} \ No newline at end of file +} From 3eba662cf93d572be40188041fa89bcabab1f5c5 Mon Sep 17 00:00:00 2001 From: Erik Pearson Date: Mon, 8 Feb 2021 17:05:55 -0800 Subject: [PATCH 6/6] omg, save w/o formatting again. --- .../dashboard/NarrativeList/NarrativeDetails.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/client/components/dashboard/NarrativeList/NarrativeDetails.tsx b/src/client/components/dashboard/NarrativeList/NarrativeDetails.tsx index 391e09b..53fa053 100644 --- a/src/client/components/dashboard/NarrativeList/NarrativeDetails.tsx +++ b/src/client/components/dashboard/NarrativeList/NarrativeDetails.tsx @@ -175,8 +175,8 @@ const detailsHeader = async (data: Doc, cache: KBaseCache) => { {data.is_public || !sharedWith.length ? ( <> ) : ( - detailsHeaderItem('Shared with', sharedWithLinks) - )} + detailsHeaderItem('Shared with', sharedWithLinks) + )} ); @@ -234,8 +234,9 @@ export class NarrativeDetails extends React.Component { return
; } const wsid = activeItem.access_group; - const narrativeHref = `${Runtime.getConfig().view_routes.narrative - }/${wsid}`; + const narrativeHref = `${ + Runtime.getConfig().view_routes.narrative + }/${wsid}`; let content: JSX.Element | string = ''; // Choose which content to show based on selected tab switch (view) {