Skip to content

Commit

Permalink
Merge pull request #93 from ansibleguy76/release/v4.0.14
Browse files Browse the repository at this point in the history
v4.0.14 into main
  • Loading branch information
ansibleguy76 authored Aug 3, 2023
2 parents c137e78 + e1b3998 commit 3ccf599
Show file tree
Hide file tree
Showing 334 changed files with 19,260 additions and 26,626 deletions.
20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [4.0.14] - 2023-08-03

### Added

- New documentation, the website ansibleforms is now generated on github pages using jekyll

### Changed

- Removed environment variable from reference guide (find it in documentation now)

### Fixed

- Scheme creation bug fixed
- Typos in help
- Vue2 bug number fields fall back to emptry string when empty. fixed to set to undefined.

## [4.0.13] - 2023-07-24

### Added
Expand Down Expand Up @@ -543,7 +559,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Allow change password for current local user
- Start tracking versions

[Unreleased]: https://github.com/ansibleguy76/ansibleforms/compare/4.0.13...HEAD
[Unreleased]: https://github.com/ansibleguy76/ansibleforms/compare/4.0.14...HEAD

[4.0.14]: https://github.com/ansibleguy76/ansibleforms/compare/4.0.13...4.0.14

[4.0.13]: https://github.com/ansibleguy76/ansibleforms/compare/4.0.12...4.0.13

