type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
FunctionDeclaration | /**
* Provides all nessesary aria-* attributes to create valid disabled state for interactive components.
*/
export function ariaDisabled<T extends AriaDisabled>(): ClassDecorator {
return (target: any) => target.addInitializer((instance: T) => new AriaDisabledController(instance));
} | ashleyryan/core | projects/core/src/internal/controllers/aria-disabled.controller.ts | TypeScript |
ArrowFunction |
(target: any) => target.addInitializer((instance: T) => new AriaDisabledController(instance)) | ashleyryan/core | projects/core/src/internal/controllers/aria-disabled.controller.ts | TypeScript |
ArrowFunction |
(instance: T) => new AriaDisabledController(instance) | ashleyryan/core | projects/core/src/internal/controllers/aria-disabled.controller.ts | TypeScript |
ClassDeclaration |
export class AriaDisabledController<T extends AriaDisabled> implements ReactiveController {
constructor(private host: T) {
this.host.addController(this);
}
hostUpdated() {
if (this.host.disabled !== null) {
this.host.ariaDisabled = this.host.disabled;
}
if (this.host.readonly) {
thi... | ashleyryan/core | projects/core/src/internal/controllers/aria-disabled.controller.ts | TypeScript |
TypeAliasDeclaration |
export type AriaDisabled = ReactiveElement & { disabled: boolean; readonly?: boolean }; | ashleyryan/core | projects/core/src/internal/controllers/aria-disabled.controller.ts | TypeScript |
MethodDeclaration |
hostUpdated() {
if (this.host.disabled !== null) {
this.host.ariaDisabled = this.host.disabled;
}
if (this.host.readonly) {
this.host.ariaDisabled = null;
}
} | ashleyryan/core | projects/core/src/internal/controllers/aria-disabled.controller.ts | TypeScript |
FunctionDeclaration |
async function initPluginWithHandlers(handlers: Array<EmailEventHandler<string, any>>, options?: Partial<EmailPluginOptions>) {
eventBus = new EventBus();
onSend = jest.fn();
plugin = new EmailPlugin({
templatePath: path.join(__dirname, '../test-templates'),
transport: {... | byjose007/vendure | packages/email-plugin/src/plugin.spec.ts | TypeScript |
ArrowFunction |
(token: any): any => {
if (token === EventBus) {
return eventBus;
} else {
throw new Error(`Was not expecting to inject the token ${token}`);
}
} | byjose007/vendure | packages/email-plugin/src/plugin.spec.ts | TypeScript |
ArrowFunction |
() => {
const ctx = {
channel: { code: DEFAULT_CHANNEL_CODE },
languageCode: LanguageCode.en,
} as any;
it('single filter', async () => {
const handler = new EmailEventListener('test')
.on(MockEvent)
.filter(event => event.sh... | byjose007/vendure | packages/email-plugin/src/plugin.spec.ts | TypeScript |
ArrowFunction |
async () => {
const handler = new EmailEventListener('test')
.on(MockEvent)
.filter(event => event.shouldSend === true)
.setRecipient(() => 'test@test.com')
.setSubject('test subject');
await initPluginWithHandlers([handler]);
... | byjose007/vendure | packages/email-plugin/src/plugin.spec.ts | TypeScript |
ArrowFunction |
event => event.shouldSend === true | byjose007/vendure | packages/email-plugin/src/plugin.spec.ts | TypeScript |
ArrowFunction |
() => 'test@test.com' | byjose007/vendure | packages/email-plugin/src/plugin.spec.ts | TypeScript |
ArrowFunction |
async () => {
const handler = new EmailEventListener('test')
.on(MockEvent)
.filter(event => event.shouldSend === true)
.filter(event => !!event.ctx.user)
.setRecipient(() => 'test@test.com')
.setSubject('test subject');
... | byjose007/vendure | packages/email-plugin/src/plugin.spec.ts | TypeScript |
ArrowFunction |
event => !!event.ctx.user | byjose007/vendure | packages/email-plugin/src/plugin.spec.ts | TypeScript |
ArrowFunction |
() => {
const ctx = {
channel: { code: DEFAULT_CHANNEL_CODE },
languageCode: LanguageCode.en,
} as any;
it('interpolates subject', async () => {
const handler = new EmailEventListener('test')
.on(MockEvent)
.setRecipient(() =>... | byjose007/vendure | packages/email-plugin/src/plugin.spec.ts | TypeScript |
ArrowFunction |
async () => {
const handler = new EmailEventListener('test')
.on(MockEvent)
.setRecipient(() => 'test@test.com')
.setSubject('Hello {{ subjectVar }}')
.setTemplateVars(event => ({ subjectVar: 'foo' }));
await initPluginWithHandler... | byjose007/vendure | packages/email-plugin/src/plugin.spec.ts | TypeScript |
ArrowFunction |
event => ({ subjectVar: 'foo' }) | byjose007/vendure | packages/email-plugin/src/plugin.spec.ts | TypeScript |
ArrowFunction |
async () => {
const handler = new EmailEventListener('test')
.on(MockEvent)
.setRecipient(() => 'test@test.com')
.setSubject('Hello')
.setTemplateVars(event => ({ testVar: 'this is the test var' }));
await initPluginWithHandlers([... | byjose007/vendure | packages/email-plugin/src/plugin.spec.ts | TypeScript |
ArrowFunction |
event => ({ testVar: 'this is the test var' }) | byjose007/vendure | packages/email-plugin/src/plugin.spec.ts | TypeScript |
ArrowFunction |
async () => {
const handler = new EmailEventListener('test')
.on(MockEvent)
.setRecipient(() => 'test@test.com')
.setSubject('Hello {{ globalVar }}');
await initPluginWithHandlers([handler], { globalTemplateVars: { globalVar: 'baz' } });
... | byjose007/vendure | packages/email-plugin/src/plugin.spec.ts | TypeScript |
ArrowFunction |
async () => {
const handler = new EmailEventListener('test')
.on(MockEvent)
.setRecipient(() => 'test@test.com')
.setSubject('Hello {{ testVar }}')
.setTemplateVars((event, globals) => ({ testVar: globals.globalVar + ' quux' }));
... | byjose007/vendure | packages/email-plugin/src/plugin.spec.ts | TypeScript |
ArrowFunction |
(event, globals) => ({ testVar: globals.globalVar + ' quux' }) | byjose007/vendure | packages/email-plugin/src/plugin.spec.ts | TypeScript |
ArrowFunction |
async () => {
const handler = new EmailEventListener('test')
.on(MockEvent)
.setRecipient(() => 'test@test.com')
.setSubject('Hello {{ name }}')
.setTemplateVars((event, globals) => ({ name: 'quux' }));
await initPluginWithHandler... | byjose007/vendure | packages/email-plugin/src/plugin.spec.ts | TypeScript |
ArrowFunction |
(event, globals) => ({ name: 'quux' }) | byjose007/vendure | packages/email-plugin/src/plugin.spec.ts | TypeScript |
ArrowFunction |
() => {
const ctx = {
channel: { code: DEFAULT_CHANNEL_CODE },
languageCode: LanguageCode.en,
} as any;
it('additional LanguageCode', async () => {
const handler = new EmailEventListener('test')
.on(MockEvent)
.setSubject('Hel... | byjose007/vendure | packages/email-plugin/src/plugin.spec.ts | TypeScript |
ArrowFunction |
async () => {
const handler = new EmailEventListener('test')
.on(MockEvent)
.setSubject('Hello, {{ name }}!')
.setRecipient(() => 'test@test.com')
.setTemplateVars(() => ({ name: 'Test' }))
.addTemplate({
ch... | byjose007/vendure | packages/email-plugin/src/plugin.spec.ts | TypeScript |
ArrowFunction |
() => ({ name: 'Test' }) | byjose007/vendure | packages/email-plugin/src/plugin.spec.ts | TypeScript |
ArrowFunction |
() => {
beforeEach(async () => {
await initPluginWithHandlers([orderConfirmationHandler], { templatePath: path.join(__dirname, '../templates') });
});
const ctx = {
channel: { code: DEFAULT_CHANNEL_CODE },
languageCode: LanguageCode.en,
} as any;
... | byjose007/vendure | packages/email-plugin/src/plugin.spec.ts | TypeScript |
ArrowFunction |
async () => {
await initPluginWithHandlers([orderConfirmationHandler], { templatePath: path.join(__dirname, '../templates') });
} | byjose007/vendure | packages/email-plugin/src/plugin.spec.ts | TypeScript |
ArrowFunction |
async () => {
eventBus.publish(new OrderStateTransitionEvent('AddingItems', 'ArrangingPayment', ctx, order));
await pause();
expect(onSend).not.toHaveBeenCalled();
eventBus.publish(new OrderStateTransitionEvent('AddingItems', 'Cancelled', ctx, order));
await... | byjose007/vendure | packages/email-plugin/src/plugin.spec.ts | TypeScript |
ArrowFunction |
async () => {
eventBus.publish(new OrderStateTransitionEvent('ArrangingPayment', 'PaymentSettled', ctx, order));
await pause();
expect(onSend.mock.calls[0][0].recipient).toBe(order.customer!.emailAddress);
} | byjose007/vendure | packages/email-plugin/src/plugin.spec.ts | TypeScript |
ArrowFunction |
async () => {
eventBus.publish(new OrderStateTransitionEvent('ArrangingPayment', 'PaymentSettled', ctx, order));
await pause();
expect(onSend.mock.calls[0][0].subject).toBe(`Order confirmation for #${order.code}`);
} | byjose007/vendure | packages/email-plugin/src/plugin.spec.ts | TypeScript |
ArrowFunction |
() => new Promise(resolve => setTimeout(resolve, 50)) | byjose007/vendure | packages/email-plugin/src/plugin.spec.ts | TypeScript |
ArrowFunction |
resolve => setTimeout(resolve, 50) | byjose007/vendure | packages/email-plugin/src/plugin.spec.ts | TypeScript |
ClassDeclaration |
class MockEvent extends VendureEvent {
constructor(public ctx: any, public shouldSend: boolean) {
super();
}
} | byjose007/vendure | packages/email-plugin/src/plugin.spec.ts | TypeScript |
ArrowFunction |
(state: IState) => ({
hp: state.player.hp,
mp: state.player.mp,
percentage: state.player.hp,
inventorySlots: state.player.inventorySlots,
}) | gregpalace/Talisman | src/client/containers/HudItems.tsx | TypeScript |
ArrowFunction |
({ hp, mp, inventorySlots, percentage }: any) => {
const [inventoryOpen, setInventoryOpen] = useState(false);
const showInventory = () => {
setInventoryOpen(!inventoryOpen);
};
return (
<div id='hud-items'>
<HealthBar hp={hp} percentage={percentage} />
<MagicBar mp={mp} percentage={percent... | gregpalace/Talisman | src/client/containers/HudItems.tsx | TypeScript |
ArrowFunction |
() => {
setInventoryOpen(!inventoryOpen);
} | gregpalace/Talisman | src/client/containers/HudItems.tsx | TypeScript |
MethodDeclaration |
inventoryOpen ? (
<Inventory hp={hp} mp={mp} inventorySlots={inventorySlots} />
) : null | gregpalace/Talisman | src/client/containers/HudItems.tsx | TypeScript |
ArrowFunction |
<T>(name: string, initialState: T, storageCondition = true): [T, React.Dispatch<React.SetStateAction<T>>] => {
const [state, setState] = useState(() => {
const item = localStorage.getItem(name);
if(item !== null && storageCondition) {
return JSON.parse(item) as T;
} else {
return initialState... | danielisgr8/wikirace | client/src/util/useStorageState.ts | TypeScript |
ArrowFunction |
() => {
const item = localStorage.getItem(name);
if(item !== null && storageCondition) {
return JSON.parse(item) as T;
} else {
return initialState;
}
} | danielisgr8/wikirace | client/src/util/useStorageState.ts | TypeScript |
ArrowFunction |
() => {
localStorage.setItem(name, JSON.stringify(state));
} | danielisgr8/wikirace | client/src/util/useStorageState.ts | TypeScript |
ArrowFunction |
() => (
<div className={styles.skillContainer}>
<div className | shemam/shema.me | components/Skills/Skill.tsx | TypeScript |
ClassDeclaration | /**
* @docid
* @inherits CollectionWidget
* @module ui/validation_summary
* @export default
* @prevFileNamespace DevExpress.ui
* @public
*/
export default class dxValidationSummary extends CollectionWidget {
constructor(element: TElement, options?: dxValidationSummaryOptions)
} | elernonelma/DevExtreme | js/ui/validation_summary.d.ts | TypeScript |
InterfaceDeclaration |
export interface dxValidationSummaryOptions extends CollectionWidgetOptions<dxValidationSummary> {
/**
* @docid
* @ref
* @prevFileNamespace DevExpress.ui
* @public
*/
validationGroup?: string;
} | elernonelma/DevExtreme | js/ui/validation_summary.d.ts | TypeScript |
TypeAliasDeclaration | /** @public */
export type ContentReadyEvent = ComponentEvent<dxValidationSummary>; | elernonelma/DevExtreme | js/ui/validation_summary.d.ts | TypeScript |
TypeAliasDeclaration | /** @public */
export type DisposingEvent = ComponentEvent<dxValidationSummary>; | elernonelma/DevExtreme | js/ui/validation_summary.d.ts | TypeScript |
TypeAliasDeclaration | /** @public */
export type InitializedEvent = ComponentInitializedEvent<dxValidationSummary>; | elernonelma/DevExtreme | js/ui/validation_summary.d.ts | TypeScript |
TypeAliasDeclaration | /** @public */
export type ItemClickEvent = ComponentNativeEvent<dxValidationSummary> & ItemInfo; | elernonelma/DevExtreme | js/ui/validation_summary.d.ts | TypeScript |
TypeAliasDeclaration | /** @public */
export type OptionChangedEvent = ComponentEvent<dxValidationSummary> & ChangedOptionInfo; | elernonelma/DevExtreme | js/ui/validation_summary.d.ts | TypeScript |
TypeAliasDeclaration |
export type Options = dxValidationSummaryOptions; | elernonelma/DevExtreme | js/ui/validation_summary.d.ts | TypeScript |
TypeAliasDeclaration | /** @deprecated use Options instead */
export type IOptions = dxValidationSummaryOptions; | elernonelma/DevExtreme | js/ui/validation_summary.d.ts | TypeScript |
ArrowFunction |
({ children, style }: Props) => {
return (
<View style={styles.container}>
<View style={[styles.subContainer, style]}>
{children}
</View>
</View> | AdamGold/hamagen-react-native | src/components/common/GeneralContainer.tsx | TypeScript |
InterfaceDeclaration |
interface Props {
children?: ReactNode,
style?: ViewStyle
} | AdamGold/hamagen-react-native | src/components/common/GeneralContainer.tsx | TypeScript |
EnumDeclaration |
enum projectRoles {
// This Enum provides the list of Project Roles.
developer = 1,
manager = 2,
cto = 3,
} | bcgov/BCSC-BPS | selfservice-ui/src/constants/enums.ts | TypeScript |
EnumDeclaration |
enum algorithmBase {
// This Enum provides the list of algorithams.
SignedJWT = 1,
SecureJWT = 2,
} | bcgov/BCSC-BPS | selfservice-ui/src/constants/enums.ts | TypeScript |
EnumDeclaration |
enum projectStatus {
draft = 1,
dev = 2,
devComplete = 3,
complianceChecks = 4,
complianceReview = 5,
complianceChecksComplete = 6,
awaitingProdKeys = 7,
inProd = 8,
} | bcgov/BCSC-BPS | selfservice-ui/src/constants/enums.ts | TypeScript |
FunctionDeclaration | /**
* The grid extent is computed from the points. If the cell number for the right edge of the grid
* is rounded down, some points could fall outside the grid. `lonlat.toPixel` and `lonlat.toPixel`
* naturally truncate down, which is the correct behavior for binning points into cells but means
* the grid is (almos... | javandres/analysis-ui | lib/utils/calculate-grid-points.ts | TypeScript |
ClassDeclaration |
@Injectable({
providedIn: 'root'
})
export class DashboardService {
constructor(private http:HttpClient,private ipService:StoreIpService) { }
getTransactionDetails(customerId:number):Observable<Selltransaction[]>{
return this.http.post<Selltransaction[]>("http://"+this.ipService.ipAddress+":"+this.ipService.... | Rahul29111993/SATVA | Angular/satva/src/app/dashboard.service.ts | TypeScript |
MethodDeclaration |
getTransactionDetails(customerId:number):Observable<Selltransaction[]>{
return this.http.post<Selltransaction[]>("http://"+this.ipService.ipAddress+":"+this.ipService.port+"/getSellTransactionDetails",customerId)
} | Rahul29111993/SATVA | Angular/satva/src/app/dashboard.service.ts | TypeScript |
MethodDeclaration |
getBuyTransactions(consumerId:number):Observable<Buytransaction[]>{
return this.http.post<Buytransaction[]>("http://"+this.ipService.ipAddress+":"+this.ipService.port+"/getBuyTransactionDetails",consumerId)
} | Rahul29111993/SATVA | Angular/satva/src/app/dashboard.service.ts | TypeScript |
ArrowFunction |
(data: any) => {
self.data = data.data;
self.render(self.data, (data: News[]) => {
// End loading
self.templateHelper.loading(false);
self.initializeSlider();
});
} | faridv/hop | src/modules/news/news.module.ts | TypeScript |
ArrowFunction |
(data: News[]) => {
// End loading
self.templateHelper.loading(false);
self.initializeSlider();
} | faridv/hop | src/modules/news/news.module.ts | TypeScript |
ArrowFunction |
() => {
if (typeof callback === 'function')
callback(data);
} | faridv/hop | src/modules/news/news.module.ts | TypeScript |
ArrowFunction |
() => {
// Next News
$carousel.slick('slickPrev');
} | faridv/hop | src/modules/news/news.module.ts | TypeScript |
ArrowFunction |
() => {
// Prev News
$carousel.slick('slickNext');
} | faridv/hop | src/modules/news/news.module.ts | TypeScript |
ArrowFunction |
() => {
self.loadDetails($carousel);
} | faridv/hop | src/modules/news/news.module.ts | TypeScript |
ArrowFunction |
(e) => {
self.loadDetails($carousel, $(this));
} | faridv/hop | src/modules/news/news.module.ts | TypeScript |
ArrowFunction |
news => news.id === id | faridv/hop | src/modules/news/news.module.ts | TypeScript |
ArrowFunction |
() => {
self.showDetails(!!item.media);
} | faridv/hop | src/modules/news/news.module.ts | TypeScript |
ArrowFunction |
() => {
// play video
self.playVideo();
} | faridv/hop | src/modules/news/news.module.ts | TypeScript |
ArrowFunction |
() => {
const scrollValue = parseInt($newsDetails.css('top').replace('px', '')) - 100;
$newsDetails.css('top', scrollValue.toString() + 'px');
} | faridv/hop | src/modules/news/news.module.ts | TypeScript |
ArrowFunction |
() => {
const scrollValue = parseInt($newsDetails.css('top').replace('px', '')) + 100;
if (scrollValue <= 0)
$newsDetails.css('top', scrollValue.toString() + 'px');
} | faridv/hop | src/modules/news/news.module.ts | TypeScript |
ArrowFunction |
() => {
// Return to news list
self.hideDetails();
} | faridv/hop | src/modules/news/news.module.ts | TypeScript |
ArrowFunction |
() => {
$('#news-details').empty();
} | faridv/hop | src/modules/news/news.module.ts | TypeScript |
ArrowFunction |
() => {
self.layoutInstance.prepareUnloadModule();
} | faridv/hop | src/modules/news/news.module.ts | TypeScript |
ArrowFunction |
() => {
self.playerInstance.unload();
} | faridv/hop | src/modules/news/news.module.ts | TypeScript |
ClassDeclaration |
export default class NewsModule extends Module {
private data;
private pageTitle = 'آخرین اخبار';
protected playerInstance;
protected events = {
'news.next': { control: 'right', title: 'خبر بعدی', icon: 'right' },
'news.prev': { control: 'left', title: 'خبر قبلی', icon: 'left' },
... | faridv/hop | src/modules/news/news.module.ts | TypeScript |
MethodDeclaration |
public load(callback?: any) {
const self = this;
let id: string = null;
let service = 'getByCategory';
this.templateHelper.loading();
if (typeof this.moduleType !== 'undefined' && this.moduleType) {
switch (this.moduleType) {
case 'uhd-programs':
... | faridv/hop | src/modules/news/news.module.ts | TypeScript |
MethodDeclaration |
public render(data: News[], callback): void {
const template = this.layoutInstance.layout === 'uhd' ? uhdNewsTemplate : newsTemplate;
this.templateHelper.render(template, { items: data, pageTitle: this.pageTitle }, this.$el, 'html', () => {
if (typeof callback === 'function')
... | faridv/hop | src/modules/news/news.module.ts | TypeScript |
MethodDeclaration |
private initializeSlider(): void {
const self = this;
const $el = $("ul.news-items");
const slidesToShow = 3;
if (!$el.is(':visible'))
$el.show(1);
$el.slick({
rtl: $("body").hasClass('rtl'),
accessibility: false,
slidesToShow: sli... | faridv/hop | src/modules/news/news.module.ts | TypeScript |
MethodDeclaration |
private registerKeyboardInputs($carousel): void {
const self = this;
this.input.addEvent('right', false, this.events['news.next'], () => {
// Next News
$carousel.slick('slickPrev');
});
this.input.addEvent('left', false, this.events['news.prev'], () => {
... | faridv/hop | src/modules/news/news.module.ts | TypeScript |
MethodDeclaration |
private loadDetails($carousel, $item?): void {
const self = this;
const id = (typeof $item !== 'undefined'
&& typeof $item.attr('data-id') !== 'undefined'
&& $item.attr('data-id'))
? ~~$item.attr('data-id')
: ~~$carousel.find('.slick-current.slick-center ... | faridv/hop | src/modules/news/news.module.ts | TypeScript |
MethodDeclaration |
private showDetails(hasVideo: boolean = false): void {
$('#news-details').fadeIn();
const self = this;
const $newsDetails = $('#news-details .inner .news-body');
$newsDetails.css('top', '0');
if (hasVideo) {
this.input.addEvent('blue,b', false, this.events['news.play... | faridv/hop | src/modules/news/news.module.ts | TypeScript |
MethodDeclaration |
private hideDetails(): void {
const self = this;
$('#news-details').fadeOut(() => {
$('#news-details').empty();
});
this.input.removeEvent('blue,b', { key: 'news.play' });
this.input.removeEvent('back,backspace', { key: 'news.back' });
setTimeout(() => {
... | faridv/hop | src/modules/news/news.module.ts | TypeScript |
MethodDeclaration |
private playVideo(): void {
const self = this;
if (this.templateHelper.hasClass('player-mode'))
return;
const $newsDetails = $('.news-details');
const playerParams = {
unloadMethod: () => {
self.playerInstance.unload();
},
... | faridv/hop | src/modules/news/news.module.ts | TypeScript |
FunctionDeclaration |
export default function useDeferredEvents(
initialState: DeferredEvent[] = [],
{ onDone, onAdd, onReset }: DeferredEventsHookOptions = {}
): DeferredEventsHook {
const [events, setEvents] = useState<Set<DeferredEvent>>(
new Set(initialState)
);
const add = useCallback<DeferredEventAddFn>(
event =>
... | quernext/gtm | src/useDeferredEvents.ts | TypeScript |
ArrowFunction |
event =>
setEvents(prevEvents => {
if (onAdd) {
onAdd(event);
}
const newEvents = new Set(prevEvents);
newEvents.add(event);
return newEvents;
}) | quernext/gtm | src/useDeferredEvents.ts | TypeScript |
ArrowFunction |
prevEvents => {
if (onAdd) {
onAdd(event);
}
const newEvents = new Set(prevEvents);
newEvents.add(event);
return newEvents;
} | quernext/gtm | src/useDeferredEvents.ts | TypeScript |
ArrowFunction |
(event, args) =>
setEvents(prevEvents => {
if (onDone) {
onDone(event, args);
}
const newEvents = new Set(prevEvents);
newEvents.delete(event);
return newEvents;
}) | quernext/gtm | src/useDeferredEvents.ts | TypeScript |
ArrowFunction |
prevEvents => {
if (onDone) {
onDone(event, args);
}
const newEvents = new Set(prevEvents);
newEvents.delete(event);
return newEvents;
} | quernext/gtm | src/useDeferredEvents.ts | TypeScript |
ArrowFunction |
() => {
if (onReset) {
onReset();
}
setEvents(new Set([]));
} | quernext/gtm | src/useDeferredEvents.ts | TypeScript |
FunctionDeclaration |
async function fetchDashboards(options: DashListOptions) {
let starredDashboards: Promise<Dashboard[]> = Promise.resolve([]);
if (options.showStarred) {
const params = { limit: options.maxItems, starred: 'true' };
starredDashboards = getBackendSrv().search(params);
}
let recentDashboards: Promise<Dash... | 3wWqj/grafana | public/app/plugins/panel/dashlist/DashList.tsx | TypeScript |
FunctionDeclaration |
export function DashList(props: PanelProps<DashListOptions>) {
const [dashboards, setDashboards] = useState(new Map<number, Dashboard>());
useEffect(() => {
fetchDashboards(props.options).then(dashes => {
setDashboards(dashes);
});
}, [
props.options.showSearch,
props.options.showStarred,
... | 3wWqj/grafana | public/app/plugins/panel/dashlist/DashList.tsx | TypeScript |
ArrowFunction |
d => d.id === dashId | 3wWqj/grafana | public/app/plugins/panel/dashlist/DashList.tsx | TypeScript |
ArrowFunction |
dash => {
if (dashMap.has(dash.id)) {
dashMap.get(dash.id)!.isSearchResult = true;
} else {
dashMap.set(dash.id, { ...dash, isSearchResult: true });
}
} | 3wWqj/grafana | public/app/plugins/panel/dashlist/DashList.tsx | TypeScript |
ArrowFunction |
dash => {
if (dashMap.has(dash.id)) {
dashMap.get(dash.id)!.isStarred = true;
} else {
dashMap.set(dash.id, { ...dash, isStarred: true });
}
} | 3wWqj/grafana | public/app/plugins/panel/dashlist/DashList.tsx | TypeScript |
ArrowFunction |
() => {
fetchDashboards(props.options).then(dashes => {
setDashboards(dashes);
});
} | 3wWqj/grafana | public/app/plugins/panel/dashlist/DashList.tsx | TypeScript |
ArrowFunction |
dashes => {
setDashboards(dashes);
} | 3wWqj/grafana | public/app/plugins/panel/dashlist/DashList.tsx | TypeScript |
ArrowFunction |
async (e: React.SyntheticEvent, dash: Dashboard) => {
e.preventDefault();
e.stopPropagation();
const isStarred = await getDashboardSrv().starDashboard(dash.id.toString(), dash.isStarred);
const updatedDashboards = new Map(dashboards);
updatedDashboards.set(dash.id, { ...dash, isStarred });
set... | 3wWqj/grafana | public/app/plugins/panel/dashlist/DashList.tsx | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.