Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

[MM-18918] Migrate 'utils/server_version.jsx' and associated tests to TypeScript #3842

Merged
merged 2 commits into from
Oct 2, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Migrate 'utils/server_version.jsx' and tests to TypeScript
  • Loading branch information
mjthomp95 committed Oct 2, 2019
commit c37dfc0be0232f33c30902c0874da5ae93d8ae43
2 changes: 1 addition & 1 deletion components/announcement_bar/version_bar/version_bar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import PropTypes from 'prop-types';

import {FormattedMessage} from 'react-intl';

import {equalServerVersions} from 'utils/server_version.jsx';
import {equalServerVersions} from 'utils/server_version';
import {AnnouncementBarTypes} from 'utils/constants.jsx';

import AnnouncementBar from '../announcement_bar.jsx';
Expand Down
2 changes: 1 addition & 1 deletion components/system_notice/notices.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import React from 'react';

import FormattedMarkdownMessage from 'components/formatted_markdown_message';

import * as ServerVersion from 'utils/server_version.jsx';
import * as ServerVersion from 'utils/server_version';
import * as UserAgent from 'utils/user_agent.jsx';

import mattermostIcon from 'images/icon50x50.png';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import {equalServerVersions, isServerVersionGreaterThanOrEqualTo} from 'utils/server_version.jsx';
import {equalServerVersions, isServerVersionGreaterThanOrEqualTo} from 'utils/server_version';

describe('utils/server_version/equalServerVersions', () => {
test('should handle undefined values', () => {
Expand Down
4 changes: 2 additions & 2 deletions utils/server_version.jsx → utils/server_version.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* 4.7.0.dev.3034fbc5fd566195d1b53e03890e35ff.true
* 4.7.1.dev.d131dd02c5e6eec4693d9a0698aff95c.true
*/
export function equalServerVersions(a, b) {
export function equalServerVersions(a: string, b: string): boolean {
if (a === b) {
return true;
}
Expand All @@ -36,7 +36,7 @@ export function equalServerVersions(a, b) {
* eg. currentVersion = 4.16.0, compareVersion = 4.17.0 returns false
* currentVersion = 4.16.1, compareVersion = 4.16.1 returns true
*/
export function isServerVersionGreaterThanOrEqualTo(currentVersion, compareVersion) {
export function isServerVersionGreaterThanOrEqualTo(currentVersion: string, compareVersion: string): boolean {
if (currentVersion === compareVersion) {
return true;
}
Expand Down