Add push cert status to change screen

Add a status icon next to the uploader with a check/warning/X
depending on the push cert status. Include messages in the title on
hover. If the uploader is the same as the change owner, place the
status icon next to the owner.

PushCertificateInfo and GpgKeyInfo are moved to gerrit-gwtui-common so
they can be referenced from ChangeInfo.

The new question mark icon is the help-browser icon from the
public-domain Tango collection:
http://tango.freedesktop.org/Tango_Icon_Library

Change-Id: Iec666c668342b00fd92609dd28feb082d5a560a8
This commit is contained in:
Dave Borowitz
2015-09-15 11:06:47 -04:00
parent 8f10d51c0d
commit ed1523094d
11 changed files with 143 additions and 17 deletions

View File

@@ -311,6 +311,9 @@ public class ChangeInfo extends JavaScriptObject {
public final native boolean hasFetch() /*-{ return this.hasOwnProperty('fetch') }-*/;
public final native NativeMap<FetchInfo> fetch() /*-{ return this.fetch; }-*/;
public final native boolean hasPushCertificate() /*-{ return this.hasOwnProperty('push_certificate'); }-*/;
public final native PushCertificateInfo pushCertificate() /*-{ return this.push_certificate; }-*/;
public static void sortRevisionInfoByNumber(JsArray<RevisionInfo> list) {
final int editParent = findEditParent(list);
Collections.sort(Natives.asList(list), new Comparator<RevisionInfo>() {

View File

@@ -0,0 +1,45 @@
// Copyright (C) 2015 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.client.info;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArrayString;
public class GpgKeyInfo extends JavaScriptObject {
public enum Status {
BAD, OK, TRUSTED;
}
public final native String id() /*-{ return this.id; }-*/;
public final native String fingerprint() /*-{ return this.fingerprint; }-*/;
public final native JsArrayString userIds() /*-{ return this.user_ids; }-*/;
public final native String key() /*-{ return this.key; }-*/;
private final native String statusRaw() /*-{ return this.status; }-*/;
public final Status status() {
String s = statusRaw();
if (s == null) {
return null;
}
return Status.valueOf(s);
}
public final native boolean hasProblems()
/*-{ return this.hasOwnProperty('problems'); }-*/;
public final native JsArrayString problems() /*-{ return this.problems; }-*/;
protected GpgKeyInfo() {
}
}

View File

@@ -0,0 +1,25 @@
// Copyright (C) 2015 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.client.info;
import com.google.gwt.core.client.JavaScriptObject;
public class PushCertificateInfo extends JavaScriptObject {
public final native String certificate() /*-{ return this.certificate; }-*/;
public final native GpgKeyInfo key() /*-{ return this.key; }-*/;
protected PushCertificateInfo() {
}
}