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

Masked input #4759

Merged
merged 15 commits into from
Jun 14, 2018
Merged

Masked input #4759

merged 15 commits into from
Jun 14, 2018

Conversation

madalynrose
Copy link
Contributor

@madalynrose madalynrose commented Jun 13, 2018

Fixes #4422
screen shot 2018-06-13 at 4 03 32 pm
screen shot 2018-06-13 at 4 03 45 pm
screen shot 2018-06-13 at 4 03 57 pm
screen shot 2018-06-13 at 4 04 21 pm

@meirish meirish requested review from a team June 13, 2018 20:01
alisdair
alisdair previously approved these changes Jun 14, 2018
Copy link

@alisdair alisdair left a comment

Choose a reason for hiding this comment

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

This is nice! 👍 I left some minor code style notes inline, nothing important.

One other thing: it looks like the integration test doesn't cover the displayOnly configuration of the component, which is how it seems to be used in the app. Would it be reasonable to add tests for that, too?

didRender(){
this._super(...arguments);
autosize.update(this.element.querySelector('textarea'));
},

Choose a reason for hiding this comment

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

The didRender hook is also fired on initial render. Maybe you want didUpdate here? Component lifecycle hooks docs here

onChange(){},
updateValue(e){
this.set('value', e.target.value);
this.get('onChange')();

Choose a reason for hiding this comment

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

This could be written as this.onChange(), which might be a little easier to read.

wrap="off"
placeholder="value"
onfocus={{action "setFocus" true}}
onblur={{action "setFocus" false}}

Choose a reason for hiding this comment

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

I think these could be {{action (mut setFocus) true}} and …false}}, removing the need for the action.

onfocus={{action "setFocus" true}}
onblur={{action "setFocus" false}}
onkeydown={{action onKeyDown}}
onchange={{action updateValue}}

Choose a reason for hiding this comment

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

I think the action helpers here are unneeded, as these attributes are already bound closure actions.

enterText: fillable('[data-test-textarea]'),
toggleMasked: clickable('[data-test-button]'),
focus: focusable('[data-test-textarea]'),
blur: blurrable('[data-test-textarea]')

Choose a reason for hiding this comment

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

I did not know that focusable and blurrable were ecpo functions! Super useful.

andThen(() => {
assert.equal(enginesPage.rows().count, numEngines + 3, 'new engines were added to the page');
});
});

Choose a reason for hiding this comment

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

This test seems unrelated to the rest of the changes. Am I missing something?

Copy link
Contributor

Choose a reason for hiding this comment

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

🤔 something odd going on - this is already in master https://github.com/hashicorp/vault/commits/master/ui/tests/acceptance/console-test.js

Maybe just needs a rebase? Or was rebased oddly? Uncertain at this moment.

@joshuaogle
Copy link
Contributor

Can we make the toggle icon flush with the left column header? In secrets it's just the column header that is flush, but in other places the non-secret text might look odd with it indented

image

.masked-input.masked .masked-value,
.masked-input.masked .masked-input-toggle {
color: $grey-light;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Some strange indenting going on in this file

Choose a reason for hiding this comment

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

Hard tabs! 🙀

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Default editor settings! Sorryyyyyy fix'd

position: absolute;
height: auto;
top: $size-6/4;
bottom: $size-6/4;
Copy link
Contributor

Choose a reason for hiding this comment

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

Looking forward to the new spacing variables :\

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah 😬

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.

4 participants