Skip to content

Conversation

@wavezhang
Copy link

@wavezhang wavezhang commented Feb 1, 2018

Add a "Promote Build" menu to build drawer, when click it will toggle environments list display as follows. The deploy environment list is obtain from a modified droneServer api, see this. Deploy parameters are not supported currently.
image

)}
</li>
<li>
{build.status === "success" ? (
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use STATUS_SUCCESS const from src/shared/constants/status.js here?

</button>
):null }
</li>
{build.status === "success" && this.state.togglePromote ? (
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use STATUS_SUCCESS const from src/shared/constants/status.js here?

):null }
</li>
{build.status === "success" && this.state.togglePromote ? (
<ul class="sub">{envs.map(function(env) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this item belong to previous section "Promote" maybe we should move it inside the <li>
tag?

</button>
)}
</li>
<li>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This <li> item will be empty when status =! success, maybe we should move in condition?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, you are right

client
.restartBuild(owner, repo, build, { fork: true, event: "deployment", "deploy_to": env })
.then(result => {
displayMessage(tree, "Successfully promote your build");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we should have multiple deployment, maybe we should specify the deployment target in message? something like:

displayMessage(tree, `Successfully promote your build to target ${env}`);

displayMessage(tree, "Successfully promote your build");
})
.catch(() => {
displayMessage(tree, "Failed to promote your build");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as before

@mavimo
Copy link

mavimo commented Feb 8, 2018

@wavezhang nice work! I added some suggestion, let me know what do you think about it.

@wavezhang
Copy link
Author

wavezhang commented Feb 23, 2018

@mavimo I have update my commits following your suggestion

<span>Promote Build</span>
</button>
):null }
{build.status === STATUS_SUCCESS && this.state.togglePromote ? (
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are mixing TAB & spaces, coding standards used in drone-ui need to use tab, can you run linter (execute yarn lint command from project root) and fix errors? Thx!


ul {
li {
margin: 0px;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be not needed since we already set it on li element at line 102.

ul {
li {
margin: 0px;
padding: 0px;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why we are going to remove padding here, having padding to simulate indentation should help to understand "tree" structure

Copy link
Author

@wavezhang wavezhang Feb 24, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remove the indentation to algin all icons and text,which i think is more pretty. This is a expandable view, so the "tree" structure is obvious.

without indentation
image

with indentation
image

<input type="text" value={this.state.customEnv}
onClick={event => event.stopPropagation()}
onChange={this.updateCustomEnv.bind(this)}
placeholder="input and then click play icon">
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Placeholder description should indicate the content of field and is not intended to be a explanation on how to use it, text should be something like: Deployment target (eg: staging)

@mavimo
Copy link

mavimo commented Feb 23, 2018

@wavezhang some more note (PS: let me know if there is that I can do to help on finalize this PR, I'll like it and your work on it 🥇)

@mavimo
Copy link

mavimo commented Feb 25, 2018

@wavezhang I see also that the notification message do not include the deployment target (comment 1 and comment 2), there is some reason why we should not include it?

@bradrydzewski
Copy link
Contributor

bradrydzewski commented Feb 25, 2018

I think the general consensus is that we need to be moving things out of the drawer menu (and work toward eliminating the drawer) as opposed to adding more functionality to the drawer. The intention was for the promote button to take the user to a new page, or maybe event some sort of modal.

I just want to set expectations that I'm not currently focused on the UI at the moment, so it may take some time for new UI features to be merged.

@ylecuyer
Copy link

ylecuyer commented Feb 26, 2018

@bradrydzewski if you don't want to dedicate time to it, there is enough people in the drone team on github to delegate the UI support to

@nsiniakevich
Copy link

@bradrydzewski is that possible to delegate UI merges to someone else in drone team like @ylecuyer said?

@izumskee
Copy link

izumskee commented Mar 28, 2018

It's very useful feature. Hope it will be added soon.

@Wagos
Copy link

Wagos commented Apr 6, 2018

This is really important feature for us. @bradrydzewski When are you going to add this? Is there a way to help you to add this feature as soon as possible?

@smxsm
Copy link

smxsm commented Apr 6, 2018

@bradrydzewski Promoting builds is also not available via the build API, right? That would be super-awesome, too!

@mavimo
Copy link

mavimo commented Apr 15, 2018

@wavezhang there are some issue on src/screens/repo/screens/build/menu.js, linter indicate:

  126:30  error    Insert `⏎↹↹↹↹↹↹↹↹↹↹`                                                                                                                                                                                                                                                                                          prettier/prettier
  127:11  error    Replace `return·<li><button·onClick={handlePromote.bind(this,·env)}><PlayIcon·/><span>{env}</span></button>` with `↹return·(⏎↹↹↹↹↹↹↹↹↹↹↹↹<li>⏎↹↹↹↹↹↹↹↹↹↹↹↹↹<button·onClick={handlePromote.bind(this,·env)}>⏎↹↹↹↹↹↹↹↹↹↹↹↹↹↹<PlayIcon·/>⏎↹↹↹↹↹↹↹↹↹↹↹↹↹↹<span>{env}</span>⏎↹↹↹↹↹↹↹↹↹↹↹↹↹</button>⏎↹↹↹↹↹↹↹↹↹↹↹↹`  prettier/prettier
  127:18  error    Missing "key" prop for element in iterator                                                                                                                                                                                                                                                                    react/jsx-key
  128:10  error    Insert `↹↹);⏎↹↹↹↹↹↹↹↹↹↹`                                                                                                                                                                                                                                                                                      prettier/prettier
  129:1   error    Replace `↹↹↹↹↹↹↹↹↹<li><button·onClick={handlePromote.bind(this,·this.state.customEnv)}><PlayIcon` with `↹↹↹↹↹↹↹↹↹↹<li>⏎↹↹↹↹↹↹↹↹↹↹↹<button⏎↹↹↹↹↹↹↹↹↹↹↹↹onClick={handlePromote.bind(this,·this.state.customEnv)}⏎↹↹↹↹↹↹↹↹↹↹↹>⏎↹↹↹↹↹↹↹↹↹↹↹↹<PlayIcon·`                                                           prettier/prettier
  130:1   error    Replace `↹↹↹↹↹↹↹↹↹↹<input·type="text"·` with `↹↹↹↹↹↹↹↹↹↹↹↹<input⏎↹↹↹↹↹↹↹↹↹↹↹↹↹type="text"⏎↹↹↹↹↹↹↹↹↹↹↹↹↹`                                                                                                                                                                                                      prettier/prettier
  133:56  error    Replace `·` with `⏎↹↹↹↹↹↹↹↹↹↹↹↹`                                                                                                                                                                                                                                                                              prettier/prettier
  134:1   error    Replace `↹↹↹↹↹↹↹↹↹</button>` with `↹↹↹↹↹↹↹↹↹↹↹</button>⏎↹↹↹↹↹↹↹↹↹↹`                                                                                                                                                                                                                                           prettier/prettier
  135:9   error    Replace `</ul>)·:·null·` with `↹</ul>⏎↹↹↹↹↹↹↹↹)·:·null`                                                                                                                                                                                                                                                       prettier/prettier

I fixed it on mavimo@e0a06cf please report fixes here, thx :)

@mavimo
Copy link

mavimo commented Apr 15, 2018

Hi @wavezhang @ylecuyer @nsiniakevich @izumskee @Wagos @smxsm,
since we have possibility to use drone with custom UI specifying the DRONE_WWW env that contains the folder with the UI we can integrate our UI changes very easily using a container with only UI exposed as volume.

I create a PoC that include:

  • #191: Add promote build to build menu
  • #195: Add ability to page build list
  • #200: Allow to set events when adding new secret

This can be tested using the following config (supposing to use docker-compose if you use kubernetes or some other orchestration tool please you should use a similar approach):

version: '3'

services:
  drone-server:
    image: drone/drone:0.8.5
    environment:
      - DRONE_WWW=/drone-ui
    volumes:
      - drone-ui:/drone-ui

  drone-ui:
    image: mavimo/drone-ui:next
    volumes:
      - drone-ui:/drone-ui

volumes:
  drone-ui:

NB: the PoC I do is only intended useful for testing purpose, identify issue or improvement needed before PRs are included in mainstream, I do not suppose to do maintenance or have a fork that diverge from official UI, so if you chose to use it please report your feedback on issues on order to make it more usable :)

@wavezhang
Copy link
Author

@mavimo lint errors fixed :)

@hnykda
Copy link

hnykda commented Dec 20, 2018

May I know what's the status of this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants