diff --git a/CHANGELOG.md b/CHANGELOG.md index 21b163903..0d4b2f77b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ NB: Som en del av denne releasen må det godkjennes en ny app ved installasjon e - Rettet et problem hvor tillatelseskonfigurasjon feilet dersom man ikke er eier på hub [#1549](https://github.com/Puzzlepart/prosjektportalen365/issues/1549) - Rettet et problem hvor provisjonering av dokumentbibliotek bare hentet 100 elementer [#1547](https://github.com/Puzzlepart/prosjektportalen365/issues/1547) - Rettet et problem hvor opprettelse av statusrapporter feilet dersom URL-felt var i bruk [#1546](https://github.com/Puzzlepart/prosjektportalen365/issues/1546) +- Rettet et problem hvor eiere av personlige visninger ikke kunne redigere kolonner [#1553](https://github.com/Puzzlepart/prosjektportalen365/issues/1553) --- diff --git a/SharePointFramework/PortfolioWebParts/src/components/List/useAddColumn.ts b/SharePointFramework/PortfolioWebParts/src/components/List/useAddColumn.ts index 24a20f1c3..6d8dbdd17 100644 --- a/SharePointFramework/PortfolioWebParts/src/components/List/useAddColumn.ts +++ b/SharePointFramework/PortfolioWebParts/src/components/List/useAddColumn.ts @@ -52,8 +52,8 @@ export function useAddColumn( disabled: true }, { - key: 'TOGGLE_EDIT_VIEW_COLUMNS_PANEL', - text: strings.ToggleEditViewColumnsLabel, + key: 'SHOW_HIDE_COLUMNS', + text: strings.ShowHideColumnsLabel, iconProps: { iconName: 'Eye' }, onClick: onToggleEditViewColumnsPanel, disabled: isToggleEditViewColumnsPanelDisabled || !permissionCheck diff --git a/SharePointFramework/PortfolioWebParts/src/components/PortfolioOverview/ColumnContextMenu/useColumnContextMenu.ts b/SharePointFramework/PortfolioWebParts/src/components/PortfolioOverview/ColumnContextMenu/useColumnContextMenu.ts index bde1291c1..b17900083 100644 --- a/SharePointFramework/PortfolioWebParts/src/components/PortfolioOverview/ColumnContextMenu/useColumnContextMenu.ts +++ b/SharePointFramework/PortfolioWebParts/src/components/PortfolioOverview/ColumnContextMenu/useColumnContextMenu.ts @@ -20,9 +20,11 @@ import { MenuProps, useId } from '@fluentui/react-components' export function useColumnContextMenu() { const context = useContext(PortfolioOverviewContext) const [open, setOpen] = useState(false) + const isViewAuthor = context.state.currentView?.author === context.props.pageContext.user.email + const { isAddColumn, createContextualMenuItems } = useAddColumn( true, - context.props.pageContext.legacyPageContext.isSiteAdmin + context.props.pageContext.legacyPageContext.isSiteAdmin || isViewAuthor ) const onOpenChange: MenuProps['onOpenChange'] = (_, data) => setOpen(data.open) const [checkedValues, setCheckedValues] = useState({}) @@ -141,12 +143,6 @@ export function useColumnContextMenu() { key: 'DIVIDER_03', itemType: ContextualMenuItemType.Divider }, - { - key: 'SHOW_HIDE_COLUMNS', - text: strings.ShowHideColumnsLabel, - onClick: () => context.dispatch(TOGGLE_EDIT_VIEW_COLUMNS_PANEL({ isOpen: true })), - iconProps: { iconName: 'Eye' } - }, { key: 'ADD_COLUMN', text: strings.AddColumnLabel, diff --git a/SharePointFramework/PortfolioWebParts/src/loc/_/en-us.js b/SharePointFramework/PortfolioWebParts/src/loc/_/en-us.js index 8ab2e45c4..15ed66c7f 100644 --- a/SharePointFramework/PortfolioWebParts/src/loc/_/en-us.js +++ b/SharePointFramework/PortfolioWebParts/src/loc/_/en-us.js @@ -223,7 +223,6 @@ define([], function () { TimelineContentListName: 'Tidslinjeinnhold', TitleLabel: 'Title', ToggleColumnFormPanelLabel: 'Add column', - ToggleEditViewColumnsLabel: 'Show or hide columns', UseChangesButtonText: 'Use', ViewNotFoundMessage: 'Cannot find the specified view.', ViewsListNameLabel: 'Views' diff --git a/SharePointFramework/PortfolioWebParts/src/loc/mystrings.d.ts b/SharePointFramework/PortfolioWebParts/src/loc/mystrings.d.ts index f1a01d4a6..6b8ed8a1b 100644 --- a/SharePointFramework/PortfolioWebParts/src/loc/mystrings.d.ts +++ b/SharePointFramework/PortfolioWebParts/src/loc/mystrings.d.ts @@ -360,7 +360,6 @@ declare interface IPortfolioWebPartsStrings { TitleLabel: string TitleDescription: string ToggleColumnFormPanelLabel: string - ToggleEditViewColumnsLabel: string UseChangesButtonText: string UseDynamicColorsDescription: string UseDynamicColorsLabel: string diff --git a/SharePointFramework/PortfolioWebParts/src/loc/nb-no.js b/SharePointFramework/PortfolioWebParts/src/loc/nb-no.js index 53aeb810a..98626fdd1 100644 --- a/SharePointFramework/PortfolioWebParts/src/loc/nb-no.js +++ b/SharePointFramework/PortfolioWebParts/src/loc/nb-no.js @@ -362,7 +362,6 @@ define([], function () { TitleLabel: 'Tittel', TitleDescription: 'Tittel for visningen.', ToggleColumnFormPanelLabel: 'Legg til kolonne', - ToggleEditViewColumnsLabel: 'Vis eller skjul kolonner', UseChangesButtonText: 'Bruk', UseDynamicColorsDescription: 'Her kan du velge om kortvisningen skal ta i bruk dynamiske farger for logodelen, dette kan medføre lengre innlastningstid og anbefales for mindre porteføljer (krever at "Vis logo" er på).', UseDynamicColorsLabel: 'Bruk dynamiske farger', diff --git a/SharePointFramework/ProgramWebParts/src/loc/mystrings.d.ts b/SharePointFramework/ProgramWebParts/src/loc/mystrings.d.ts index f9442b085..35701d4c0 100644 --- a/SharePointFramework/ProgramWebParts/src/loc/mystrings.d.ts +++ b/SharePointFramework/ProgramWebParts/src/loc/mystrings.d.ts @@ -185,7 +185,6 @@ declare interface IProgramWebPartsStrings { TimelineContentListName: string TitleLabel: string ToggleColumnFormPanelLabel: string - ToggleEditViewColumnsLabel: string UseChangesButtonText: string ViewNotFoundMessage: string DataSourceItemNotFound: string diff --git a/SharePointFramework/ProgramWebParts/src/loc/nb-no.js b/SharePointFramework/ProgramWebParts/src/loc/nb-no.js index 458214bec..9591d98ce 100644 --- a/SharePointFramework/ProgramWebParts/src/loc/nb-no.js +++ b/SharePointFramework/ProgramWebParts/src/loc/nb-no.js @@ -187,7 +187,6 @@ define([], function () { TitleDescription: 'Tittel for visningen.', TitleLabel: 'Tittel', ToggleColumnFormPanelLabel: 'Legg til kolonne', - ToggleEditViewColumnsLabel: 'Vis eller skjul kolonner', UseChangesButtonText: 'Bruk', ViewNotFoundMessage: 'Finner ikke angitt visning.', DataSourceItemNotFound: 'Datakilde ble ikke funnet', diff --git a/SharePointFramework/shared-library/src/models/PortfolioOverviewView.ts b/SharePointFramework/shared-library/src/models/PortfolioOverviewView.ts index d47062c18..f8e40844a 100644 --- a/SharePointFramework/shared-library/src/models/PortfolioOverviewView.ts +++ b/SharePointFramework/shared-library/src/models/PortfolioOverviewView.ts @@ -20,6 +20,7 @@ export class SPPortfolioOverviewViewItem { public GtPortfolioRefinersId?: number[] | { results: number[] } = [] public GtPortfolioGroupById?: number = 0 public GtPortfolioColumnOrder?: string = '' + public Author?: { EMail: string } } /** @@ -111,6 +112,11 @@ export class PortfolioOverviewView { */ public groupById: number + /** + * Author of the view. + */ + public author: string + /** * The view properties as a map. Used in the `PortfolioOverview` * component to edit and create views. @@ -134,6 +140,7 @@ export class PortfolioOverviewView { this.columnIds = (item?.GtPortfolioColumnsId as number[]) ?? [] this.refinerIds = (item?.GtPortfolioRefinersId as number[]) ?? [] this.groupById = item?.GtPortfolioGroupById + this.author = item?.Author?.EMail this.$map = this._toMap() } diff --git a/SharePointFramework/shared-library/src/services/PortalDataService/PortalDataService.ts b/SharePointFramework/shared-library/src/services/PortalDataService/PortalDataService.ts index 9a87d9a20..3c0003a55 100644 --- a/SharePointFramework/shared-library/src/services/PortalDataService/PortalDataService.ts +++ b/SharePointFramework/shared-library/src/services/PortalDataService/PortalDataService.ts @@ -347,7 +347,8 @@ export class PortalDataService extends DataService() return spItems.map((item) => new PortfolioOverviewView(item))