Expand Down
4 changes: 2 additions & 2 deletions app_versions.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ext.version_code = 40013
ext.version_name = "4.0.13"
ext.version_code = 40014
ext.version_name = "4.0.14"
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ansible_forms_vue",
"version": "4.0.13",
"version": "4.0.14",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/BulmaNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<a class="navbar-item" href="https://www.ansibleforms.com/" target="_blank">
<span class="icon"><font-awesome-icon icon="globe" /></span><span>Documentation</span>
</a>
<router-link class="navbar-item" to="/reference-guide/environment-variable">
<router-link class="navbar-item" to="/reference-guide/forms">
<span class="icon"><font-awesome-icon icon="question-circle" /></span><span>Reference Guide</span>
</router-link>
<a class="navbar-item" href="/api-docs" target="_blank">
Expand Down
36 changes: 24 additions & 12 deletions client/src/components/Form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,13 @@
this.setFieldStatus(fieldname,undefined)
Vue.set(this.form,fieldname,this.defaults[fieldname])
},
// reset number field (bug vue2)
setFieldUndefined(fieldname){
// reset to undefined
Vue.set(this.form,fieldname,undefined);
this.evaluateDynamicFields(fieldname);
this.generateJsonOutput() // refresh json output
},
// reset all fields
resetFields(){
this.currentForm.fields.forEach((item, i) => {
Expand All @@ -898,6 +905,7 @@
// allowing dynamic defaults
getDefaultValue(fieldname,value){
if(value!=undefined){
var _value = this.replacePlaceholderInString(value).value
// console.log(`${fieldname} -> ${value} -> ${_value}`)
if(this.fieldOptions[fieldname].evalDefault){
Expand Down Expand Up @@ -1208,8 +1216,9 @@
}
}
foundfield=foundfield.replace(/\[[0-9]*\]/,'') // make xxx[y] => xxx
fieldvalue = ""
fieldvalue = undefined
targetflag = undefined
// console.log(foundfield + "("+fieldvalue+")" + " -> targetflag = " + targetflag)
// mark the field as a dependent field
if(foundfield in ref.form){ // does field xxx exist in our form ?
// if the field exists
Expand Down Expand Up @@ -1240,7 +1249,6 @@
targetflag = "fixed"
}
}
// if the variable is viable and not being changed, replace it
// console.log(foundfield + "("+fieldvalue+")" + " -> targetflag = " + targetflag)
// console.log(foundfield + " -> targetflag = " + targetflag)
Expand All @@ -1251,8 +1259,8 @@
fieldvalue=ref.stringifyValue(fieldvalue)
// console.log("replacing placeholder")
value=value.replace(foundmatch,fieldvalue); // replace the placeholder with the value
// console.log("replaced")
// console.log(item.name + " -> " + value)
// console.log("replaced")
// console.log(foundmatch + " -> " + fieldvalue)
}else{
value=undefined // cannot evaluate yet
}
Expand Down Expand Up @@ -1600,7 +1608,11 @@
ref.resetField(item.name)
}
}
// correct vue2 bug => emtpy number => "" => set to undefined instead => avoid having form errors
// fixed in 4.0.14
if(item.type=="number" && ref.form[item.name]===""){
ref.setFieldUndefined(item.name)
}
// see if it is time to refresh
if(item.refresh && typeof item.refresh=="string"){
var match=item.refresh.match(/([0-9]+)s/g)
Expand All @@ -1611,7 +1623,6 @@
}
}
}
} // end loop function
) // end field loop
if(hasUnevaluatedFields){
Expand Down Expand Up @@ -2059,14 +2070,15 @@
if(item.type=="table" && ref.defaults[item.name]){
Vue.set(ref.form,item.name,ref.externalData[item.name])
}
}else if(["checkbox"].includes(item.type)){
Vue.set(ref.form,item.name,ref.externalData[item.name]??this.getDefaultValue(item.name,item.default)??false)
}else{
Vue.set(ref.form,item.name,ref.externalData[item.name]??this.getDefaultValue(item.name,item.default)??"")
}
}else {
var fallbackvalue=undefined
if(item.type=="checkbox"){
fallbackvalue=false
}
Vue.set(ref.form,item.name,ref.externalData[item.name]??this.getDefaultValue(item.name,item.default)??fallbackvalue)
}
Vue.set(ref.visibility,item.name,true)
});
// initiate the constants
if(ref.constants){
Object.keys(ref.constants).forEach((item)=>{
Expand Down
2 changes: 1 addition & 1 deletion client/src/views/ReferenceGuide.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div class="tabs is-medium is-boxed">
<ul>
<template v-for="h in help">
<li :key="h.name" :class="{'is-active':links.includes(h.link)}">
<li v-if="!h.hideFromReferenceGuide" :key="h.name" :class="{'is-active':links.includes(h.link)}">
<router-link :to="'/reference-guide/'+h.link">
<span class="icon is-small"><font-awesome-icon :icon="h.icon.split(',')" /></span>
<span>{{ h.name }}</span>
Expand Down
89 changes: 89 additions & 0 deletions docs/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"env": {
"browser": true
},
"parserOptions": {
"ecmaVersion": 5
},
"globals": {
"_": false,
"Backbone": false,
"jQuery": false,
"JSON": false,
"wp": false
},
"rules": {
"array-bracket-spacing": [ 2, "always" ],
"brace-style": [ 2, "1tbs" ],
"camelcase": 2,
"comma-dangle": 0,
"comma-spacing": 2,
"comma-style": 2,
"computed-property-spacing": [ 2, "always" ],
"constructor-super": 2,
"consistent-return": 0,
"curly": 2,
"dot-notation": 2,
"eqeqeq": [ 2, "allow-null" ],
"eol-last": 2,
"func-call-spacing": 2,
"jsx-quotes": [ 2, "prefer-double" ],
"key-spacing": 0,
"keyword-spacing": 2,
"max-len": [ 2, { "code": 100 } ],
"new-cap": [ 2, { "capIsNew": false, "newIsCap": true } ],
"no-cond-assign": 2,
"no-const-assign": 2,
"no-console": 2,
"no-debugger": 2,
"no-dupe-args": 2,
"no-dupe-keys": 2,
"no-duplicate-case": 2,
"no-else-return": 2,
"no-empty": [ 2, { "allowEmptyCatch": true } ],
"no-extra-semi": 2,
"no-fallthrough": 0,
"no-lonely-if": 2,
"no-mixed-requires": 0,
"no-multiple-empty-lines": [ 2, { "max": 1 } ],
"no-negated-in-lhs": 2,
"no-nested-ternary": 2,
"no-new": 2,
"no-process-exit": 2,
"no-redeclare": 2,
"no-spaced-func": 2,
"no-trailing-spaces": 2,
"no-undef": 2,
"no-underscore-dangle": 0,
"no-unreachable": 2,
"no-unused-vars": 2,
"no-use-before-define": [ 2, "nofunc" ],
"object-curly-spacing": [ 2, "always" ],
"one-var": 0,
"operator-linebreak": [ 2, "after", { "overrides": {
"?": "before",
":": "before"
} } ],
"padded-blocks": [ 2, "never" ],
"prefer-const": 2,
"quote-props": [ 2, "as-needed", { "keywords": true } ],
"quotes": [ 2, "single", "avoid-escape" ],
"semi": 2,
"semi-spacing": 2,
"space-before-blocks": [ 2, "always" ],
"space-before-function-paren": [ 2, "never" ],
"space-in-parens": [ 2, "always" ],
"space-infix-ops": [ 2, { "int32Hint": false } ],
"space-unary-ops": [ 2, {
"overrides": {
"!": true
}
} ],
"strict": [ 2, "function" ],
"yoda": 0,
"no-shadow": 0,
"indent": [ "error", "tab", { "SwitchCase": 1, "VariableDeclarator": 2 } ],
"no-mixed-spaces-and-tabs": 0,
"no-multi-spaces": [ "error", { "exceptions": { "Property": true, "VariableDeclarator": true, "ImportDeclaration": true } } ]
}
}
15 changes: 15 additions & 0 deletions docs/.gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
image: ruby:2.3

variables:
JEKYLL_ENV: production

pages:
stage: deploy
script:
- gem install jekyll
- jekyll build -d public/
artifacts:
paths:
- public
only:
- master
1 change: 1 addition & 0 deletions docs/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ErrorDocument 404 /404/index.html
26 changes: 22 additions & 4 deletions docs/404.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
---
title: "Page Not Found"
search: exclude
---
# Page settings
layout: error-404
title: 404 - Page not found
permalink: /404.html

Sorry, but the page you were trying to view does not exist. Try searching for it or looking at the URL to see if it looks correct.
# Content settings
page_content:
title: <strong>404 /</strong> Automation Overload...
message: |
<span class="fw-bold">PLAY</span> [Searching page] ********************************************<br>
<br>
<span class="fw-bold">TASK</span> [Gathering facts] *******************************************<br>
<span class="has-text-danger">failed: [localhost]<br>
<br>
Darn, we really couldn't find that page.<br>
I think we might have lost it...Oh nooo.</span><br>
<br>
<span class="fw-bold">PLAY RECAP</span> *******************************************************<br>
localhost : <span class="is-success">OK=0</span>&nbsp;&nbsp;&nbsp;&nbsp;<span class="is-warning">changed=0</span>&nbsp;&nbsp;&nbsp;<span class="is-danger">unreachable=1</span><br>
<br>
Playbook finished with exit code 404
<br>
---
1 change: 1 addition & 0 deletions docs/CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ansibleforms.com
14 changes: 0 additions & 14 deletions docs/Dockerfile

This file was deleted.

7 changes: 0 additions & 7 deletions docs/Gemfile

This file was deleted.

Loading

0 comments on commit 3ccf599

Please sign in to comment.