Skip to content

Revealable text fields, both expanding and masking #21

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Revealable text fields, both expanding and masking #21

wants to merge 1 commit into from

Conversation

stefwalter
Copy link
Contributor

Certain fields in the details pane must be ellipsized and then
expand themselves when clicked on. The ellipsizing should be
driven by the width of the field, not the number of characters.

Certain fields in the details pane should be masked as a courtesy,
such as password environment variables. Note that this does not
substitute for real security such as use of kubernetes secrets,
instead of environment variables.

Both ellipsized and masked fields are revealed in full when clicked on.

This patch includes an implementation of this behavior.

Some parts of this behavior are CSS driven, and an example CSS
file is included.

@stefwalter
Copy link
Contributor Author

Password screenshots. First masked MYSQL_ROOT_PASSWORD:

screenshot from 2015-06-02 12-33-19

And by clicking to unmask MYSQL_ROOT_PASSWORD:

screenshot from 2015-06-02 12-33-20

@@ -0,0 +1,46 @@
.revealable {

Choose a reason for hiding this comment

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

Is there standard material CSS for this (i.e. are these canonical structural CSS types)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This CSS is meant to be agnostic to the toolkit.

I'm not sure there is any such thing as canonical CSS types, unless you're talking in the context of things like bootstrap. I couldn't find these concepts in bootstrap.

Choose a reason for hiding this comment

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

Just wanted to be sure.

@stefwalter
Copy link
Contributor Author

I'd be happy to integrate the revealable text into openshift-origin if this generally looks good.

templateUrl: 'views/containers.html'
templateUrl: 'views/containers.html',
link: function($scope, element, attrs) {
$scope.shouldMask = function(name) {

Choose a reason for hiding this comment

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

Shouldn't this also include the previous collapse check for length?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmmm, the masking is just about masking something with bullets (ie: a password), not about the length. So if I'm understanding your comment right, then no, it shouldn't.

@liggitt liggitt self-assigned this Jun 2, 2015
@stefwalter
Copy link
Contributor Author

Rebased.

stefwalter added a commit to stefwalter/cockpit that referenced this pull request Jun 30, 2015
stefwalter added a commit to cockpit-project/cockpit that referenced this pull request Jun 30, 2015
@jwforres
Copy link
Contributor

@stefwalter is this still something you want to get merged?

@liggitt
Copy link
Contributor

liggitt commented Jul 23, 2015

Likely so, I just hadn't convinced myself I liked the overflow detection yet. I also felt like the masked and revealable bits were a little tangled, but hadn't dug into them yet.

@liggitt liggitt assigned jwforres and unassigned liggitt Aug 10, 2015
Certain fields in the details pane must be ellipsized and then
expand themselves when clicked on. The ellipsizing should be
driven by the width of the field, not the number of characters.

Certain fields in the details pane should be masked as a courtesy,
such as password environment variables. Note that this does not
substitute for real security such as use of kubernetes secrets,
instead of environment variables.

Both ellipsized and masked fields are revealed in full when clicked on.

This patch includes an implementation of this behavior.

Some parts of this behavior are CSS driven, and an example CSS
file is included.

Fixes #16
Closes #21
@stefwalter
Copy link
Contributor Author

Rebased. Would be happy for more review. The CSS styles for masking and revealable text are tricky to get right across browsers. So in the end tackling them together was the way I approached this.

@@ -0,0 +1,46 @@
.revealable {
white-space: nowrap !important;
Copy link
Contributor

Choose a reason for hiding this comment

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

why is the !important needed, I prefer to avoid using that when possible

@jwforres
Copy link
Contributor

As far as this new css, since it is purely functional and platform agnostic I think we should put it into an object-describer.css, produce a dist/object-describer.css in the build (simple copy for now, but lets do it in case we ever want to introduce additional build steps, like switching to sass or less for the source files) and add it to the main list in the bower.json

@jwforres
Copy link
Contributor

@stefwalter see my previous comment about the CSS, do you have time to address that this week? if not @spadgett could possibly work on it and do a PR to your branch as this will help resolve a couple open issues we have

@stefwalter
Copy link
Contributor Author

@spadgett @jwforress I had hoped to get to this, but it'll probably be a few days yet. If you would like to take it over, please do. Otherwise I'll come back around to it when I get a chance.

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