moira-web

Форк
0
/
NotificationList.stories.js 
75 строк · 2.7 Кб
1
// @flow
2
import * as React from "react";
3
import { storiesOf } from "@storybook/react";
4
import { action } from "@storybook/addon-actions";
5
import StoryRouter from "storybook-router";
6
import NotificationList from "../Components/NotificationList/NotificationList";
7

8
// item.timestamp + item.contact.id + item.event.sub_id;
9
const items = {
10
    "1505225036949654be-b364-4725-b2d2-e2b0ffbd058858661cb5-e6b2-4c8f-9a82-5e83673127d8": {
11
        event: {
12
            timestamp: 1505222055,
13
            metric: "KE.houston.daemons.error.errors.Focus_Production_Bingo_ElFeederMspIndex.1",
14
            value: 0,
15
            state: "OK",
16
            trigger_id: "f51bdab7-11ed-4ac4-9836-8a88b184cb67",
17
            sub_id: "58661cb5-e6b2-4c8f-9a82-5e83673127d8",
18
            old_state: "ERROR",
19
            msg: "",
20
        },
21
        trigger: {
22
            id: "f51bdab7-11ed-4ac4-9836-8a88b184cb67",
23
            name: "Declarant errors",
24
            desc: "",
25
            targets: ["KE.houston.daemons.error.*.*ElFeeder*.*"],
26
            warn_value: 1,
27
            error_value: 2,
28
            __notifier_trigger_tags: ["critical", "ElFeeders", "Focus"],
29
        },
30
        contact: {
31
            type: "telegram",
32
            value: "@skbkontur",
33
            id: "949654be-b364-4725-b2d2-e2b0ffbd0588",
34
            user: "a.tolstov",
35
        },
36
        throttled: true,
37
        send_fail: 12,
38
        timestamp: 1505225036,
39
    },
40
    "15052239865d7c1ee2-78d8-46c0-bb67-16895303b4b058661cb5-e6b2-4c8f-9a82-5e83673127d8": {
41
        event: {
42
            timestamp: 1505222055,
43
            metric: "KE.houston.daemons.error.errors.Focus_Production_Bingo_ElFeederMspIndex.1",
44
            value: 0,
45
            state: "OK",
46
            trigger_id: "f51bdab7-11ed-4ac4-9836-8a88b184cb67",
47
            sub_id: "58661cb5-e6b2-4c8f-9a82-5e83673127d8",
48
            old_state: "ERROR",
49
            msg: "",
50
        },
51
        trigger: {
52
            id: "f51bdab7-11ed-4ac4-9836-8a88b184cb67",
53
            name: "Focus Houston ElFeeders",
54
            desc: "",
55
            targets: ["KE.houston.daemons.error.*.*ElFeeder*.*"],
56
            warn_value: 1,
57
            error_value: 2,
58
            __notifier_trigger_tags: ["critical", "ElFeeders", "Focus"],
59
        },
60
        contact: {
61
            type: "mail",
62
            value: "user@skbkontur.ru",
63
            id: "5d7c1ee2-78d8-46c0-bb67-16895303b4b0",
64
            user: "a.tolstov",
65
        },
66
        throttled: false,
67
        send_fail: 0,
68
        timestamp: 1505223986,
69
    },
70
};
71

72
storiesOf("NotificationList", module)
73
    .addDecorator(StoryRouter())
74
    .add("Default", () => <NotificationList items={items} onRemove={action("onRemove")} />)
75
    .add("Empty", () => <NotificationList items={{}} onRemove={action("onRemove")} />);
76

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.