diff --git a/gulpfile.js b/gulpfile.js index 5ac527f..27d02a0 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -3,6 +3,8 @@ const del = require('del'); const ts = require('gulp-typescript'); const exec = require('child_process').exec; const sass = require('gulp-sass'); +const fs = require('fs'); +const path = require('path'); sass.compiler = require('node-sass'); let tsSource = ts.createProject('tsconfig.json') @@ -11,19 +13,54 @@ function clean(cb) { cb(); } +function validateConfigSources(cb) { + console.log("Validating source json files..."); + let confBase = "src/assets/conf/"; + let configsToCheck = ["resources-landing-page.json"]; + for (let i = 0, l = configsToCheck.length; i < l; i++) { + let currConfig = configsToCheck[i]; + let configContent = fs.readFileSync(path.join(confBase, currConfig)); + let conf = JSON.parse(configContent.toString()); + let keys = Object.keys(conf); + let fileSpecificRules = validationRules[currConfig]; + for (let j = 0, m = keys.length; j < m; j++) { + let key = keys[i]; + let content = conf[key]; + let rules = fileSpecificRules[key]; + let ruleKeys = Object.keys(rules); + for (let k = 0, n = ruleKeys.length; k < n; k++) { + let rule = ruleKeys[k]; + let ruleValidator = rules[rule]; + for (let x = 0, y = content.length; x < y; x++) { + let renderObj = content[x]; + let ruleSubject = renderObj[rule]; + let validResults = ruleValidator(ruleSubject, currConfig, rule); + if (null !== validResults) { + cb(validResults); + } + } + } + } + } + cb(); +} + function conf() { return src(['src/assets/**/*', '!src/assets/**/*.scss'], {base: 'src/assets'}) .pipe(dest('build/assets/')); } -function style(){ +function style() { return src('node_modules/bootstrap/dist/css/bootstrap.css') .pipe(dest('build/assets/pages/styles/')); } -function scss(){ - return src('src/assets/pages/styles/*.scss', ) +function scss() { + return src('src/assets/pages/styles/*.scss',) .pipe(sass.sync().on('error', sass.logError)) + .on('error', () => { + process.exit(1) + }) .pipe(dest('build/assets/pages/styles/')); } @@ -39,7 +76,10 @@ function pkg() { function typescript() { return tsSource.src() - .pipe(tsSource()).js + .pipe(tsSource()).on('error', () => { + process.exit(1) + }) + .js .pipe(dest('build/util/')); } @@ -53,8 +93,26 @@ function dependencies(cb) { }); } + +let stringLengthRule = function (str, fileName, rulename) { + let maxLen = 124; + if (str.length > maxLen) { + return Error(`Content too long in ${fileName}:${rulename}! Expected maximum of ${maxLen} characters, got ${str.length} "${str}"`) + } +} + +let validationRules = { + "resources-landing-page.json": { + "grid-container": { + "description": stringLengthRule + } + } + +} + + exports.clean = clean; -exports.default = series(conf, style, scss, root, pkg, typescript, dependencies); +exports.default = series(validateConfigSources, conf, style, scss, root, pkg, typescript, dependencies); -exports.runFast = series(conf, style, scss, root, pkg) \ No newline at end of file +exports.runFast = series(validateConfigSources, conf, style, scss, root, pkg) \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 19539b4..a72d8ad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4582,9 +4582,9 @@ } }, "mocha": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.2.0.tgz", - "integrity": "sha512-lEWEMq2LMfNJMKeuEwb5UELi+OgFDollXaytR5ggQcHpzG3NP/R7rvixAvF+9/lLsTWhWG+4yD2M70GsM06nxw==", + "version": "8.2.1", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.2.1.tgz", + "integrity": "sha512-cuLBVfyFfFqbNR0uUKbDGXKGk+UDFe6aR4os78XIrMQpZl/nv7JYHcvP5MFIAb374b2zFXsdgEGwmzMtP0Xg8w==", "dev": true, "requires": { "@ungap/promise-all-settled": "1.1.2", @@ -7844,9 +7844,9 @@ }, "dependencies": { "camelcase": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.1.0.tgz", - "integrity": "sha512-WCMml9ivU60+8rEJgELlFp1gxFcEGxwYleE3bziHEDeqsqAWGHdimB7beBFGjLzVNgPGyDsfgXLQEYMpmIFnVQ==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", + "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", "dev": true }, "decamelize": { diff --git a/package.json b/package.json index 3a9982d..5324dba 100644 --- a/package.json +++ b/package.json @@ -56,8 +56,8 @@ "gulp-typescript": "^6.0.0-alpha.1", "gulp-exec": "^5.0.0", "del": "^6.0.0", - "chai": "^4.2.0", "electron-mocha": "^9.3.1", + "chai": "^4.2.0", "nyc": "^15.1.0", "ts-node": "^9.0.0", "check-for-leaks": "^1.2.1" diff --git a/src/assets/pages/help-about.html b/src/assets/pages/help-about.html new file mode 100644 index 0000000..fe06018 --- /dev/null +++ b/src/assets/pages/help-about.html @@ -0,0 +1,32 @@ + + + + + + Help Menu: About the Resource Center + + + + + + + + +
+

About the Resource Center

+

+

You rely on a vast amount of resources to do your job. How can you keep track of them all? +

+

Explore the Resource Center. +

+

From accounting to workflows, this desktop application can help you find the resources you need.

+

+

Back to main

+
+ + + + + + + \ No newline at end of file diff --git a/src/assets/pages/help-categories.html b/src/assets/pages/help-categories.html new file mode 100644 index 0000000..b1493a7 --- /dev/null +++ b/src/assets/pages/help-categories.html @@ -0,0 +1,32 @@ + + + + + + Help Menu: Categories + + + + + + + + +
+

Categories

+

+

What are categories? +

+

JDSfaulkner has so many helpful resources available to employees that it might be overwhelming to see them all at once. That's why this application categorizes them into topics.

+

+

Click a category in the main workspace to expand a section and view all the related resources. With a section expanded, you can navigate more easily using the scrollbar on the right or by clicking a category heading in the left sidebar.

+

+

Back to main

+
+ + + + + + + \ No newline at end of file diff --git a/src/assets/pages/help-resources.html b/src/assets/pages/help-resources.html new file mode 100644 index 0000000..c9e1b0e --- /dev/null +++ b/src/assets/pages/help-resources.html @@ -0,0 +1,32 @@ + + + + + + Help Menu: Resources + + + + + + + + +
+

Resources

+

+

We get it. Resources can mean many things to many people.

+

+

When it comes to the Resource Center, resources are digital files, storage systems, software and websites that help you do your job.

+

+

The company's top managers decided to create the Resource Center to help new and existing employees become oriented and familiar with the many tools available to them.

+

+

Back to main

+
+ + + + + + + \ No newline at end of file diff --git a/src/assets/pages/help-searches.html b/src/assets/pages/help-searches.html new file mode 100644 index 0000000..e09b987 --- /dev/null +++ b/src/assets/pages/help-searches.html @@ -0,0 +1,32 @@ + + + + + + Help Menu: Searches + + + + + + + + +
+

Searches

+

+

Save time. Simplify your searches. +

+

Finding resources that meet your criteria is easy when you use the search tool. At the top of your workspace, type a search term in the rounded search bar. Click "enter" on your keyboard, or click the search icon, and matching results populate your workspace.

+

+

Voilá — helpful resources at your fingertips.

+

Back to main

+
+ + + + + + + + \ No newline at end of file diff --git a/src/assets/pages/help-updates.html b/src/assets/pages/help-updates.html new file mode 100644 index 0000000..efdbe72 --- /dev/null +++ b/src/assets/pages/help-updates.html @@ -0,0 +1,32 @@ + + + + + + Help Menu: Updates + + + + + + + + +
+

Updates

+

+

Occasionally, you might see computer code moving across your screen for a few seconds after opening the Resource Center.

+

+

What is going on? An update.

+

+

Developers send updates periodically to improve functionality. If you have a reliable internet connection, updates should occur quickly and automatically.

+

Back to main

+
+ + + + + + + + \ No newline at end of file diff --git a/src/assets/pages/resources-landing-page.html b/src/assets/pages/resources-landing-page.html index 5448ab3..92d1dc0 100644 --- a/src/assets/pages/resources-landing-page.html +++ b/src/assets/pages/resources-landing-page.html @@ -23,9 +23,43 @@  Resource Center + + Theme diff --git a/src/assets/pages/styles/resources-landing-page.scss b/src/assets/pages/styles/resources-landing-page.scss index 0628be9..633e8b8 100644 --- a/src/assets/pages/styles/resources-landing-page.scss +++ b/src/assets/pages/styles/resources-landing-page.scss @@ -14,7 +14,6 @@ html { .main { background-color: secondary; - color: navbartext; } body { @@ -147,13 +146,16 @@ body { padding-top: 3rem; padding-bottom: 3rem; background: primary; - color: footertext; } .footer p { margin-bottom: .25rem; margin-left: 25rem; padding-left: 25rem; - color: footertext; } +.helpcontent { + margin: 3rem; + padding: 3rem; + font-size: 11px; +} diff --git a/src/assets/pages/styles/theme-base.scss b/src/assets/pages/styles/theme-base.scss index 035b10d..40763e8 100644 --- a/src/assets/pages/styles/theme-base.scss +++ b/src/assets/pages/styles/theme-base.scss @@ -50,7 +50,7 @@ $enable-rounded: true !default; } html { - height: 100% + height: 100%; } body { @@ -124,5 +124,35 @@ body { outline: none; } +.fixed-top { + outline: none; +} + +.helpdropdown .dropdown-menu { + background-color: map-get($theme-colors, menudropdownfill); + font-size: 15px; + margin-bottom: 9px; + color: map-get($theme-colors, activetextaccordion) !important; + box-shadow: -1 1 3 1 #cccccc; +} + +.feedbackdropdown .dropdown-menu { + background-color: map-get($theme-colors, menudropdownfill); + font-size: 15px; + margin-bottom: 9 px; + color: map-get($theme-colors, activetextaccordion); + box-shadow: -1 1 3 1 #cccccc; +} + +#DropdownFeedbackEmail { + background-color: map-get($theme-colors, feedbackmessagefill); + border: 1px solid; + border-color: map-get($theme-colors, feedbackmessageborder); + color: map-get($theme-colors, searchfont); +} + +.form-control::-webkit-input-placeholder { + color: map-get($theme-colors, feedbackmessagehint) !important; +} diff --git a/src/assets/pages/styles/theme-dark.scss b/src/assets/pages/styles/theme-dark.scss index 4421cab..0b0236e 100644 --- a/src/assets/pages/styles/theme-dark.scss +++ b/src/assets/pages/styles/theme-dark.scss @@ -31,7 +31,15 @@ $theme-colors: ( "activetextaccordion": #9d9d9d, "inactiveborderaccordion": #180606, "activeborderaccordion": rgba(26, 26, 26, 0), - "footertext": #7b7b7b, + "footertext": #787572, + "chevronup": #787572, + "chevrondown": #9d9d9d, + "menudropdownfill": #4e4e56, + "feedbacksubmitbutton": #0c218c, + "feedbacksubmitbuttontext": #d9d2d2, + "feedbackmessagefill": #3c3c42, + "feedbackmessageborder": #363434, + "feedbackmessagehint": #787572, ); .theme-button{ diff --git a/src/assets/pages/styles/theme-light.scss b/src/assets/pages/styles/theme-light.scss index 2c145ba..45e4046 100644 --- a/src/assets/pages/styles/theme-light.scss +++ b/src/assets/pages/styles/theme-light.scss @@ -1,10 +1,10 @@ $theme-colors: ( - "primary": #ffffff, - "secondary": #e5e5e5, + "primary": #fdfdfd, + "secondary": #dcdcdc, "success": #0B031C, - "info": #ffffff, + "info": #f9f9f9, "warning": #700000, - "navbartext": #434344, + "navbartext": #121213, "navbartextfeather": #323233, "navbartextactive": #212122, "inactivecard": #ffffff, @@ -14,7 +14,7 @@ $theme-colors: ( "activecardfont": #e1e4e8, "searchhint": #c0c2c6, "searchfont": #2c2c2c, - "sidebarfill": #f6f6f6, + "sidebarfill": #efefef, "sidebartext": #545455, "searchbuttonfill": #f6f6f6, "searchicon": #545455, @@ -25,7 +25,7 @@ $theme-colors: ( "paragraphtextcolor": #434344, "paragraphtextcolorhover": #ffffff, "themebuttonoutline": #434344, - "inactiveaccordion": #f6f6f6, + "inactiveaccordion": #efefef, "activeaccordion": #ffffff, "inactivetextaccordion": #434344, "activetextaccordion": #434344, @@ -33,6 +33,14 @@ $theme-colors: ( "inactiveborderaccordion": #c0c2c6, "activeborderaccordion": rgba(26, 26, 26, 0), "footertext": #434344, + "chevronup": #434344, + "chevrondown": #434344, + "menudropdownfill": #ffffff, + "feedbacksubmitbutton": #099f4a, + "feedbacksubmitbuttontext": #ffffff, + "feedbackmessagefill": #efefef, + "feedbackmessageborder": #dbdbdb, + "feedbackmessagehint": #c0c2c6, ); .theme-button{ diff --git a/tests/default-test.ts b/tests/default-test.ts index e56fbff..df60da6 100644 --- a/tests/default-test.ts +++ b/tests/default-test.ts @@ -1,8 +1,9 @@ const assert = require('assert'); describe('default', ()=>{ - it('default-test', ()=>{ - let res = 5+2; - assert.strictEqual(res, 7); - }) -}) \ No newline at end of file + it('snippit', snippit) +}) + +function snippit(){ + console.log("okay") +} \ No newline at end of file