DIRACGrid / WebAppDIRAC

DIRAC Web front-end application
GNU General Public License v3.0
8 stars 40 forks source link

[5.0] Token Manager web application update #729

Closed bertrandrigaud closed 1 year ago

bertrandrigaud commented 1 year ago

PR for displaying Token informations (such as proxymanager) in web application

BEGINRELEASENOTES

CHANGE: Display user access and refresh tokens with details (right click pop up window)

ENDRELEASENOTES

fstagni commented 1 year ago

Thank you for your first contribution to DIRAC. 2 things:

  1. I would suggest you to install pre-commit in your (conda? mamba?) env: https://github.com/DIRACGrid/DIRAC#code-quality
  2. the "Commit Message Check" is a test to verify that the commit message contains decent explanation : https://github.com/DIRACGrid/WebAppDIRAC/blob/integration/.github/workflows/semantic.yml . I see you already got the "feat:", just add a space...
bertrandrigaud commented 1 year ago

Hello,

Pre-commit seems to work properly when I commit from my local branch but "Basic tests / pre-commit" is failing here. Can you help me passing this step please? (Error message is not clear to me)

Concerning column names (AT and RT), I started with full names as it is in ProxyManager app but this leads to large columns. As this app is mostly viewed by admins, I thought AT and RT could be easily understood. What do you think?

fstagni commented 1 year ago

Does your pre-commit include also prettier, for the JS code?

Other than that, I think you can solve everything doing:

black src/WebAppDIRAC/WebApp/handler/TokenManagerHandler.py

and for JS you can follow instructions in https://prettier.io/docs/en/index.html

of apply by hand the following diff:

diff --git a/src/WebAppDIRAC/WebApp/static/DIRAC/TokenManager/classes/TokenManager.js b/src/WebAppDIRAC/WebApp/static/DIRAC/TokenManager/classes/TokenManager.js
index 8e36b53..01381d8 100644
--- a/src/WebAppDIRAC/WebApp/static/DIRAC/TokenManager/classes/TokenManager.js
+++ b/src/WebAppDIRAC/WebApp/static/DIRAC/TokenManager/classes/TokenManager.js
@@ -115,8 +115,6 @@ Ext.define("DIRAC.TokenManager.classes.TokenManager", {
       url: "TokenManager/getSelectionData",
     });

-    
-
     /*
      * -----------------------------------------------------------------------------------------------------------
      * DEFINITION OF THE GRID
@@ -225,7 +223,9 @@ Ext.define("DIRAC.TokenManager.classes.TokenManager", {
           var timeLimit = 30; // 30 days before expiration

           if (secsLeft < timeLimit) {
-            return '<span style="color:red">' + Ext.Date.format(record.data.RefreshTokenExpirationTime, "Y-m-d H:i:s") + " (" + secsLeft + ")" + "</span>";
+            return (
+              '<span style="color:red">' + Ext.Date.format(record.data.RefreshTokenExpirationTime, "Y-m-d H:i:s") + " (" + secsLeft + ")" + "</span>"
+            );
           } else {
             return '<span style="color:green">' + Ext.Date.format(record.data.RefreshTokenExpirationTime, "Y-m-d H:i:s") + "</span>";
           }
chaen commented 1 year ago

Concerning column names (AT and RT), I started with full names as it is in ProxyManager app but this leads to large columns. As this app is mostly viewed by admins, I thought AT and RT could be easily understood. What do you think?

I'd go with full names. It is not uncommon that an expert-but-not-so-expert-on-that-specific-topic ends up debugging something on a topic he is not that familiar with. And having acronyms does not really make that job easy :-)

bertrandrigaud commented 1 year ago

I solved prettier check issue (NodeJS version had to be updated) but I don't know why, I'm back to the commit message check issue. I tried with: feat: update token manager web application feat (TokenManager): update token manager web application feat(TokenManager): update token manager web application but without success :(

Can you help me please?

fstagni commented 1 year ago

I think the "breaking" commit is https://github.com/DIRACGrid/WebAppDIRAC/pull/729/commits/1082188c75161134a71ce760accf2acda07c23bf

bertrandrigaud commented 1 year ago

I'm afraid checks have finally passed! \o/

So I included full name in columns title

DIRACGridBot commented 1 year ago

Sweep summary

Sweep ran in https://github.com/DIRACGrid/WebAppDIRAC/actions/runs/4414343332

Successful: