Skip to content

Commit 9198355

Browse files
Erik Bylundkirre-bylund
authored andcommitted
Mark legacy keys in api key selection list
1 parent d7f9b8e commit 9198355

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

Runtime/Editor/Editor UI/LootLockerAdminExtension.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,7 @@ void APIKeyTemplate(KeyResponse key)
708708
{
709709
Button button = new Button();
710710

711+
bool isLegacyKey = !(key.api_key.StartsWith("prod_") || key.api_key.StartsWith("dev_"));
711712
button.name = key.api_key;
712713

713714
Label keyName = new Label();
@@ -721,15 +722,26 @@ void APIKeyTemplate(KeyResponse key)
721722
button.style.borderRightColor = button.style.borderLeftColor = button.style.borderTopColor = button.style.borderBottomColor = stage;
722723
}
723724

724-
button.AddToClassList("apikey");
725+
if (isLegacyKey)
726+
{
727+
keyName.text = "Legacy key: " + keyName.text;
728+
button.AddToClassList("legacyApikey");
729+
}
730+
else
731+
{
732+
button.AddToClassList("apikey");
733+
}
725734

726735

727736
keyName.AddToClassList("apikeyName");
728737

729738

730739
button.Add(keyName);
731740

732-
button.clickable.clickedWithEventInfo += OnAPIKeySelected;
741+
if (!isLegacyKey)
742+
{
743+
button.clickable.clickedWithEventInfo += OnAPIKeySelected;
744+
}
733745

734746
apiKeyList.Add(button);
735747
}

Runtime/Editor/Editor UI/LootLockerAdminExtension.uss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@
5757
height: 40px;
5858
}
5959

60+
.legacyApikey {
61+
flex-direction: row;
62+
width: 300px;
63+
height: 40px;
64+
background-color: #885555;
65+
opacity: 0.5;
66+
}
67+
6068
.clickable {
6169
cursor: link;
6270
}

0 commit comments

Comments
 (0)