Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/go_modules/src/github.com/robfig/…
Browse files Browse the repository at this point in the history
…cron/v3-3.0.1
  • Loading branch information
Shengwen YU authored Dec 7, 2023
2 parents ea5f292 + f99a619 commit 9112b77
Show file tree
Hide file tree
Showing 21 changed files with 344 additions and 71 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,6 @@

:host::ng-deep {
.filter-input {
width: 210px;
width: 240px;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
(click)="selectAllOrUnselectAll()"
class="btn btn-secondary btn-sm m-0 ml-1">
<span *ngIf="showSelectAll">{{
'SYSTEM_ROBOT.SELECT_ALL' | translate
'SYSTEM_ROBOT.SELECT_ALL_PROJECT' | translate
}}</span>
<span *ngIf="!showSelectAll">{{
'SYSTEM_ROBOT.UNSELECT_ALL' | translate
'SYSTEM_ROBOT.UNSELECT_ALL_PROJECT' | translate
}}</span>
</button>
</clr-dg-action-bar>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,10 @@ <h2 class="custom-h2">{{ 'SYSTEM_ROBOT.ROBOT_ACCOUNT_NAV' | translate }}</h2>
<clr-dg-column>{{
'ROBOT_ACCOUNT.ENABLED_STATE' | translate
}}</clr-dg-column>
<clr-dg-column>System Permissions</clr-dg-column>
<clr-dg-column>{{
<clr-dg-column class="permission-col">{{
'ROBOT_ACCOUNT.SYSTEM_PERMISSIONS' | translate
}}</clr-dg-column>
<clr-dg-column class="projects-col">{{
'SYSTEM_ROBOT.PROJECTS' | translate
}}</clr-dg-column>
<clr-dg-column [clrDgSortBy]="'creation_time'">{{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,10 @@
margin-top: 3px;
}

.projects-col {
min-width: 14rem !important;
}

.permission-col {
min-width: 8rem !important;
}
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
<clr-dg-column>{{
'ROBOT_ACCOUNT.ENABLED_STATE' | translate
}}</clr-dg-column>
<clr-dg-column>{{
<clr-dg-column class="permission-col">{{
'SYSTEM_ROBOT.PERMISSION_COLUMN' | translate
}}</clr-dg-column>
<clr-dg-column [clrDgSortBy]="'creation_time'">{{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@
.icon {
margin-top: 3px;
}

.permission-col {
min-width: 8rem !important;
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,11 @@
<ng-content></ng-content>
</span>
<clr-dropdown-menu
#dropdownMenu
class="dropdown-menu p-1"
clrPosition="{{ dropdownPosition }}"
[style.position]="usedInDatagrid ? 'fixed' : 'absolute'"
[style.transform]="usedInDatagrid ? getTransform() : 'unset'"
*clrIfOpen>
<div>
<button
Expand Down Expand Up @@ -111,7 +114,9 @@
<table class="table table-compact mt-0">
<thead>
<tr>
<th class="left">{{ 'AUDIT_LOG.RESOURCE' | translate }}</th>
<th class="left">
{{ 'AUDIT_LOG.RESOURCE' | translate }}
</th>
<th class="left" *ngFor="let item of candidateActions">
{{ convertKey(item) | translate }}
</th>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@

.select-all-for-dropdown {
margin-bottom: 0.25rem;
width: fit-content;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
AfterViewInit,
Component,
DoCheck,
ElementRef,
EventEmitter,
Input,
Expand All @@ -18,19 +19,12 @@ import {
import { Access } from '../../../../../ng-swagger-gen/models/access';
import { Permission } from '../../../../../ng-swagger-gen/models/permission';

enum Position {
UP = 'left-bottom',
DOWN = 'left-top',
}

@Component({
selector: 'robot-permissions-panel',
templateUrl: './robot-permissions-panel.component.html',
styleUrls: ['./robot-permissions-panel.component.scss'],
})
export class RobotPermissionsPanelComponent
implements AfterViewInit, OnChanges
{
export class RobotPermissionsPanelComponent implements OnChanges, DoCheck {
modalOpen: boolean = false;

@Input()
Expand All @@ -53,29 +47,38 @@ export class RobotPermissionsPanelComponent
@Output()
permissionsModelChange = new EventEmitter<Access[]>();

@ViewChild('dropdown')
clrDropdown: ElementRef;
@ViewChild('dropdownMenu')
dropdownMenu: any;

ngAfterViewInit() {
setTimeout(() => {
if (this.clrDropdown && this.usedInDatagrid) {
if (
this.clrDropdown.nativeElement.getBoundingClientRect().y <
488
) {
this.dropdownPosition = Position.DOWN;
} else {
this.dropdownPosition = Position.UP;
}
}
});
@ViewChild('dropdown')
dropdown: ElementRef;

// to avoid ng check error, getTransform() should always return 'unset' before dropdownMenu appears
dropdownMenuAppeared: boolean = false;
getTransform(): string {
if (
this.dropdownMenuAppeared &&
this.dropdownMenu?.el &&
this.dropdown
) {
const width = this.dropdownMenu.el.nativeElement.offsetWidth;
const height = this.dropdownMenu.el.nativeElement.offsetHeight;
const bcr = this.dropdown.nativeElement.getBoundingClientRect();
return `translateX(${bcr.x - width}px) translateY(${
bcr.y - height / 2
}px)`;
}
return 'unset';
}

ngOnChanges(changes: SimpleChanges) {
if (changes && changes['candidatePermissions']) {
this.initCandidates();
}
}
ngDoCheck() {
this.dropdownMenuAppeared = !!this.dropdownMenu;
}

initCandidates() {
this.candidateActions = [];
Expand Down
13 changes: 8 additions & 5 deletions src/portal/src/i18n/lang/de-de-lang.json
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,8 @@
"BASIC_INFO": "Basic Information",
"SELECT_PERMISSIONS": "Select Permissions",
"SELECT_SYSTEM_PERMISSIONS": "Select System Permissions",
"SELECT_PROJECT_PERMISSIONS": "Select Project Permissions"
"SELECT_PROJECT_PERMISSIONS": "Select Project Permissions",
"SYSTEM_PERMISSIONS": "System Permissions"
},
"WEBHOOK": {
"EDIT_BUTTON": "EDIT",
Expand Down Expand Up @@ -1668,9 +1669,9 @@
"PROJECTS_MODAL_TITLE": "Projekte des Robot-Zugangs",
"PROJECTS_MODAL_SUMMARY": "Diese Projekte können mit dem Robot-Zugang verwaltet werden",
"CREATE_ROBOT": "Systemweiten Robot-Zugang anlegen",
"CREATE_ROBOT_SUMMARY": "Erstelle einen systemweiten Robot-Zugang, der bestimmte Projekte abdeckt. Wähle \"Alle Projekte\", um den Robot-Zugang für alle existierenden und zukünftigen Projekte zuzulassen",
"CREATE_ROBOT_SUMMARY": "Create a system Robot Account that will cover permissions for the system as well as for specific projects",
"EDIT_ROBOT": "Systemweiten Robot-Zugang bearbeiten",
"EDIT_ROBOT_SUMMARY": "Bearbeite einen systemweiten Robot-Zugang. Wähle \"Alle Projekte\", um den Robot-Zugang für alle existierenden und zukünftigen Projekte zuzulassen",
"EDIT_ROBOT_SUMMARY": "Edit a system Robot Account that will cover permissions for the system as well as for specific projects",
"EXPIRATION_TIME": "Ablaufzeit",
"EXPIRATION_TIME_EXPLAIN": "Die Ablaufzeit (in Tagen, ab Erstellung) des Robot-Zugang-Tokens. Um die Ablaufzeit zu deaktiveren \"-1\" eingeben.",
"EXPIRATION_DEFAULT": "Tage(default)",
Expand All @@ -1680,7 +1681,7 @@
"COVER_ALL": "Alle Projekte",
"COVER_ALL_EXPLAIN": "Aktivieren, um den Robot-Zugang für alle existierenden und zukünftigen Projekte zuzulassen",
"COVER_ALL_SUMMARY": "Alle aktuellen und zukünftigen Projekte sind ausgewählt.",
"RESET_PERMISSION": "BERECHTIGUNGEN SETZEN",
"RESET_PERMISSION": "RESET ALL PROJECT PERMISSIONS",
"PERMISSION_COLUMN": "Berechtigungen",
"EXPIRES_AT": "Läuft ab am",
"VIEW_SECRET": "SECRET AKTUALISIEREN",
Expand Down Expand Up @@ -1712,7 +1713,9 @@
"LIST": "Auflisten",
"REPOSITORY": "Repository",
"EXPIRES_IN": "Läuft ab in",
"EXPIRED": "Abgelaufen"
"EXPIRED": "Abgelaufen",
"SELECT_ALL_PROJECT": "SELECT ALL PROJECTS",
"UNSELECT_ALL_PROJECT": "UNSELECT ALL PROJECTS"
},
"ACCESSORY": {
"DELETION_TITLE_ACCESSORY": "Bestätige die Löschung des Anhangs",
Expand Down
13 changes: 8 additions & 5 deletions src/portal/src/i18n/lang/en-us-lang.json
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,8 @@
"BASIC_INFO": "Basic Information",
"SELECT_PERMISSIONS": "Select Permissions",
"SELECT_SYSTEM_PERMISSIONS": "Select System Permissions",
"SELECT_PROJECT_PERMISSIONS": "Select Project Permissions"
"SELECT_PROJECT_PERMISSIONS": "Select Project Permissions",
"SYSTEM_PERMISSIONS": "System Permissions"
},
"WEBHOOK": {
"EDIT_BUTTON": "EDIT",
Expand Down Expand Up @@ -1669,9 +1670,9 @@
"PROJECTS_MODAL_TITLE": "Projects for Robot Account",
"PROJECTS_MODAL_SUMMARY": "There are the projects covered by this robot account.",
"CREATE_ROBOT": "Create System Robot Account",
"CREATE_ROBOT_SUMMARY": "Create a system Robot Account that will cover specific projects. Choose \"Cover all projects\" to be applied to all existing and future projects",
"CREATE_ROBOT_SUMMARY": "Create a system Robot Account that will cover permissions for the system as well as for specific projects",
"EDIT_ROBOT": "Edit System Robot Account",
"EDIT_ROBOT_SUMMARY": "Edit a system Robot Account. Choose \"Cover all projects\" to be applied to all exiting and future projects",
"EDIT_ROBOT_SUMMARY": "Edit a system Robot Account that will cover permissions for the system as well as for specific projects",
"EXPIRATION_TIME": "Expiration time",
"EXPIRATION_TIME_EXPLAIN": "The expiration time(in days and the starting point is creation time) of the token of the robot account. For being never expired, please enter \"-1\".",
"EXPIRATION_DEFAULT": "days(default)",
Expand All @@ -1681,7 +1682,7 @@
"COVER_ALL": "Cover all projects",
"COVER_ALL_EXPLAIN": "Check to be applied to all existing and future projects",
"COVER_ALL_SUMMARY": "All current and future projects selected.",
"RESET_PERMISSION": "RESET PERMISSIONS",
"RESET_PERMISSION": "RESET ALL PROJECT PERMISSIONS",
"PERMISSION_COLUMN": "Permissions",
"EXPIRES_AT": "Expires at",
"VIEW_SECRET": "REFRESH SECRET",
Expand Down Expand Up @@ -1713,7 +1714,9 @@
"LIST": "List",
"REPOSITORY": "Repository",
"EXPIRES_IN": "Expires in",
"EXPIRED": "Expired"
"EXPIRED": "Expired",
"SELECT_ALL_PROJECT": "SELECT ALL PROJECTS",
"UNSELECT_ALL_PROJECT": "UNSELECT ALL PROJECTS"
},
"ACCESSORY": {
"DELETION_TITLE_ACCESSORY": "Confirm Accessory Deletion",
Expand Down
13 changes: 8 additions & 5 deletions src/portal/src/i18n/lang/es-es-lang.json
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,8 @@
"BASIC_INFO": "Basic Information",
"SELECT_PERMISSIONS": "Select Permissions",
"SELECT_SYSTEM_PERMISSIONS": "Select System Permissions",
"SELECT_PROJECT_PERMISSIONS": "Select Project Permissions"
"SELECT_PROJECT_PERMISSIONS": "Select Project Permissions",
"SYSTEM_PERMISSIONS": "System Permissions"
},
"WEBHOOK": {
"EDIT_BUTTON": "EDIT",
Expand Down Expand Up @@ -1665,9 +1666,9 @@
"PROJECTS_MODAL_TITLE": "Projects for Robot Account",
"PROJECTS_MODAL_SUMMARY": "There are the projects covered by this robot account.",
"CREATE_ROBOT": "Create System Robot Account",
"CREATE_ROBOT_SUMMARY": "Create a system Robot Account that will cover specific projects. Choose \"Cover all projects\" to be applied to all existing and future projects",
"CREATE_ROBOT_SUMMARY": "Create a system Robot Account that will cover permissions for the system as well as for specific projects",
"EDIT_ROBOT": "Edit System Robot Account",
"EDIT_ROBOT_SUMMARY": "Edit a system Robot Account. Choose \"Cover all projects\" to be applied to all exiting and future projects",
"EDIT_ROBOT_SUMMARY": "Edit a system Robot Account that will cover permissions for the system as well as for specific projects",
"EXPIRATION_TIME": "Expiration time",
"EXPIRATION_TIME_EXPLAIN": "The expiration time(in days and the starting point is creation time) of the token of the robot account. For being never expired, please enter \"-1\".",
"EXPIRATION_DEFAULT": "days(default)",
Expand All @@ -1677,7 +1678,7 @@
"COVER_ALL": "Cover all projects",
"COVER_ALL_EXPLAIN": "Check to be applied to all existing and future projects",
"COVER_ALL_SUMMARY": "All current and future projects selected.",
"RESET_PERMISSION": "RESET PERMISSIONS",
"RESET_PERMISSION": "RESET ALL PROJECT PERMISSIONS",
"PERMISSION_COLUMN": "Permissions",
"EXPIRES_AT": "Expires at",
"VIEW_SECRET": "REFRESH SECRET",
Expand Down Expand Up @@ -1709,7 +1710,9 @@
"LIST": "List",
"REPOSITORY": "Repository",
"EXPIRES_IN": "Expires in",
"EXPIRED": "Expired"
"EXPIRED": "Expired",
"SELECT_ALL_PROJECT": "SELECT ALL PROJECTS",
"UNSELECT_ALL_PROJECT": "UNSELECT ALL PROJECTS"
},
"ACCESSORY": {
"DELETION_TITLE_ACCESSORY": "Confirm Accessory Deletion",
Expand Down
13 changes: 8 additions & 5 deletions src/portal/src/i18n/lang/fr-fr-lang.json
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,8 @@
"BASIC_INFO": "Basic Information",
"SELECT_PERMISSIONS": "Select Permissions",
"SELECT_SYSTEM_PERMISSIONS": "Select System Permissions",
"SELECT_PROJECT_PERMISSIONS": "Select Project Permissions"
"SELECT_PROJECT_PERMISSIONS": "Select Project Permissions",
"SYSTEM_PERMISSIONS": "System Permissions"
},
"WEBHOOK": {
"EDIT_BUTTON": "Éditer",
Expand Down Expand Up @@ -1640,9 +1641,9 @@
"PROJECTS_MODAL_TITLE": "Projets pour le compte robot",
"PROJECTS_MODAL_SUMMARY": "Voici les projets couverts par ce compte robot.",
"CREATE_ROBOT": "Créer un compte robot Système",
"CREATE_ROBOT_SUMMARY": "Créez un compte robot système qui couvrira des projets spécifiques. Choisissez \"Couvrir tous les projets\" pour appliquer à tous les projets existants et futurs",
"CREATE_ROBOT_SUMMARY": "Create a system Robot Account that will cover permissions for the system as well as for specific projects",
"EDIT_ROBOT": "Éditer un compte robot Système",
"EDIT_ROBOT_SUMMARY": "Éditer un compte robot système. Choisissez \"Couvrir tous les projets\" pour appliquer à tous les projets existants et futurs",
"EDIT_ROBOT_SUMMARY": "Edit a system Robot Account that will cover permissions for the system as well as for specific projects",
"EXPIRATION_TIME": "Date/Heure d'Expiration",
"EXPIRATION_TIME_EXPLAIN": "L'heure d'expiration (en jours, le point de départ est l'heure de création) du jeton du compte robot. Pour ne jamais expirer, entrer \"-1\".",
"EXPIRATION_DEFAULT": "jours (défaut)",
Expand All @@ -1652,7 +1653,7 @@
"COVER_ALL": "Couvrir tous les projets",
"COVER_ALL_EXPLAIN": "Cocher pour appliquer à tous les projets existants et futurs",
"COVER_ALL_SUMMARY": "\"Tous les projets existants et futurs\" sélectionné.",
"RESET_PERMISSION": "Réinitialiser les permissions",
"RESET_PERMISSION": "RESET ALL PROJECT PERMISSIONS",
"PERMISSION_COLUMN": "Permissions",
"EXPIRES_AT": "Expire à",
"VIEW_SECRET": "Actualiser le secret",
Expand Down Expand Up @@ -1684,7 +1685,9 @@
"LIST": "Lister",
"REPOSITORY": "Dépôt",
"EXPIRES_IN": "Expire dans",
"EXPIRED": "Expiré"
"EXPIRED": "Expiré",
"SELECT_ALL_PROJECT": "SELECT ALL PROJECTS",
"UNSELECT_ALL_PROJECT": "UNSELECT ALL PROJECTS"
},
"ACCESSORY": {
"DELETION_TITLE_ACCESSORY": "Confirmer la suppression de l'accessoire",
Expand Down
13 changes: 8 additions & 5 deletions src/portal/src/i18n/lang/pt-br-lang.json
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,8 @@
"BASIC_INFO": "Basic Information",
"SELECT_PERMISSIONS": "Select Permissions",
"SELECT_SYSTEM_PERMISSIONS": "Select System Permissions",
"SELECT_PROJECT_PERMISSIONS": "Select Project Permissions"
"SELECT_PROJECT_PERMISSIONS": "Select Project Permissions",
"SYSTEM_PERMISSIONS": "System Permissions"
},
"GROUP": {
"GROUP": "Grupo",
Expand Down Expand Up @@ -1665,9 +1666,9 @@
"PROJECTS_MODAL_TITLE": "Projetos para contas de automação",
"PROJECTS_MODAL_SUMMARY": "Alguns projetos são usados por esta conta de automação.",
"CREATE_ROBOT": "Criar Conta de Automação",
"CREATE_ROBOT_SUMMARY": "Criando uma conta de sistema para automação de tarefas com permissões específicas. Ao selecionar \"Acesso Completo\", a conta terá acesso a todos os projetos atuais e também a projetos criados futuramente.",
"CREATE_ROBOT_SUMMARY": "Create a system Robot Account that will cover permissions for the system as well as for specific projects",
"EDIT_ROBOT": "Editar Conta de Automação",
"EDIT_ROBOT_SUMMARY": "Editando conta de sistema para automação de tarefas com permissões específicas. Ao selecionar \"Acesso Completo\", a conta terá acesso a todos os projetos atuais e também a projetos criados futuramente.",
"EDIT_ROBOT_SUMMARY": "Edit a system Robot Account that will cover permissions for the system as well as for specific projects",
"EXPIRATION_TIME": "Validade",
"EXPIRATION_TIME_EXPLAIN": "Prazo de validade do acesso desta conta. Para não expirar, informe \"-1\".",
"EXPIRATION_DEFAULT": "dias(default)",
Expand All @@ -1677,7 +1678,7 @@
"COVER_ALL": "Acesso Completo",
"COVER_ALL_EXPLAIN": "Marque para conceder acesso a todos os projetos, atuais e futuros.",
"COVER_ALL_SUMMARY": "Todos os projetos, atuais e futuros poderão ser acessados.",
"RESET_PERMISSION": "REDEFINIR PERMISSÕES",
"RESET_PERMISSION": "RESET ALL PROJECT PERMISSIONS",
"PERMISSION_COLUMN": "Permissões",
"EXPIRES_AT": "Expira em",
"VIEW_SECRET": "REDEFINIR SEGREDO",
Expand Down Expand Up @@ -1709,7 +1710,9 @@
"LIST": "Listar",
"REPOSITORY": "Repositório",
"EXPIRES_IN": "Expires in",
"EXPIRED": "Expired"
"EXPIRED": "Expired",
"SELECT_ALL_PROJECT": "SELECT ALL PROJECTS",
"UNSELECT_ALL_PROJECT": "UNSELECT ALL PROJECTS"
},
"ACCESSORY": {
"DELETION_TITLE_ACCESSORY": "Confirm Accessory Deletion",
Expand Down
Loading

0 comments on commit 9112b77

Please sign in to comment.