Update task news to support 3.0.0 (#3342)

* Introduce Version, use it to check current version in custom reports
* Support multiple versions in 'task news'
This commit is contained in:
Dustin J. Mitchell
2024-04-15 22:04:16 -04:00
committed by GitHub
parent d243d000eb
commit 4d9bb20bdd
7 changed files with 302 additions and 36 deletions

View File

@@ -31,9 +31,11 @@
#include <Command.h>
#include <CmdConfig.h>
#include <CmdContext.h>
#include <Version.h>
class NewsItem {
public:
Version _version;
bool _major = false;
std::string _title;
std::string _bg_title;
@@ -42,7 +44,16 @@ public:
std::string _update;
std::string _reasoning;
std::string _actions;
void render ();
static std::vector<NewsItem> all();
static void version2_6_0 (std::vector<NewsItem>&);
static void version3_0_0 (std::vector<NewsItem>&);
private:
NewsItem (
Version,
bool,
const std::string&,
const std::string& = "",
@@ -52,7 +63,6 @@ public:
const std::string& = "",
const std::string& = ""
);
void render ();
};
class CmdNews : public Command
@@ -60,7 +70,6 @@ class CmdNews : public Command
public:
CmdNews ();
int execute (std::string&);
void version2_6_0 (std::vector<NewsItem>&);
};
#endif