UNPKG

@mikezimm/fps-core-v7

Version:

Library of reusable core interfaces, types and constants migrated from fps-library-v2

41 lines 1.85 kB
import { getSiteCollectionUrlFromLink } from "../../../../../logic/Strings/getSiteCollectionUrlFromLink"; import { makeid } from "../../../../../logic/Strings/guids"; import { UserSelectsAll } from "../../../../../restAPIs/sites/users/UserSelects"; import { createSeriesSort } from "../../createOrderBy"; import { getExpandColumns } from "../../Lists/getVX/getExpandV2"; import { CurrentTenant } from "../../WindowLocationConstants"; /** * import { createGroupsSource } from '@mikezimm/fps-core-v7/lib/components/molecules/source-props/Users/createGroupSource'; * @param webUrl * @param fpsSpService * @returns */ export function createUsersSource(webUrl, fpsSpService) { let Source = DefaultUsersSource; Source.webUrl = webUrl; Source.absoluteWebUrl = getSiteCollectionUrlFromLink(webUrl); // Opted against this option since it may cause other issues... just adding to FPSFetchStatus // Source.webRelativeLink = webRelativeLink.indexOf('/') === 0 ? webRelativeLink : `/${webRelativeLink}`; // https://github.com/fps-solutions/Item-Ninja/issues/51 - need to add fpsSpService after parsing Source = JSON.parse(JSON.stringify(Source)); Source.fpsSpService = fpsSpService; return Source; } export const DefaultUsersSource = { refreshId: makeid(5), key: 'users', defType: 'Users', fpsContentType: ['user'], tenant: CurrentTenant, webUrl: ``, webRelativeLink: '', viewItemLink: ``, columns: UserSelectsAll, searchProps: UserSelectsAll, selectThese: UserSelectsAll, expandThese: getExpandColumns(UserSelectsAll), defSearchButtons: [], orderBy: createSeriesSort('Title'), performanceSettings: { label: 'Users', updateMiliseconds: true, includeMsStr: true, op: 'fetch' }, }; //# sourceMappingURL=createUsersSource.js.map