UNPKG

@mikezimm/fps-library-v2

Version:

Library of reusable typescript/javascript functions, interfaces and constants

89 lines 6.32 kB
import * as React from 'react'; // import { escape } from '@microsoft/sp-lodash-subset'; import { PivotItem, } from '@fluentui/react/lib/Pivot'; import { FindInternalNameHelpLink, OdataOperatorsHelpLink } from '../../../../components/atoms/Links/LinksDevDocs'; export function getHelpListPerformance() { //headerText={ 'Performance' } const WebPartHelpElement = React.createElement(PivotItem, { itemIcon: 'SpeedHigh' }, React.createElement("div", { className: 'fps-pph-content' }, React.createElement("div", { className: 'fps-pph-topic' }, `Performance settings`, " on this page require advanced Javascript knowledge"), React.createElement("div", null, `Please contact your SharePoint team for assistance :)`), React.createElement("div", { className: 'fps-pph-topic' }, "Property/Rest filter for ", React.createElement("b", null, "HasUniqueRoleAssignments")), React.createElement("div", null, "Including '", React.createElement("b", null, "HasUniqueRoleAssignments"), "' in a rest call (either via filter or select) can have a significant performance impact. As an example, while testing a 500 item list, the wait time increased fetch time from ~ 0.5 sec to over 2 sec."), React.createElement("div", { className: 'fps-pph-topic' }, "Rest filter for LARGE LISTS gt 5,000 items"), React.createElement("div", null, "You MUST Index any column you want to filter on first."), React.createElement("div", null, "It seems like you can ONLY filter on a single INDEXED column in large lists at a time."), React.createElement("div", null, "To filter on an Indexed User column like 'Author', use AuthorId eq ", `'{Me}'`), React.createElement("div", null, "In the above example, ", `'{Me}'`, " will search for the current logged in user."), React.createElement("div", { className: 'fps-pph-topic' }, "Rest filter to load only specific items"), React.createElement("div", null, "Rest filters are applied when the web part fetches the information."), React.createElement("div", null, "Pre-filtering the data with a rest filter will improve loading times and reduce data on mobile."), React.createElement("div", null, "In rest filters, ", React.createElement("b", null, `everything is case sensitive`), " and requires using ", FindInternalNameHelpLink), React.createElement("ul", null, React.createElement("li", null, `Status eq '4. Completed' --- Only retrieve items where Status column equals '4. Completed'`), React.createElement("li", null, React.createElement("b", null, "Approver eq ", `{Me}`), " --- Only retrieve items where Approver column equals currently logged in user"), React.createElement("li", null, React.createElement("b", null, "Modified ", OdataOperatorsHelpLink, " [Today - 100]"), " --- Only retrieve items where Modified Date is Greater Than or Equal to Today - 100 days"), React.createElement("li", null, "Date syntax for specific dates: ", React.createElement("b", null, "MeetingDate ", OdataOperatorsHelpLink, " datetime'2023-09-17T01:11:01.366Z'")), React.createElement("li", null, "You can combine filters but there are limitations."), React.createElement("ul", null, React.createElement("li", null, "You CAN NOT filter on more than one User or Lookup column at a time"), React.createElement("li", null, "You CAN filter on a User column AND other column types"))), React.createElement("div", { className: 'fps-pph-topic' }, "Javascript eval"), React.createElement("div", null, "Javascript filters are applied after the data is fetched."), React.createElement("div", null, "If the result of this eval === true, then the item is shown."), React.createElement("div", null, "Only fetched columns can be used in Javascript eval."), React.createElement("div", null, `You may need to toggle the 'Get all item props' if a column is not a refiner or on a view.`), React.createElement("div", null, "Having both rest and javascript eval filters allow you to limit what items and refiners you see."), React.createElement("div", null, "In Javascript eval filters, ", React.createElement("b", null, `everything is case sensitive`), " and requires using ", FindInternalNameHelpLink), React.createElement("ul", null, React.createElement("li", null, "item.Author", React.createElement("b", null, "Id"), " === sourceUserInfo.Id || item.Editor", React.createElement("b", null, "Id"), " === sourceUserInfo.Id"), React.createElement("li", null, "The previous example filters items where CreatedBy OR ModifiedBy is the currently logged in user"), React.createElement("div", null, React.createElement("mark", null, React.createElement("b", null, "NOT seeing any items with example?:")), " Be sure to add Id after the ", React.createElement("b", null, "Internal Column names"), "."), React.createElement("li", null, `The javascript syntax for an item's User columns is InternalColumName followed by either Id or Title - with no space or .dot.`)))); return WebPartHelpElement; } //# sourceMappingURL=ListPerformance.js.map