-
Notifications
You must be signed in to change notification settings - Fork 2
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
New interface to generate/modify Private/Public key for SIDP Users only #1689 #1736
Conversation
ffee5b8
to
8bf87a9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UI
PublicKeysGrid
should not be shown when it's empty.PublicKeysGrid
should be inside the input view with the "Add key" button, otherwise it sits too tight to the "Change password" button above.- The "Authentication" section started to look messy, with password and public keys together. Maybe we can separate them with different labels (like Roles and Groups in the Roles & Groups section below)?
- If we have "Public Keys" as the label inside input view then we won't need another label (which you made bold). Also change button caption to simply say "Add"
this.appendChild(publicKeysHeader); | ||
|
||
|
||
const header = this.createDivEl('public-keys-row', 'rowgroup'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a different style for the header element, to be able to apply different styling to the header row.
const header = this.createDivEl('public-keys-row', 'rowgroup'); | ||
header.appendChild(this.createDivEl('public-keys-cell', 'columnheader', i18n('field.userKeys.grid.kid.column'))); | ||
header.appendChild(this.createDivEl('public-keys-cell', 'columnheader', i18n('field.userKeys.grid.label.column'))); | ||
header.appendChild(this.createDivEl('public-keys-cell', 'columnheader', i18n('field.userKeys.grid.creationTime.column'))); | ||
header.appendChild(this.createDivEl('public-keys-cell', 'columnheader', i18n('field.userKeys.grid.actions.column'))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs some refactoring:
- Add separate methods that create a regular cell and a header cell:
private createCell(html: string, role?: string): DivEl {
return this.createDivEl('public-keys-cell', role || 'cell', html);
}
private createHeaderCell(html: string): DivEl {
return this.createCell(html, 'columnheader');
}
- Create separate methods for creating a header and a regular row:
private createHeader(): DivEl {
const header = this.createDivEl('public-keys-header', 'gridheader');
header.appendChild(this.createHeaderCell(i18n('field.userKeys.grid.kid.column')));
header.appendChild(this.createHeaderCell(i18n('field.userKeys.grid.label.column')));
header.appendChild(this.createHeaderCell(i18n('field.userKeys.grid.creationTime.column')));
header.appendChild(this.createHeaderCell(i18n('field.userKeys.grid.actions.column')));
return header;
}
private createDataRow(publicKey: PublicKey): DivEl {
const row = this.createDivEl('public-keys-row', 'rowgroup');
row.appendChild(this.createCell(publicKey.getKid()));
row.appendChild(this.createCell(publicKey.getLabel()));
const creationTime = new Date(Date.parse(publicKey.getCreationTime()));
row.appendChild(this.createCell(DateHelper.formatDateTime(creationTime)));
return row;
}
- Change your code to call these new methods when needed.
constructor(className ?: string) { | ||
super(className || ''); | ||
|
||
this.getEl().addClass('public-keys-grid'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this CSS class to a private static property
private static GRID_CSS_STYLE = 'public-keys-grid';
then use it as a prefix for class names of other UI elements:
this.getEl().addClass(PublicKeysGrid.GRID_CSS_STYLE);
...
this.createDivEl(`${PublicKeysGrid.GRID_CSS_STYLE}-header`, 'gridheader');
....
this.createDivEl(`${PublicKeysGrid.GRID_CSS_STYLE}-header-cell`, 'headercell');
etc
In this dialog:
|
8978726
to
efc0931
Compare
efc0931
to
f60c89b
Compare
f60c89b
to
f7896a4
Compare
No description provided.