Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #24276: An errors occurs within technique editor resource manager when we create a folder that has the same name than another parent folder #5422

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ upload api dir file =
listDirectory : String -> List String -> Cmd Msg
listDirectory api dir =
let
currentFolder = case List.Extra.last dir of
Just d -> d
Nothing -> "/"

body = Json.Encode.object [
("action", Json.Encode.string "list")
Expand All @@ -67,7 +64,7 @@ listDirectory api dir =
api
(Http.jsonBody body )
(Decode.at ["result"] (Decode.list fileDecoder))
(EnvMsg << (LsGotten currentFolder))
(EnvMsg << (LsGotten (getDirPath dir)))

fileDecoder : Decode.Decoder FileMeta
fileDecoder =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import FileManager.Util exposing (..)

handleEnvMsg : EnvMsg -> Model -> (Model, Cmd Msg)
handleEnvMsg msg model = case msg of
Open () -> ({ model | open = True }, Cmd.none)
Open () -> ({ model | open = True, dir = ["/"] }, Cmd.none)
Close -> ({ model | open = False, selected = [] }, close [])
Accept -> ({ model | open = False, selected = [] }, close <| reverse <| map ((++) (getDirPath model.dir) << .name) model.selected)
MouseDown maybe pos1 ctrl ->
Expand Down Expand Up @@ -86,7 +86,7 @@ handleEnvMsg msg model = case msg of

GetLs dir ->
let
newDir = if List.member dir model.dir then takeWhile (\d -> d /= dir) model.dir else List.append model.dir [dir]
newDir = String.split "/" dir
in
({ model | dir = newDir, files = [], load = True }, listDirectory model.api newDir)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,14 @@ filesTree model =
( fs.childs
|> List.map (\f ->
let
parents = fs.parents
path = List.append fs.parents [fs.name, f] |> getDirPath
in
li [ ]
[ a [ onClick <| EnvMsg <| GetLsTree (List.append fs.parents [fs.name, f] ) ]
[ folderIcon 20
, text f
]
, if List.member f openedDir then listFolders f else text ""
, if List.member path openedDir then listFolders path else text ""
]
)
)
Expand Down Expand Up @@ -238,7 +238,7 @@ renderFile { api, thumbnailsUrl, dir, selected, clipboardDir, clipboardFiles } i
, title file.name
, onMouseDown <| (\x y -> EnvMsg <| MouseDown (Just file) x y)
, onMouseUp <| EnvMsg << (MouseUp <| Just file)
, onDoubleClick <| if file.type_ == "dir" then EnvMsg <| GetLs file.name else Download
, onDoubleClick <| if file.type_ == "dir" then EnvMsg <| GetLs (getDirPath (List.append dir [ file.name] )) else Download
]
[ renderThumb thumbnailsUrl api (getDirPath dir) file
, div [ class "fm-name" ] [ text file.name ]
Expand All @@ -253,7 +253,7 @@ renderFileList { api, thumbnailsUrl, dir, selected, clipboardDir, clipboardFiles
, title file.name
, onMouseDown <| (\x y -> EnvMsg <| MouseDown (Just file) x y)
, onMouseUp <| EnvMsg << (MouseUp <| Just file)
, onDoubleClick <| if file.type_ == "dir" then EnvMsg <| (GetLs file.name) else Download
, onDoubleClick <| if file.type_ == "dir" then EnvMsg <| (GetLs (getDirPath (List.append dir [ file.name] ))) else Download
]
[ td[]
[ div[]
Expand Down