Skip to content

Commit

Permalink
b/325373481 Migrate UI to MDC (#283)
Browse files Browse the repository at this point in the history
* Migrate from MDCLite to [MDC](https://github.com/material-components/material-components-web/tree/master)
* Replace stepper UI and show available entitlements on first screen
  • Loading branch information
jpassing authored Feb 21, 2024
1 parent 59d9b17 commit 99a9232
Show file tree
Hide file tree
Showing 15 changed files with 1,146 additions and 1,021 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ runConfigurations/
.metals
.vscode
.idea/
.vs/
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public class ApiResource {

private URL createActivationRequestUrl(
UriInfo uriInfo,
ProjectId projectId,
String activationToken
) throws MalformedURLException {
Preconditions.checkNotNull(uriInfo);
Expand All @@ -99,10 +100,15 @@ private URL createActivationRequestUrl(
//
// Obfuscate the token to avoid such false-flagging.
//
// NB. We include the project ID to force the approver into
// the right scope. This isn't strictly necessary, but it
// improves user experience.
//
return this.runtimeEnvironment
.createAbsoluteUriBuilder(uriInfo)
.path("/")
.queryParam("activation", TokenObfuscator.encode(activationToken))
.queryParam("projectId", projectId.id())
.build()
.toURL();
}
Expand Down Expand Up @@ -511,7 +517,10 @@ public ActivationStatusResponse requestActivation(
// Notify reviewers, listeners.
//
for (var service : this.notificationServices) {
var activationRequestUrl = createActivationRequestUrl(uriInfo, activationToken.token());
var activationRequestUrl = createActivationRequestUrl(
uriInfo,
projectId,
activationToken.token());
service.sendNotification(new RequestActivationNotification(
projectId,
activationRequest,
Expand Down Expand Up @@ -671,12 +680,13 @@ public ActivationStatusResponse approveActivationRequest(
//
// Notify listeners.
//
var projectId = ProjectId.fromFullResourceName(roleBinding.fullResourceName());
for (var service : this.notificationServices) {
service.sendNotification(new ActivationApprovedNotification(
ProjectId.fromFullResourceName(roleBinding.fullResourceName()),
projectId,
activation,
iapPrincipal.getId(),
createActivationRequestUrl(uriInfo, activationToken)));
createActivationRequestUrl(uriInfo, projectId, activationToken)));
}

//
Expand Down

This file was deleted.

This file was deleted.

1,438 changes: 593 additions & 845 deletions sources/src/main/resources/META-INF/resources/index.html

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

This file was deleted.

This file was deleted.

6 changes: 3 additions & 3 deletions sources/src/main/resources/META-INF/resources/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ class DebugModel extends Model {
warnings: ["This is a simulated result"],
roles: Array.from({ length: setting }, (e, i) => ({
roleBinding: {
id: "//project-1:roles/simulated-role-" + i,
fullResourceName: "//simulated",
role: "roles/simulated-role-" + i
},
activationType: activationTypes[i % activationTypes.length],
Expand Down Expand Up @@ -417,7 +417,7 @@ class DebugModel extends Model {
projectId,
justification,
roles,
"ACTIVATED",
"ACTIVE",
true,
activationTimeout);
}
Expand Down Expand Up @@ -474,7 +474,7 @@ class DebugModel extends Model {
"project-1",
"a justification",
["roles/role-1"],
"ACTIVATED",
"ACTIVE",
false,
60);
}
Expand Down
2 changes: 0 additions & 2 deletions sources/src/main/resources/META-INF/resources/stepper.min.css

This file was deleted.

This file was deleted.

Loading

0 comments on commit 99a9232

Please sign in to comment.