Repository navigation
Add license key requirements - #293
Conversation
Adds license key validity to the HF. Replace environment variables to literal values declared in the hf.config.js file. Now, for all modules the global values are available. Moves testConfig.ts file to global config which Jest provides.
wojciechczerniak
left a comment
There was a problem hiding this comment.
Good job! 🏆
Is there something we can do about the date format displayed to the end-user? I think we have just the date part displayed in HoT?
"The license key for HyperFormula expired on 2019-01-11T00:00:00.000Z, and is not valid for the installed version."|
|
||
| export class BuildEngineFactory { | ||
| private static buildEngine(config: Config, sheets: Sheets = {}, stats: Statistics = config.useStats ? new Statistics() : new EmptyStatistics()): EngineState { | ||
| checkLicenseKeyValidity(config.licenseKey) |
There was a problem hiding this comment.
We will need the info if the license is invalid to use it in Interpreter so we can display #LIC! error as a result of formula evaluation or any other way to indicate wrong license string in case the HF is used server-side and the console.log may not be available.
| checkLicenseKeyValidity(config.licenseKey) | |
| config.licenseValid = checkLicenseKeyValidity(config.licenseKey) |
The field should be private and marked as @internal for internal use only.
There was a problem hiding this comment.
I forgot about that. Good catch! I'll do that.
Adds "licenseKeyValidityState" property to the Config class. The property holds a state about checking the license key validity. The property is protected from modification by defining its getter only. Additionally, the commit adds TS definition for the licenseKey checker helper and the result of the expired message is formatted better.
|
@wojciechczerniak I fixed all mentioned issues.
|
wojciechczerniak
left a comment
There was a problem hiding this comment.
The names licenseKey.ts and _licenseKey.ts are confusing a little bit. licenseKeyHelper.ts and licenseKeyValidator.ts / licenseKeyChecker.ts / licenseKeySchema.ts? Not that important though
LG(reat)TM 👍
After merging the PR I thought that it can be a good idea. I've prepared a separate PR #299 😄 |
Context
Adds license key validity to the HF. Replace environment variables to
literal values declared in the
hf.config.jsfile. Now, for all modules(commons, es, jest - TS) the global values are available.
Moves
testConfig.tsfile to global config which Jest provides.How has this been tested?
The license key to test:
agpl-v3(valid);non-commercial-and-evaluation(valid);d95da-4218c-26e94-18316-4e52e- It will expire at: 12/01/2020 (valid);6a76d-572a4-a2a54-3711f-3a047- It will expire at: 11/01/2020 (valid - the algorithm postpones the message printing by 1 day max);80584-cc272-2e7c4-06f16-4db00- It will expire at: 10/01/2020 (expired);8c6d8-91044-e3cc4-5441a-3ac0a- It will expire at: 10/01/2019 (expired);Currently, develop branch has set the release date to 12/01/2020.
Types of changes
Related issue(s):
Checklist: