Skip to content

Commit

Permalink
Work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
amousset committed May 18, 2022
1 parent 7799860 commit 6be5baf
Show file tree
Hide file tree
Showing 9 changed files with 126 additions and 24 deletions.
Expand Up @@ -7,7 +7,7 @@ import Set

displayValue : List AgentValue -> String
displayValue value =
String.join "" (List.map displayValueHelper value)
String.concat (List.map displayValueHelper value)

displayValueHelper : AgentValue -> String
displayValueHelper value =
Expand All @@ -17,7 +17,7 @@ displayValueHelper value =

canonify : List AgentValue -> String
canonify value =
String.join "" (List.map canonifyHelper value)
String.concat (List.map canonifyHelper value)

canonifyHelper : AgentValue -> String
canonifyHelper value =
Expand Down Expand Up @@ -75,12 +75,10 @@ parseInnerDollarValue =

parseVariable : Parser AgentValue
parseVariable =
oneOf [
succeed Variable
|. Parser.symbol "${"
|= innerLoop
|. Parser.symbol "}"
]
succeed Variable
|. Parser.symbol "${"
|= innerLoop
|. Parser.symbol "}"

parseAgentValue : Parser AgentValue
parseAgentValue =
Expand Down
Expand Up @@ -357,9 +357,9 @@ update msg model =

ClosePopup callback ->
let
(nm,cmd) = update callback { model | modal = Nothing}
(nm, cmd) = update callback { model | modal = Nothing}
in
(nm , Cmd.batch [ cmd ] )
(nm, cmd)

ResetTechnique ->
let
Expand Down
Expand Up @@ -14,9 +14,10 @@ import MethodElemUtils exposing (..)

appendNodeConditional : Html msg -> Bool -> Element msg -> Element msg
appendNodeConditional e test =
case test of
True -> appendNode e
False -> (\x -> x)
if test then
appendNode e
else
(\x -> x)

showMethodBlock: Model -> TechniqueUiInfo -> MethodBlockUiInfo -> Maybe CallId -> MethodBlock -> Element Msg
showMethodBlock model techniqueUi ui parentId block =
Expand Down
Expand Up @@ -107,7 +107,7 @@ listAllMethodWithMissingParameters methodCallList libMethods =
_ -> (mCall.methodName.value, [ValidState])
) methodCallList
in
Dict.fromList (List.filter (\(_, errors) -> if (List.isEmpty errors) then False else True) errorsOnParamByCallId)
Dict.fromList (List.filter (\(_, errors) -> not (List.isEmpty errors)) errorsOnParamByCallId)

checkBlocksOnError: List MethodElem -> Dict String (ValidationState BlockError)
checkBlocksOnError methodElems =
Expand Down
41 changes: 41 additions & 0 deletions webapp/sources/rudder/rudder-web/src/main/elm/review/elm.json
@@ -0,0 +1,41 @@
{
"type": "application",
"source-directories": [
"src"
],
"elm-version": "0.19.1",
"dependencies": {
"direct": {
"elm/core": "1.0.5",
"elm/json": "1.1.3",
"elm/project-metadata-utils": "1.0.2",
"jfmengels/elm-review": "2.7.2",
"jfmengels/elm-review-code-style": "1.0.0",
"jfmengels/elm-review-common": "1.2.0",
"jfmengels/elm-review-debug": "1.0.6",
"jfmengels/elm-review-documentation": "2.0.1",
"jfmengels/elm-review-simplify": "2.0.15",
"jfmengels/elm-review-unused": "1.1.22",
"stil4m/elm-syntax": "7.2.9"
},
"indirect": {
"elm/html": "1.0.0",
"elm/parser": "1.1.0",
"elm/random": "1.0.0",
"elm/regex": "1.0.0",
"elm/time": "1.0.0",
"elm/virtual-dom": "1.0.3",
"elm-community/list-extra": "8.5.2",
"elm-explorations/test": "1.2.2",
"miniBill/elm-unicode": "1.0.2",
"rtfeldman/elm-hex": "1.0.0",
"stil4m/structured-writer": "1.0.3"
}
},
"test-dependencies": {
"direct": {
"elm-explorations/test": "1.2.2"
},
"indirect": {}
}
}
@@ -0,0 +1,59 @@
module ReviewConfig exposing (config)

{-| Do not rename the ReviewConfig module or the config function, because
`elm-review` will look for these.
To add packages that contain rules, add them to this review project using
`elm install author/packagename`
when inside the directory containing this file.
-}


import Docs.ReviewAtDocs
import NoDebug.Log
import NoDebug.TodoOrToString
import NoExposingEverything
import NoImportingEverything
import NoMissingTypeAnnotation
import NoMissingTypeAnnotationInLetIn
import NoMissingTypeExpose
import NoPrematureLetComputation
import NoSimpleLetBody
import NoUnused.CustomTypeConstructorArgs
import NoUnused.CustomTypeConstructors
import NoUnused.Dependencies
import NoUnused.Exports
import NoUnused.Modules
import NoUnused.Parameters
import NoUnused.Patterns
import NoUnused.Variables
import Review.Rule as Rule exposing (Rule)
import Simplify


config : List Rule
config =
[ Docs.ReviewAtDocs.rule
, NoDebug.Log.rule
, NoDebug.TodoOrToString.rule
|> Rule.ignoreErrorsForDirectories [ "tests/" ]
-- , NoExposingEverything.rule
-- , NoImportingEverything.rule []
-- , NoMissingTypeAnnotation.rule
-- , NoMissingTypeAnnotationInLetIn.rule
-- , NoMissingTypeExpose.rule
-- , NoSimpleLetBody.rule
-- , NoPrematureLetComputation.rule
-- , NoUnused.CustomTypeConstructors.rule []
-- , NoUnused.CustomTypeConstructorArgs.rule
-- , NoUnused.Dependencies.rule
-- , NoUnused.Exports.rule
-- , NoUnused.Modules.rule
-- , NoUnused.Parameters.rule
-- , NoUnused.Patterns.rule
-- , NoUnused.Variables.rule
, Simplify.rule Simplify.defaults
]
@@ -0,0 +1,8 @@
{
"version": 1,
"automatically created by": "elm-review suppress",
"learn more": "elm-review suppress --help",
"suppressions": [
{ "count": 1, "filePath": "sources/ViewMethodsList.elm" }
]
}
Expand Up @@ -52,7 +52,7 @@ getAllComplianceValues complianceDetails =
""
)
in
String.join "" (List.append ["</ul>"] ("<ul>" :: content))
String.concat (List.append ["</ul>"] ("<ul>" :: content))

valSuccessNotApplicable = getValueCompliance complianceDetails.successNotApplicable -- 0
valSuccessAlreadyOK = getValueCompliance complianceDetails.successAlreadyOK -- 0
Expand Down
Expand Up @@ -8,7 +8,6 @@ import DataTypes exposing (..)
import Http exposing (..)
import Init exposing (init)
import View exposing (view)
import Result
import ApiCalls exposing (..)
import ViewUtils exposing (..)
import List.Extra
Expand All @@ -25,13 +24,12 @@ port copy : String -> Cmd msg

subscriptions : Model -> Sub Msg
subscriptions _ =
Sub.batch
[ readUrl ( \(kind,id) -> case kind of

readUrl ( \(kind,id) -> case kind of
"rule" -> OpenRuleDetails (RuleId id) False
"ruleCategory" -> OpenCategoryDetails id False
_ -> Ignore
)
]
)

main =
Browser.element
Expand Down Expand Up @@ -394,10 +392,7 @@ update msg model =
|> List.filter (\id -> id /= "rootRuleCategory")
ui = model.ui
newState =
if(List.length foldedCat == (List.length catIds)) then
False
else
True
not (List.length foldedCat == (List.length catIds))
treeFilters = filters.treeFilters
foldedList = {filters | treeFilters = {treeFilters | folded = if(newState) then catIds else []}}
in
Expand Down

0 comments on commit 6be5baf

Please sign in to comment.