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

improve ux when installing or updating projects #202

Merged
merged 2 commits into from
Mar 30, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions cmd/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,12 @@ func updateProjectRun(args []string) {
for _, p := range candidates {
fmt.Printf("Updating: %s ... ", p.Name)
if p.IsManaged() {
err = p.Update(true)
CheckErrorNonFatal(err, "done.")
updated, err := p.Update(true)
if updated == false {
fmt.Println("already up-to-date")
} else {
CheckErrorNonFatal(err, "done.")
}
} else {
// assume zip
if entry := SearchCatalogs(catalogs, p.Name); entry != nil {
Expand Down
19 changes: 15 additions & 4 deletions cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func init() {
serverCmd.Flags().StringVar(&appDir, "app", "app/", "`path` to maiden web app directory")
serverCmd.Flags().StringVar(&docDir, "doc", "doc/", "`path` to matron lua docs")

// allow config file values to be overriden by command line
// allow config file values to be overridden by command line
viper.BindPFlag("dust.path", serverCmd.Flags().Lookup("data"))
viper.BindPFlag("web.path", serverCmd.Flags().Lookup("app"))
viper.BindPFlag("doc.path", serverCmd.Flags().Lookup("doc"))
Expand Down Expand Up @@ -717,9 +717,12 @@ func (s *server) getProjectHandler(ctx *gin.Context) {
//
_, exists := ctx.GetQuery("update")
if exists {
updated := true
// ignore the value for now but it could be a commit or version in the future?
if p.IsManaged() {
if err := p.Update(true); err != nil {
logger.Debugf("updating managed project: %s", p.Name)
if updated, err = p.Update(true); err != nil {
logger.Debugf("update failed: %s, e=%s", p.Name, err)
ctx.JSON(http.StatusInternalServerError, gin.H{
"error": fmt.Sprintf("update failed: %s", err),
})
Expand All @@ -737,7 +740,7 @@ func (s *server) getProjectHandler(ctx *gin.Context) {

// assume zip
if entry := SearchCatalogs(catalogs, p.Name); entry != nil {
// TODO: only remove if download succeds?
// TODO: only remove if download succeeds?
os.RemoveAll(p.Root)
if err = dust.Install(projectDir, p.Name, entry.URL, entry); err != nil {
ctx.JSON(http.StatusInternalServerError, gin.H{
Expand All @@ -750,6 +753,14 @@ func (s *server) getProjectHandler(ctx *gin.Context) {
return
}
}

logger.Debugf("update ok: %s %s", p.Name, updated)
// report update results
ctx.JSON(http.StatusOK, gin.H{
"name": p.Name,
"updated": updated,
})
return
}

// MAINT: this is redudant with the 'projects' handler but could be expanded to include more detail in the future
Expand Down Expand Up @@ -793,7 +804,7 @@ func (s *server) deleteProjectHandler(ctx *gin.Context) {
func (s *server) installProjectHandler(ctx *gin.Context) {
srcURL, set := ctx.GetQuery("url")
if !set {
ctx.JSON(http.StatusBadRequest, gin.H{"error": fmt.Sprintf("url query arg missing")})
ctx.JSON(http.StatusBadRequest, gin.H{"error": "url query arg missing"})
return
}

Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ require (
github.com/coreos/go-systemd v0.0.0-20181031085051-9002847aa142
github.com/gin-contrib/sse v0.0.0-20170109093832-22d885f9ecc7 // indirect
github.com/gin-gonic/gin v0.0.0-20180417025440-6ad7b9c9d382
github.com/go-git/go-git/v5 v5.2.0 // indirect
github.com/godbus/dbus v0.0.0-20181101234600-2ff6f7ffd60f // indirect
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf // indirect
github.com/hashicorp/go-getter v1.5.1
Expand Down
40 changes: 40 additions & 0 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/dust/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module github.com/monome/maiden/pkg/dust

go 1.12

require gopkg.in/src-d/go-git.v4 v4.10.0
require github.com/go-git/go-git/v5 v5.2.0
74 changes: 37 additions & 37 deletions pkg/dust/go.sum
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7 h1:uSoVVbwJiQipAclBbw+8quDsfcvFjOpI5iCf4p/cqCs=
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs=
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/emirpasic/gods v1.9.0 h1:rUF4PuzEjMChMiNsVjdI+SyLu7rEqpQ5reNFnhC7oFo=
github.com/emirpasic/gods v1.9.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o=
github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o=
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E=
github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0=
github.com/go-git/go-git-fixtures/v4 v4.0.2-0.20200613231340-f56387b50c12/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw=
github.com/go-git/go-git/v5 v5.2.0 h1:YPBLG/3UK1we1ohRkncLjaXWLW+HKp5QNM/jTli2JgI=
github.com/go-git/go-git/v5 v5.2.0/go.mod h1:kh02eMX+wdqqxgNMEyq8YgwlIOsDOa9homkUq1PoTMs=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/kevinburke/ssh_config v0.0.0-20180830205328-81db2a75821e h1:RgQk53JHp/Cjunrr1WlsXSZpqXn+uREuHvUVcK82CV8=
github.com/kevinburke/ssh_config v0.0.0-20180830205328-81db2a75821e/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/mitchellh/go-homedir v1.0.0 h1:vKb8ShqSby24Yrqr/yDYkuFz8d0WUjys40rvnGC8aR0=
github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/pelletier/go-buffruneio v0.2.0 h1:U4t4R6YkofJ5xHm3dJzuRpPZ0mr5MMCoAWooScCR7aA=
github.com/pelletier/go-buffruneio v0.2.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/src-d/gcfg v1.4.0 h1:xXbNR5AlLSA315x2UO+fTSSAXCDf+Ar38/6oyGbDKQ4=
github.com/src-d/gcfg v1.4.0/go.mod h1:p/UMsR43ujA89BJY9duynAwIpvqEujIH/jFlfL7jWoI=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/xanzy/ssh-agent v0.2.0 h1:Adglfbi5p9Z0BmK2oKU9nTG+zKfniSfnaMYB+ULd+Ro=
github.com/xanzy/ssh-agent v0.2.0/go.mod h1:0NyE30eGUDliuLEHJgYte/zncp2zdTStcOnWhgSqHD8=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793 h1:u+LnwYTOOW7Ukr/fppxEb1Nwz0AtPflrblfvUudpo+I=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd h1:nTDtHvHSdCn1m6ITfMRqtOd/9+7a3s8RBNOZ3eYZzJA=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/sys v0.0.0-20180903190138-2b024373dcd9/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4=
golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/src-d/go-billy.v4 v4.2.1 h1:omN5CrMrMcQ+4I8bJ0wEhOBPanIRWzFC953IiXKdYzo=
gopkg.in/src-d/go-billy.v4 v4.2.1/go.mod h1:tm33zBoOwxjYHZIE+OV8bxTWFMJLrconzFMd38aARFk=
gopkg.in/src-d/go-git-fixtures.v3 v3.1.1 h1:XWW/s5W18RaJpmo1l0IYGqXKuJITWRFuA45iOf1dKJs=
gopkg.in/src-d/go-git-fixtures.v3 v3.1.1/go.mod h1:dLBcvytrw/TYZsNTWCnkNF2DSIlzWYqTe3rJR56Ac7g=
gopkg.in/src-d/go-git.v4 v4.10.0 h1:NWjTJTQnk8UpIGlssuefyDZ6JruEjo5s88vm88uASbw=
gopkg.in/src-d/go-git.v4 v4.10.0/go.mod h1:Vtut8izDyrM8BUVQnzJ+YvmNcem2J89EmfZYCkLokZk=
gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
27 changes: 19 additions & 8 deletions pkg/dust/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"strings"
"time"

"gopkg.in/src-d/go-git.v4"
"github.com/go-git/go-git/v5"

"github.com/monome/maiden/pkg/catalog"
)
Expand Down Expand Up @@ -358,17 +358,18 @@ func (p *Project) UpdateMetaData(md *MetaData) {
md.Updated = time.Now()
}

// Update pulls down any changes for the project if it is managed via git
func (p *Project) Update(force bool) error {
// Update pulls down any changes for the project if it is managed via git,
// returns true if the project was updated
func (p *Project) Update(force bool) (bool, error) {
// https://github.com/src-d/go-git/blob/master/_examples/pull/main.go
r, err := git.PlainOpen(p.Root)
if err != nil {
return err
return false, err
}

w, err := r.Worktree()
if err != nil {
return err
return false, err
}

// lame, pull removes unknown files so the .project metadata file is removed.
Expand All @@ -380,12 +381,22 @@ func (p *Project) Update(force bool) error {
RemoteName: "origin",
// Force: force,
})
updated := true
if err != nil {
return err
if err == git.NoErrAlreadyUpToDate {
updated = false
err = nil
} else {
return false, err
}
}

if updated {
p.UpdateMetaData(md)
err = writeMetaData(md, p.metaDataPath())
}

p.UpdateMetaData(md)
return writeMetaData(md, p.metaDataPath())
return updated, err
}

/*
Expand Down
2 changes: 2 additions & 0 deletions tool/release.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -e

# quick and dirty release script
REL_DIR=./dist/maiden

Expand Down
4 changes: 4 additions & 0 deletions web/src/project-activity.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@
.project-activity-update-modal-section-header {
font-weight: bolder;
font-size: 16px;
}

.project-activity-update-modal-section-message {
font-style: italic;
}
61 changes: 47 additions & 14 deletions web/src/project-activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import { orderResultsByProjectName } from './model/project-actions';
import './project-activity.css';
import ModalProgress from './modal-progress';

const SYSTEM_RESET_RECOMMENDATION = 'Run SYSTEM > RESET to ensure engine changes take effect';

class ProjectActivity extends Component {
componentDidMount() {
this.props.getCatalogSummary(summary => {
Expand Down Expand Up @@ -46,7 +48,7 @@ class ProjectActivity extends Component {
},
failure => {
console.log('refresh-catalog failed', failure);
this.props.showModal(this.errorModalContent(
this.props.showModal(this.informModalContent(
`Refreshing catalog failed`,
failure.error));
});
Expand Down Expand Up @@ -145,11 +147,15 @@ class ProjectActivity extends Component {
// refresh project list
this.props.getProjectSummary();
this.props.refreshCodeDir();
this.props.hideModal();
this.props.showModal(
this.informModalContent(`Installed project: "${name}"`,
SYSTEM_RESET_RECOMMENDATION,
)
);
},
failure => {
console.log('install-project failed', failure);
this.props.showModal(this.errorModalContent(
this.props.showModal(this.informModalContent(
`Installing project "${name}" failed`,
failure.error));
});
Expand All @@ -159,11 +165,11 @@ class ProjectActivity extends Component {
this.props.hideModal();
};

errorModalContent = (message, failure) => {
informModalContent = (message, supporting) => {
const content = (
<ModalContent
message={message}
supporting={failure}
supporting={supporting}
buttonAction={this.modalDismiss}
confirmOnly={true}
/>
Expand All @@ -182,7 +188,21 @@ class ProjectActivity extends Component {
<tbody>
{successArr.map(e => (<tr><td>{e.name}</td></tr>))}
</tbody>
</table><br /><br />
</table>
<br />
<span className='supporting'>{SYSTEM_RESET_RECOMMENDATION}</span>
<br /><br />
</div>
);
} else {
success = (
<div>
<span className='project-activity-update-modal-section-header'>No updates</span>
<br /><br />
<span className='project-activity-update-modal-section-message'>
The latest versions are already installed
</span>
<br /><br />
</div>
);
}
Expand Down Expand Up @@ -224,7 +244,7 @@ class ProjectActivity extends Component {
// completion callback
(successArr, failureArr) => {
if (successArr) {
successArr = successArr.sort(orderResultsByProjectName);
successArr = successArr.sort(orderResultsByProjectName).filter(response => response.successResult.updated);
}
if (failureArr) {
failureArr = failureArr.sort(orderResultsByProjectName);
Expand All @@ -237,7 +257,7 @@ class ProjectActivity extends Component {
this.props.showModal(
<ModalContent
message='Updating all projects'
supporting="please wait..."
supporting="Please wait..."
buttonAction={this.modalDismiss}
confirmOnly={true}
/>
Expand Down Expand Up @@ -266,14 +286,27 @@ class ProjectActivity extends Component {
const modalCompletion = choice => {
if (choice === 'ok') {
this.props.updateProject(url, name,
_ => {
this.props.getProjectSummary();
this.props.refreshCodeDir();
this.props.hideModal();
success => {
console.log('updated', success);
if (success.updated) {
this.props.getProjectSummary();
this.props.refreshCodeDir();
this.props.showModal(
this.informModalContent(`Updated project: "${name}"`,
SYSTEM_RESET_RECOMMENDATION,
)
);
} else {
this.props.showModal(
this.informModalContent('No updates',
`The latest version of "${name}" is already installed`,
)
);
}
},
failure => {
console.log('update-project failed', failure);
this.props.showModal(this.errorModalContent(
this.props.showModal(this.informModalContent(
`Updating project "${name}" failed`,
failure.error));
});
Expand Down Expand Up @@ -308,7 +341,7 @@ class ProjectActivity extends Component {
},
failure => {
console.log('remove-project failed', failure);
this.props.showModal(this.errorModalContent(
this.props.showModal(this.informModalContent(
`Removing project "${name}" failed`,
failure.error));
});
Expand Down