@mikezimm/fps-library-v2
Version:
Library of reusable typescript/javascript functions, interfaces and constants
59 lines (58 loc) • 2.42 kB
JavaScript
/**
* CodeAnalizerComment: Updated 3 imports on 2024-09-22 14:49:52
* Update:: import { IStateSource } to '@mikezimm/fps-core-v7/lib/components/molecules/state-source/IStateSource;'
* Update:: import { IAnySourceItem } to '@mikezimm/fps-core-v7/lib/components/molecules/AnyContent/IAnyContent;'
* Update:: import { IFPSItem } to '@mikezimm/fps-core-v7/lib/components/molecules/AnyContent/IAnyContent;'
*/
import { EmptyFPSItemSearch } from '@mikezimm/fps-core-v7/lib/components/molecules/AnyContent/IFPSItemSearch';
/**
* createErrorFPSTileItem will build an item: IAnySourceItem with the correct FPSItem object which can be used in FPSTileComponent and FPSTileElement
*
* @param results
* @param webPartFPSItem
* @param newTitle
* @param background
// * @param hUnit These should be set right in FPSTileElement and not needed here.
// * @param wUnit These should be set right in FPSTileElement and not needed here.
* @returns
*/
export function createErrorFPSTileItem(results, webPartFPSItem, newTitle = ``, background = ``) {
var _a;
const Title = `${newTitle ? newTitle : results.status}`;
const Description = `${(_a = results.errorInfo) === null || _a === void 0 ? void 0 : _a.friendly}`;
const FPSItem = {
Search: JSON.parse(JSON.stringify(EmptyFPSItemSearch)),
Image: {
src: '',
css: {
height: !webPartFPSItem ? '18px' : webPartFPSItem.Image.css.height,
width: !webPartFPSItem ? '18px' : webPartFPSItem.Image.css.width,
background: background ? background : `yellow`,
}
},
Icon: {
name: 'StatusErrorFull',
css: {
// size: `${tileHeight * .8 }${hUnit}`,
color: `red`,
},
// react: { paddingTop: `${ ( tileHeight * .2 ) /2 }${hUnit}` }
},
// 2024-09-08: Added File: undefined as any, to pass updated IFPSItem
File: undefined,
Link: {
href: ``,
title: Title,
description: Description,
},
IsA: { allIsAKeys: [], allIsAKeysStr: '' },
Elements: {},
};
const item = {
Title: Title,
Description: Description,
FPSItem: FPSItem,
};
return item;
}
//# sourceMappingURL=createErrorFPSTileItem.js.map