@mikezimm/fps-core-v7
Version:
Library of reusable core interfaces, types and constants migrated from fps-library-v2
46 lines • 2.43 kB
JavaScript
/**
* 2024-09-06: Migrated from same folder fps-library-v2\src\pnpjs\SourceItems
*
* Local imports
import { getExpandColumns, ISourceProps, makeid } from '../../fpsReferences';
import { createSeriesSort } from '@mikezimm/fps-core-v7/lib/components/molecules/source-props/createOrderBy';
import { CurrentTenant } from '@mikezimm/fps-core-v7/lib/components/molecules/source-props/WindowLocationConstants';
import { GroupSelectsFull } from '@mikezimm/fps-core-v7/lib/restAPIs/sites/groups/GroupSelects';
*/
import { createSeriesSort } from '../../createOrderBy';
import { makeid } from '../../../../../logic/Strings/guids';
import { GroupSelectsFull } from '../../../../../restAPIs/sites/groups/GroupSelects';
import { getExpandColumns } from '../../Lists/getVX/getExpandV2';
import { getSiteCollectionUrlFromLink } from '../../../../../logic/Strings/getSiteCollectionUrlFromLink';
import { CurrentTenant } from '../../WindowLocationConstants';
export function createGroupsSource(webUrl, fpsSpService) {
let Source = DefaultGroupsSource;
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;
// Opted against this option since it may cause other issues... just adding to FPSFetchStatus
// Source.webRelativeLink = webRelativeLink.indexOf('/') === 0 ? webRelativeLink : `/${webRelativeLink}`;
return Source;
}
export const DefaultGroupsSource = {
refreshId: makeid(5),
key: 'groups',
defType: 'Groups',
fpsContentType: ['group'],
tenant: CurrentTenant,
webUrl: ``,
webRelativeLink: '',
viewItemLink: ``,
columns: GroupSelectsFull,
searchProps: GroupSelectsFull,
selectThese: GroupSelectsFull,
expandThese: getExpandColumns(GroupSelectsFull),
defSearchButtons: [],
orderBy: createSeriesSort('Title'),
performanceSettings: { label: 'Group', updateMiliseconds: true, includeMsStr: true, op: 'fetch' },
};
//# sourceMappingURL=createGroupsSource.js.map