[DDW-1105] Introduce newsfeed update (#1788)

  • [DDW-1105] Introduce newsfeed update

  • [DDW-1105] Remove unnecessary @watch flag

  • [DDW-1105] Code cleanup

  • [DDW-1105] Fit newsfeed improvements to match old newsfeed JSON structure

  • [DDW-1105] Fix eslint warnings and run prettier formatter

  • [DDW-1105] Dummy newsfeed JSON file update

  • [DDW-1105] Update newsfeed JSON structure

  • [DDW-1105] Update JSON file for E2E test

  • [DDW-1105] Run translation manager

  • [DDW-1105] Improve link external icon positioning in newsfeed items, Fix legacy wallet importer script

  • [DDW-1105] Remove legacy DATE parameter and add edge target daedalus version to JSON file

Co-authored-by: Nikola Glumac [email protected]

View on GitHub
File Changes
m
+1/-0

                      
### Chores

                      
+
- Updated newsfeed ([PR 1786](https://github.com/input-output-hk/daedalus/pull/1786))
- Changed Incentivized TestNet "Having trouble syncing" URL to point to one specific to TestNet ([PR 1795](https://github.com/input-output-hk/daedalus/pull/1795))
- Updated `cardano-wallet` to revision `d3d93ba3` ([PR 1784](https://github.com/input-output-hk/daedalus/pull/1784))
- Updated `cardano-wallet` to revision `e341d288` ([PR 1779](https://github.com/input-output-hk/daedalus/pull/1779))
  type?: string = ''
): Promise<LegacyAdaWallet> => {
  const queryParams = {};
-

                      
  return request(
    {
      method: 'POST',
  }

                      
  onClose = () => {
-
    const { alerts } = this.props;
+
    const { alerts, onMarkNewsAsRead, onCloseOpenAlert } = this.props;
    if (alerts.length <= 1) {
-
      this.props.onMarkNewsAsRead([alerts[0].date]);
-
      this.props.onCloseOpenAlert();
+
      onMarkNewsAsRead([alerts[0].id]);
+
      onCloseOpenAlert();
      this.setState({ showOverlay: false });
      return;
    }
-
    this.props.onMarkNewsAsRead([alerts[0].date]);
+
    onMarkNewsAsRead([alerts[0].id]);
  };

                      
  onProceedNewsAction = (event: SyntheticMouseEvent<HTMLElement>) => {
            <div className={styles.newsFeedItemsContainer}>
              {news.all.map(newsItem => (
                <NewsItem
-
                  key={newsItem.date}
+
                  key={newsItem.id}
                  newsItem={newsItem}
                  isNewsFeedOpen={isNewsFeedOpen}
                  onMarkNewsAsRead={onMarkNewsAsRead}
      event.preventDefault();
      this.props.onOpenExternalLink(linkUrl);
    } else {
-
      const { type, date } = this.props.newsItem;
+
      const { type, id } = this.props.newsItem;
      const { newsItemCollapsible } = this.state;
      if (type === NewsTypes.INFO || type === NewsTypes.ANNOUNCEMENT) {
        if (newsItemCollapsible) {
        }
      }
      if (NewsTypes.ALERT && this.props.onOpenAlert) {
-
        this.props.onOpenAlert(date);
+
        this.props.onOpenAlert(id);
      }
-
      this.props.onMarkNewsAsRead(date);
+
      this.props.onMarkNewsAsRead(id);
    }
  }

                      
      font-family: var(--font-medium);
      &:after {
        background-color: var(--theme-news-item-action-button-color);
-
        vertical-align: baseline;
      }
    }

                      
        background-color: var(--theme-label-button-color);
        height: 15px;
        margin-right: 12px;
+
        margin-top: -2px;
        -webkit-mask-size: 15px, 15px;
        mask-size: 15px, 15px;
        vertical-align: middle;
        background-color: var(--theme-label-button-color);
        height: 13px;
        margin-left: 5px;
+
        margin-top: -2px;
        -webkit-mask-size: 13px, 13px;
        mask-size: 13px, 13px;
        vertical-align: middle;
{
-
  "updatedAt": 1569324863299,
+
  "publishedAt": 1569169958620,
  "items": [
    {
+
      "id": 1569152525812,
+
      "title": {
+
        "en-US": "Alert 1 in English",
+
        "ja-JP": "Alert 1 in Japanese"
+
      },
+
      "content": {
+
        "en-US": "# h1 English alert content 1",
+
        "ja-JP": "# h1 Japanese alert content 1"
+
      },
+
      "target": {
+
        "daedalusVersion": ">=2.0.0-ITN1",
+
        "platforms": ["darwin", "win32", "linux"]
+
      },
+
      "action": {
+
        "label": {
+
          "en-US": "Visit en-US",
+
          "ja-JP": "Visit ja-JP"
+
        },
+
        "url": {
+
          "en-US": "https://iohk.zendesk.com/hc/en-us/articles/",
+
          "ja-JP": "https://iohk.zendesk.com/hc/ja/articles/"
+
        }
+
      },
+
      "publishedAt": {
+
        "en-US": 1569152525812,
+
        "ja-JP": 1569152525812
+
      },
+
      "type": "alert"
+
    },
+
    {
+
      "id": 1569238907194,
+
      "title": {
+
        "en-US": "Alert 2 in English",
+
        "ja-JP": "Alert 2 in Japanese"
+
      },
+
      "content": {
+
        "en-US": "# h1 English alert content 2\nUt consequat semper viverra nam libero justo laoreet sit.",
+
        "ja-JP": "# h1 Japanese alert content 2\nUt consequat semper viverra nam libero justo laoreet sit."
+
      },
+
      "target": {
+
        "daedalusVersion": ">=2.0.0-ITN1",
+
        "platforms": ["darwin", "win32", "linux"]
+
      },
+
      "action": {
+
        "label": {
+
          "en-US": "Visit en-US",
+
          "ja-JP": "Visit ja-JP"
+
        },
+
        "url": {
+
          "en-US": "https://iohk.zendesk.com/hc/en-us/articles/",
+
          "ja-JP": "https://iohk.zendesk.com/hc/ja/articles/"
+
        }
+
      },
+
      "publishedAt": {
+
        "en-US": 1569238907194,
+
        "ja-JP": 1569238907194
+
      },
+
      "type": "alert"
+
    },
+
    {
+
      "id": 1569325284166,
+
      "title": {
+
        "en-US": "Alert 3 in English",
+
        "ja-JP": ""
+
      },
+
      "content": {
+
        "en-US": "# h1 English alert content 3\nUt consequat semper viverra nam libero justo laoreet sit.",
+
        "ja-JP": ""
+
      },
+
      "target": {
+
        "daedalusVersion": ">=2.0.0-ITN1",
+
        "platforms": ["darwin", "win32", "linux"]
+
      },
+
      "action": {
+
        "label": {
+
          "en-US": "Visit en-US",
+
          "ja-JP": ""
+
        },
+
        "url": {
+
          "en-US": "https://iohk.zendesk.com/hc/en-us/articles/",
+
          "ja-JP": ""
+
        }
+
      },
+
      "publishedAt": {
+
        "en-US": 1569325284166,
+
        "ja-JP": 1569325284166
+
      },
+
      "type": "alert"
+
    },
+
    {
+
      "id": 1569429144746,
+
      "title": {
+
        "en-US": "Announcement 1 in English",
+
        "ja-JP": "Announcement 1 in Japanese"
+
      },
+
      "content": {
+
        "en-US": "# h1 English announcement content 1\nUt consequat semper viverra nam libero justo laoreet sit.",
+
        "ja-JP": "# h1 Japanese announcement content 1\nUt consequat semper viverra nam libero justo laoreet sit."
+
      },
+
      "target": {
+
        "daedalusVersion": ">=2.0.0-ITN1",
+
        "platforms": ["darwin", "win32", "linux"]
+
      },
+
      "action": {
+
        "label": {
+
          "en-US": "Visit en-US",
+
          "ja-JP": "Visit ja-JP"
+
        },
+
        "url": {
+
          "en-US": "https://iohk.zendesk.com/hc/en-us/articles/",
+
          "ja-JP": "https://iohk.zendesk.com/hc/ja/articles/"
+
        }
+
      },
+
      "publishedAt": {
+
        "en-US": 1569429144746,
+
        "ja-JP": 1569429144746
+
      },
+
      "type": "announcement"
+
    },
+
    {
+
      "id": 1569342749091,
+
      "title": {
+
        "en-US": "Announcement 2 in English",
+
        "ja-JP": "Announcement 2 in Japanese"
+
      },
+
      "content": {
+
        "en-US": "# h1 English announcement content 2\nUt consequat semper viverra nam libero justo laoreet sit.",
+
        "ja-JP": "# h1 Japanese announcement content 2\nUt consequat semper viverra nam libero justo laoreet sit."
+
      },
+
      "target": {
+
        "daedalusVersion": ">=2.0.0-ITN1",
+
        "platforms": ["darwin", "win32", "linux"]
+
      },
+
      "action": {
+
        "label": {
+
          "en-US": "Visit en-US",
+
          "ja-JP": "Visit ja-JP"
+
        },
+
        "url": {
+
          "en-US": "https://iohk.zendesk.com/hc/en-us/articles/",
+
          "ja-JP": "https://iohk.zendesk.com/hc/ja/articles/"
+
        }
+
      },
+
      "publishedAt": {
+
        "en-US": 1569342749091,
+
        "ja-JP": 1569342749091
+
      },
+
      "type": "announcement"
+
    },
+
    {
+
      "id": 1569256354107,
      "title": {
        "en-US": "Info 1 in English",
        "ja-JP": "Info 1 in Japanese"
        "ja-JP": "# h1 Japanese info content 1\nUt consequat semper viverra nam libero justo laoreet sit."
      },
      "target": {
-
        "daedalusVersion": "0.12.0 - 0.14.0",
+
        "daedalusVersion": ">=2.0.0-ITN1",
        "platforms": ["darwin", "win32", "linux"]
      },
      "action": {
          "ja-JP": "https://iohk.zendesk.com/hc/ja/articles/"
        }
      },
-
      "date": 1569324863299,
+
      "publishedAt": {
+
        "en-US": 1569256354107,
+
        "ja-JP": 1569256354107
+
      },
      "type": "info"
    },
    {
+
      "id": 1569169958620,
      "title": {
        "en-US": "Info 2 in English - a little bit longer title",
        "ja-JP": "Info 2 in Japanese"
        "ja-JP": "# h1 Japanese info content 2\n."
      },
      "target": {
-
        "daedalusVersion": "0.12.0 - 0.14.0",
+
        "daedalusVersion": ">=2.0.0-ITN1",
        "platforms": ["darwin", "win32", "linux"]
      },
      "action": {
          "ja-JP": "https://iohk.zendesk.com/hc/ja/articles/"
        }
      },
-
      "date": 1568979341589,
+
      "publishedAt": {
export default class NewsFeedContainer extends Component<InjectedProps> {
  static defaultProps = { actions: null, stores: null };

                      
-
  handleMarkNewsAsRead = (newsTimestamps: number) => {
+
  handleMarkNewsAsRead = (newsId: number) => {
    const { stores } = this.props;
    const { markNewsAsRead } = stores.newsFeed;
-
    markNewsAsRead([newsTimestamps]);
+
    markNewsAsRead([newsId]);
  };

                      
  render() {
const { version, platform } = global.environment;

                      
class News {
+
  @observable id: number;
  @observable title: string;
  @observable content: string;
  @observable target: NewsTarget;
  @observable read: boolean;

                      
  constructor(data: {
+
    id: number,
    title: string,
    content: string,
    target: NewsTarget,
      const availableTargetVersionRange = get(
        newsItem,
        ['target', 'daedalusVersion'],
-
        null
+
        ''
      );
      const targetPlatforms = get(newsItem, ['target', 'platforms']);
      return (
        (!availableTargetVersionRange ||
          (availableTargetVersionRange &&
            semver.satisfies(version, availableTargetVersionRange))) &&
-
        (platform === 'browser' || includes(targetPlatforms, platform))
+
        (platform === 'browser' || includes(targetPlatforms, platform)) &&
+
        newsItem.id &&
+
        newsItem.title &&
+
        newsItem.content &&
+
        newsItem.action.label &&
+
        newsItem.date
      );
    });
+

                      
    const orderedNews = orderBy(filteredNews, 'date', 'desc');
+

                      
    runInAction(() => {
      this.all = orderedNews;
    });
        "description": "Title for \"Manual update\" overlay",
        "end": {
          "column": 3,
-
          "line": 17
+
          "line": 15
        },
        "file": "source/renderer/app/components/loading/manual-update/ManualUpdate.js",
        "id": "manualUpdate.title",
        "start": {
          "column": 9,
-
          "line": 13
+
          "line": 11
        }
      },
      {
        "defaultMessage": "!!!You are experiencing network connection issues, and you are not running the latest Daedalus version. Automatic updates are unavailable while Daedalus is not connected to Cardano network.",
        "description": "Description line 1 of \"Manual update\" overlay",
        "end": {
          "column": 3,
-
          "line": 23
+
          "line": 21
        },
        "file": "source/renderer/app/components/loading/manual-update/ManualUpdate.js",
        "id": "manualUpdate.description1",
        "start": {
          "column": 20,
-
          "line": 18
+
          "line": 16
        }
      },
      {
        "defaultMessage": "!!!You are currently running <b>{currentAppVersion}</b> version of Daedalus, and <b>{availableAppVersion}</b> version is available. Please manually update to that version since it may resolve your connecting issues.",
        "description": "Description line 2 of \"Manual update\" overlay",
        "end": {
          "column": 3,
-
          "line": 29
+
          "line": 27
        },
        "file": "source/renderer/app/components/loading/manual-update/ManualUpdate.js",
        "id": "manualUpdate.description2",
        "start": {
          "column": 20,
-
          "line": 24
+
          "line": 22
        }
      },
      {
        "defaultMessage": "!!!Follow instructions and manually update",
        "description": "Label for \"Follow instructions and manually update\" action button on \"Manual update\" overlay",
        "end": {
          "column": 3,
-
          "line": 35
+
          "line": 33
        },
        "file": "source/renderer/app/components/loading/manual-update/ManualUpdate.js",
        "id": "manualUpdate.button.label",
        "start": {
          "column": 21,
-
          "line": 30
+
          "line": 28
        }
      },
      {
        "defaultMessage": "!!!https://iohk.zendesk.com/hc/en-us/articles/360023850634",
        "description": "Follow instructions and manually update link on \"Manual update\" overlay",
        "end": {
          "column": 3,
-
          "line": 42
+
          "line": 40
        },
        "file": "source/renderer/app/components/loading/manual-update/ManualUpdate.js",
        "id": "manualUpdate.button.url",
        "start": {
          "column": 25,
-
          "line": 36
+
          "line": 34
        }
      }
    ],
        "description": "Report connecting issue text on the loading screen.",
        "end": {
          "column": 3,
-
          "line": 17
+
          "line": 18
        },
        "file": "source/renderer/app/components/loading/syncing-connecting/ReportIssue.js",
        "id": "loading.screen.reportIssue.connecting.text",
        "start": {
          "column": 29,
-
          "line": 13
+
          "line": 14
        }
      },
      {
        "defaultMessage": "!!!Having trouble syncing?",
        "description": "Report syncing issue text on the loading screen.",
        "end": {
          "column": 3,
-
          "line": 22
+
          "line": 23
        },
        "file": "source/renderer/app/components/loading/syncing-connecting/ReportIssue.js",
        "id": "loading.screen.reportIssue.syncing.text",
        "start": {
          "column": 26,
-
          "line": 18
+
          "line": 19
        }
      },
      {
        "defaultMessage": "!!!Open support ticket",
        "description": "Open support ticket button label on the loading.",
        "end": {
          "column": 3,
-
          "line": 27
+
          "line": 28
        },
        "file": "source/renderer/app/components/loading/syncing-connecting/ReportIssue.js",
        "id": "loading.screen.reportIssue.buttonLabel",
        "start": {
          "column": 26,
-
          "line": 23
+
          "line": 24
        }
      },
      {
        "defaultMessage": "!!!Read the article",
        "description": "Read the article button label on the loading.",
        "end": {
          "column": 3,
-
          "line": 32
+
          "line": 33
        },
        "file": "source/renderer/app/components/loading/syncing-connecting/ReportIssue.js",
        "id": "loading.screen.readArticle.buttonLabel",
        "start": {
          "column": 26,
-
          "line": 28
+
          "line": 29
        }
      },
      {
        "defaultMessage": "!!!Download logs",
        "description": "Download logs button label on the loading.",
        "end": {
          "column": 3,
-
          "line": 37
+
          "line": 38
        },
        "file": "source/renderer/app/components/loading/syncing-connecting/ReportIssue.js",
        "id": "loading.screen.reportIssue.downloadLogsLinkLabel",
        "start": {
          "column": 36,
-
          "line": 33
+
          "line": 34
        }
      },
      {
        "defaultMessage": "!!!https://iohk.zendesk.com/hc/en-us/requests/new/",
        "description": "Link to Open Support page",
        "end": {
          "column": 3,
-
          "line": 42
+
          "line": 43
        },
        "file": "source/renderer/app/components/loading/syncing-connecting/ReportIssue.js",
        "id": "loading.screen.reportIssue.reportIssueButtonUrl",
        "start": {
          "column": 24,
-
          "line": 38
+
          "line": 39
        }
      },
      {
        "defaultMessage": "!!!https://iohk.zendesk.com/hc/en-us/articles/360011536933",
        "description": "Link to sync issue article page",
        "end": {
          "column": 3,
-
          "line": 48
+
          "line": 49
        },
        "file": "source/renderer/app/components/loading/syncing-connecting/ReportIssue.js",
        "id": "loading.screen.readIssueArticle.syncIssueArticleUrl",
        "start": {
          "column": 23,
-
          "line": 43
+
          "line": 44
        }
      },
      {
        "defaultMessage": "!!!https://iohk.zendesk.com/hc/en-us/articles/900000048566",
        "description": "Link to sync issue article page for Incentivized TestNet",
        "end": {
          "column": 3,
-
          "line": 54
+
          "line": 55
        },
        "file": "source/renderer/app/components/loading/syncing-connecting/ReportIssue.js",
  GetNewsResponse,
  GetReadNewsResponse,
  NewsItem,
-
  NewsTimestamp,
  MarkNewsAsReadResponse,
} from '../api/news/types';

                      
-
const { isTest } = global.environment;
+
const { isTest, isDev } = global.environment;

                      
const AVAILABLE_NEWSFEED_EVENT_ACTIONS = [
  'DOWNLOAD_LOGS',
    let rawNews;
    try {
      rawNews = await this.getNewsRequest.execute().promise;
+

                      
      const hasIncident = find(
        rawNews.items,
        news => news.type === NewsTypes.INCIDENT
    }
  };

                      
-
  @action markNewsAsRead = async newsTimestamps => {
+
  @action markNewsAsRead = async newsId => {
    // Set news timestamp to LC
-
    await this.markNewsAsReadRequest.execute(newsTimestamps);
+
    await this.markNewsAsReadRequest.execute(newsId);
    // Get all read news to force @computed change
    await this.getReadNewsRequest.execute();
  };

                      
-
  @action openAlert = (newsTimestamp: NewsTimestamp) => {
+
  @action openAlert = (newsId: number) => {
    if (this.getNewsRequest.wasExecuted) {
      const alertToOpen = this.newsFeedData.alerts.all.find(
-
        newsItem => newsItem.date === newsTimestamp
+
        newsItem => newsItem.id === newsId
      );
      if (alertToOpen) {
        this.openedAlert = alertToOpen;
    }
  };

                      
+
  @action setFakedNewsfeed = () => {
+
    if (isDev) {
+
      if (this.pollingNewsIntervalId) {
+
        clearInterval(this.pollingNewsIntervalId);
+
        this.pollingNewsIntervalId = null;
+
      }
+
      const rawNews = require('../config/news.dummy.json');
+
      this.rawNews = get(rawNews, 'items', []);
+
      this.newsUpdatedAt = get(rawNews, 'updatedAt', null);
+
    }
+
  };
+

                      
  @computed get newsFeedData(): News.NewsCollection {
    const { currentLocale } = this.stores.profile;
    const readNews = this.getReadNewsRequest.result;
    let news = [];
+

                      
    if (this.getNewsRequest.wasExecuted) {
-
      news = map(this.rawNews, item => ({
-
        ...item,
-
        title: item.title[currentLocale],
-
        content: item.content[currentLocale],
-
        action: {
-
          ...item.action,
-
          label: get(item, ['action', 'label', currentLocale]),
-
          url: get(item, ['action', 'url', currentLocale]),
-
          route: get(item, ['action', 'route', currentLocale]),
-
          event: get(item, ['action', 'event', currentLocale]),
-
        },
-
        read: readNews.includes(item.date),
-
      }));
+
      news = map(this.rawNews, item => {
+
        // Match old and new newsfeed JSON format
+
        const mainIdentificator = item.id || item.date;
+
        return {
+
          ...item,
+
          id: mainIdentificator,
+
          title: item.title[currentLocale],
+
          content: item.content[currentLocale],
+
          action: {
+
            label: get(item, ['action', 'label', currentLocale]),
+
            url: get(item, ['action', 'url', currentLocale]),
+
            route: get(item, ['action', 'route', currentLocale]),
+
            event: get(item, ['action', 'event', currentLocale]),
+
          },
+
          date: get(item, ['publishedAt', currentLocale], item.date),
+
          read: readNews.includes(mainIdentificator),
+
        };
+
      });
    }
-

                      
    return new News.NewsCollection(news);
  }

                      

                      
const news = [
  new News.News({
+
    id: 1,
    title: 'Some title 1 in English',
    content: 'Some title 1 in English',
    target: { daedalusVersion: null, platform: 'darwin' },
    read: false,
  }),
  new News.News({
+
    id: 2,
    title: 'Some title 2 in English',
    content: 'Some title 2 in English',
    target: { daedalusVersion: null, platform: 'win32' },
    read: false,
  }),
  new News.News({
+
    id: 3,
    title: 'Some title 3 in English',
    content: 'Some title 3 in English',
    target: { daedalusVersion: null, platform: 'linux' },
    read: false,
  }),
  new News.News({
+
    id: 4,
    title: 'Some title 4 in English',
    content: 'Some title 4 in English',
    target: { daedalusVersion: null, platform: 'darwin' },
    read: false,
  }),
  new News.News({
+
    id: 5,
    title: 'Some title 5 in English',
    content: 'Some title 5 in English',
    target: { daedalusVersion: null, platform: 'darwin' },
    read: false,
  }),
  new News.News({
+
    id: 6,
    title: 'Some title 6 in English',
    content: 'Some title 6 in English',
    target: { daedalusVersion: null, platform: 'win32' },
    read: false,
  }),
  new News.News({
+
    id: 7,
    title: 'Some title 7 in English',
    content: 'Some title 7 in English',
    target: { daedalusVersion: null, platform: 'darwin' },
    read: false,
  }),
  new News.News({
+
    id: 8,
    title: 'Some title 8 in English',
    content: 'Some title 8 in English',
    target: { daedalusVersion: null, platform: 'linux' },
    read: false,
  }),
  new News.News({
+
    id: 9,
    title: 'Some title 9 in English',
    content: 'Some title 9 in English',
    target: { daedalusVersion: null, platform: 'darwin' },
{
-
  "updatedAt": 1569324863299,
+
  "publishedAt": 1569169958620,
  "items": [
    {
+
      "id": 1569325866799,
      "title": {
        "en-US": "Incident 1 in English",
        "ja-JP": "Incident 1 in Japanese"
        "ja-JP": "# h1 Japanese incident content 1\nUt consequat semper viverra nam libero justo laoreet sit. Sagittis vitae et leo duis. Eget nullam non nisi est sit amet facilisis magna etiam. Nisl tincidunt eget nullam non nisi est sit amet facilisis. Auctor neque vitae tempus quam pellentesque. Vel facilisis volutpat est velit egestas dui id ornare arcu.\n\n## h2 Heading\n\nConsequat mauris nunc congue nisi vitae suscipit. Dictum non consectetur a erat nam. Laoreet non curabitur gravida arcu ac tortor dignissim. Eu augue ut lectus arcu bibendum at. Facilisis gravida neque convallis a cras semper. Ut consequat semper viverra nam libero justo laoreet sit. Sagittis vitae et leo duis. Eget nullam non nisi est sit amet facilisis magna etiam. Nisl tincidunt eget nullam non nisi est sit amet facilisis. Auctor neque vitae tempus quam pellentesque. Vel facilisis volutpat est velit egestas dui id ornare arcu. Nam aliquam sem et tortor consequat id porta nibh venenatis.\n\nViverra nam libero justo laoreet sit amet. Pharetra diam sit amet nisl. Quam viverra orci sagittis eu. Rhoncus dolor purus non enim. Posuere urna nec tincidunt praesent semper feugiat. Suspendisse in est ante in nibh mauris cursus. Sit amet consectetur adipiscing elit duis. Tortor id aliquet lectus proin nibh nisl condimentum id. At in tellus integer feugiat scelerisque. Maecenas sed enim ut sem viverra aliquet. Pellentesque pulvinar pellentesque habitant morbi. Ultrices neque ornare aenean euismod elementum nisi quis eleifend. Praesent tristique magna sit amet purus gravida. Diam volutpat commodo sed egestas egestas. Ut placerat orci nulla pellentesque dignissim enim. Ultrices in iaculis nunc sed augue lacus viverra. Etiam sit amet nisl purus.\n\n## Typographic replacements\n\nEnable typographer option to see result.\n\n(c) (C) (r) (R) (tm) (TM) (p) (P) +-\n\ntest.. test... test..... test?..... test!....\n\n!!!!!! ???? ,,  -- ---\n\n\"Smartypants, double quotes\" and 'single quotes'\n\n\n## Emphasis\n\n**This is bold text**\n\n__This is bold text__\n\n*This is italic text*\n\n_This is italic text_\n\n## Lists\n\nUnordered\n\n+ Create a list by starting a line with `+`, `-`, or `*`\n+ Sub-lists are made by indenting 2 spaces:\n+ Very easy!\n\nOrdered\n\n1. Lorem ipsum dolor sit amet\n2. Consectetur adipiscing elit\n3. Integer molestie lorem at massa\n\n\n1. You can use sequential numbers...\n1. ...or keep all the numbers as `1.`\n\n## Links\n\n[link text](http://dev.nodeca.com)\n\n[link with title](http://nodeca.github.io/pica/demo/ \"title text!\")\n\nAutoconverted link https://github.com/nodeca/pica (enable linkify to see)\n\n### [Subscript](https://github.com/markdown-it/markdown-it-sub) / [Superscript](https://github.com/markdown-it/markdown-it-sup)\n\n- 19^th^\n- H~2~O"
      },
      "target": {
-
        "daedalusVersion": null,
+
        "daedalusVersion": ">=2.0.0-ITN1",
        "platforms":["darwin","win32","linux"]
      },
      "action": {
          "ja-JP": "https://iohk.zendesk.com/hc/ja/articles/"
        }
      },
-
      "date": 1569325866799,
+
      "publishedAt": {
+
        "en-US": 1569325866799,
+
        "ja-JP": 1569325866799
+
      },
      "type": "incident"
    },
    {
+
      "id": 1569152525812,
      "title": {
        "en-US": "Alert 1 in English",
        "ja-JP": "Alert 1 in Japanese"
        "ja-JP": "# h1 Japanese alert content 1"
      },
      "target": {
-
        "daedalusVersion": null,
-
        "platforms":["darwin","win32","linux"]
+
        "daedalusVersion": ">=2.0.0-ITN1",
+
        "platforms": ["darwin", "win32", "linux"]
      },
      "action": {
        "label": {
          "ja-JP": "https://iohk.zendesk.com/hc/ja/articles/"
        }
      },
-
      "date": 1569152525812,
+
      "publishedAt": {
+
        "en-US": 1569152525812,
+
        "ja-JP": 1569152525812
+
      },
      "type": "alert"
    },
    {
+
      "id": 1569238907194,
+
      "title": {
+
        "en-US": "Alert 2 in English",
+
        "ja-JP": "Alert 2 in Japanese"
+
      },
+
      "content": {
+
        "en-US": "# h1 English alert content 2\nUt consequat semper viverra nam libero justo laoreet sit.",
+
        "ja-JP": "# h1 Japanese alert content 2\nUt consequat semper viverra nam libero justo laoreet sit."
+
      },
+
      "target": {
+
        "daedalusVersion": ">=2.0.0-ITN1",
+
        "platforms": ["darwin", "win32", "linux"]
+
      },
+
      "action": {
+
        "label": {
+
          "en-US": "Visit en-US",
+
          "ja-JP": "Visit ja-JP"
+
        },
+
        "url": {
+
          "en-US": "https://iohk.zendesk.com/hc/en-us/articles/",
+
          "ja-JP": "https://iohk.zendesk.com/hc/ja/articles/"
+
        }
+
      },
+
      "publishedAt": {
+
        "en-US": 1569238907194,
+
        "ja-JP": 1569238907194
+
      },
+
      "type": "alert"
+
    },
+
    {
+
      "id": 1569325284166,
+
      "title": {
+
        "en-US": "Alert 3 in English",
+
        "ja-JP": ""
+
      },
+
      "content": {
+
        "en-US": "# h1 English alert content 3\nUt consequat semper viverra nam libero justo laoreet sit.",
+
        "ja-JP": ""
+
      },
+
      "target": {
+
        "daedalusVersion": ">=2.0.0-ITN1",
+
        "platforms": ["darwin", "win32", "linux"]
+
      },
+
      "action": {
+
        "label": {
+
          "en-US": "Visit en-US",
+
          "ja-JP": ""
+
        },
+
        "url": {
+
          "en-US": "https://iohk.zendesk.com/hc/en-us/articles/",
+
          "ja-JP": ""
+
        }
+
      },
+
      "publishedAt": {
+
        "en-US": 1569325284166,
+
        "ja-JP": 1569325284166
+
      },
+
      "type": "alert"
+
    },
+
    {
+
      "id": 1569429144746,
+
      "title": {
+
        "en-US": "Announcement 1 in English",
+
        "ja-JP": "Announcement 1 in Japanese"
+
      },
+
      "content": {
+
        "en-US": "# h1 English announcement content 1\nUt consequat semper viverra nam libero justo laoreet sit.",
+
        "ja-JP": "# h1 Japanese announcement content 1\nUt consequat semper viverra nam libero justo laoreet sit."
+
      },
+
      "target": {
+
        "daedalusVersion": ">=2.0.0-ITN1",
+
        "platforms": ["darwin", "win32", "linux"]
+
      },
+
      "action": {
+
        "label": {
+
          "en-US": "Visit en-US",
+
          "ja-JP": "Visit ja-JP"
+
        },
+
        "url": {
+
          "en-US": "https://iohk.zendesk.com/hc/en-us/articles/",
+
          "ja-JP": "https://iohk.zendesk.com/hc/ja/articles/"
+
        }
+
      },
+
      "publishedAt": {
+
        "en-US": 1569429144746,
+
        "ja-JP": 1569429144746
+
      },
+
      "type": "announcement"
+
    },
+
    {
+
      "id": 1569342749091,
+
      "title": {
+
        "en-US": "Announcement 2 in English",
+
        "ja-JP": "Announcement 2 in Japanese"
+
      },
+
      "content": {
+
        "en-US": "# h1 English announcement content 2\nUt consequat semper viverra nam libero justo laoreet sit.",
+
        "ja-JP": "# h1 Japanese announcement content 2\nUt consequat semper viverra nam libero justo laoreet sit."
+
      },
+
      "target": {
+
        "daedalusVersion": ">=2.0.0-ITN1",
+
        "platforms": ["darwin", "win32", "linux"]
+
      },
+
      "action": {
+
        "label": {
+
          "en-US": "Visit en-US",
+
          "ja-JP": "Visit ja-JP"
+
        },
+
        "url": {
+
          "en-US": "https://iohk.zendesk.com/hc/en-us/articles/",
+
          "ja-JP": "https://iohk.zendesk.com/hc/ja/articles/"
+
        }
+
      },
+
      "publishedAt": {
+
        "en-US": 1569342749091,
+
        "ja-JP": 1569342749091
+
      },
+
      "type": "announcement"
+
    },
+
    {
+
      "id": 1569256354107,
      "title": {
        "en-US": "Info 1 in English",
        "ja-JP": "Info 1 in Japanese"
        "ja-JP": "# h1 Japanese info content 1\nUt consequat semper viverra nam libero justo laoreet sit."
      },
      "target": {
-
        "daedalusVersion": null,
+
        "daedalusVersion": ">=2.0.0-ITN1",
        "platforms": ["darwin", "win32", "linux"]
      },
      "action": {
          "ja-JP": "https://iohk.zendesk.com/hc/ja/articles/"
        }
      },
-
      "date": 1569324863299,
+
      "publishedAt": {
+
        "en-US": 1569256354107,
+
        "ja-JP": 1569256354107
+
      },
      const { api } = daedalus;
      api.ada.setFakeNewsFeedJsonForTesting(news);
      if (isRead) {
-
        api.localStorage.markNewsAsRead(news.items.map(i => i.date)).then(done);
+
        api.localStorage.markNewsAsRead(news.items.map(i => i.id)).then(done);
      } else {
        done();
      }
    await Promise.all(mnemonics.map((mnemonic, index) => {
      const name = walletNames[index]
      const payload = generateImportPayload(mnemonic, name)
-
      return axios.post(`http://localhost:${API_PORT}/v2/byron-wallets`, payload)
+
      return axios.post(`http://localhost:${API_PORT}/v2/byron-wallets/random`, payload)
    }))
  } catch (e) {
    console.log(e)