Skip to content

Commit

Permalink
Merge branch 'master' into new-project-UI
Browse files Browse the repository at this point in the history
  • Loading branch information
rsiminel authored Jul 22, 2024
2 parents 3acd0fa + 2d8f137 commit 477b783
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 59 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* Updated TP calendar to increase readability
* Fix newly created group selection bug
* Update admin project creation UI: disappearing buttons and add "undo selection" button
* Actually show angular errors in web console when not in production and sentry is not set
* Fix owner change for databases and websites

## 1.4.29

Expand Down
2 changes: 1 addition & 1 deletion dev_quickstart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Genouestaccountmanager is fairly modular, so it will not fit a deployment for pr
* **At least the 'url' key, to match the access url to your instance**
* You may want to add your first username to the 'admin' list in the same file
* Copy it in genouestaccountmanager/config/
* phpldapadmin will be available on port 80 if needed.
* phpldapadmin will be available on port 8080 if needed.

## Requirements

Expand Down
4 changes: 2 additions & 2 deletions manager2/src/app/admin/databases/databases.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,13 @@ <h3>Change database owner</h3>
<div class="col-sm-2">
<label for="owner_db_name">Database name</label>
<select id="owner_db_name" [ngModelOptions]="{standalone: true}" [(ngModel)]="owner_db_name" class="form-control">
<option *ngFor="let database of databases" [value]="database">{{database.name}}</option>
<option *ngFor="let database of databases" [ngValue]="database">{{database.name}}</option>
</select>
</div>
<div class="col-sm-2">
<label for="owner_dbhost">Database owner</label>
<select [ngModelOptions]="{standalone: true}" [(ngModel)]="owner_db_owner" id="owner_dbhost" class="form-control">
<option *ngFor="let user of users" [value]="user">{{user.uid}}</option>
<option *ngFor="let user of users" [ngValue]="user">{{user.uid}}</option>
</select>
</div>
<div class="col-sm-2">
Expand Down
4 changes: 2 additions & 2 deletions manager2/src/app/admin/websites/websites.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ <h3>Change web site owner</h3>
<div class="col-sm-2">
<label for="owner_web_name">Website</label>
<select id="owner_web_name" [ngModelOptions]="{standalone: true}" [(ngModel)]="owner_web_name" class="form-control">
<option *ngFor="let web of websites" [value]="web">{{web.name}}</option>
<option *ngFor="let web of websites" [ngValue]="web">{{web.name}}</option>
</select>
</div>
<div class="col-sm-2">
<label for="owner_web_owner">Website owner</label>
<select [ngModelOptions]="{standalone: true}" [(ngModel)]="owner_web_owner" id="owner_web_owner" class="form-control">
<option *ngFor="let user of users" [value]="user">{{user.uid}}</option>
<option *ngFor="let user of users" [ngValue]="user">{{user.uid}}</option>
</select>
</div>
<div class="col-sm-2">
Expand Down
6 changes: 6 additions & 0 deletions manager2/src/app/admin/websites/websites.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ export class WebsitesComponent implements OnInit {
this.chowner_err_msg = 'No web or owner selected';
return;
}

if(this.owner_web_name.owner === this.owner_web_owner.uid ){
this.chowner_err_msg = this.owner_web_owner.uid + " is already owner of this website";
return;
}

this.websitesService.changeOwner(this.owner_web_name.name, this.owner_web_name.owner, this.owner_web_owner.uid).subscribe(
resp => this.chowner_msg = resp['message'],
err => this.chowner_err_msg = err.error.message
Expand Down
5 changes: 4 additions & 1 deletion manager2/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ if (environment.sentry) {
export class SentryErrorHandler implements ErrorHandler {
constructor() {}
handleError(error) {
if (!environment.sentry) { return }
if (!environment.sentry && !environment.production) {
console.log(error.originalError || error)
return
}
const eventId = Sentry.captureException(error.originalError || error);
Sentry.showReportDialog({ eventId });
}
Expand Down
8 changes: 4 additions & 4 deletions manager2/src/app/project/project.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ <h3>Request a new project creation</h3>
</div>
</div>

<div class="form-group" *ngIf="config.project.terms_and_conditions_hds">
<div class="form-group" *ngIf="config.project && config.project.terms_and_conditions_hds">
<div class="form-check">
<input class="form-check-input is-invalid" type="checkbox" value="" id="new_project_terms_and_conditions_hds" name="terms_and_conditions_hds" [(ngModel)]="new_project.terms_and_conditions_hds" #terms_and_conditions_hds="ngModel" required>
<label class="form-check-label" for="new_project_terms_and_conditions_hds">
Expand All @@ -77,7 +77,7 @@ <h3>Request a new project creation</h3>
<div class="modal-footer" id="submit">
<div class="form-group row col-sm-12">
<!-- Button with terms_and_conditions_hds -->
<button *ngIf="config.project.terms_and_conditions_hds"
<button *ngIf="config.project && config.project.terms_and_conditions_hds"
id="test"
type="submit"
class="p-button p-button-sm p-button-primary"
Expand All @@ -87,7 +87,7 @@ <h3>Request a new project creation</h3>
</button>

<!-- Button without terms_and_conditions_hds -->
<button *ngIf="!config.project.terms_and_conditions_hds"
<button *ngIf="!(config.project && config.project.terms_and_conditions_hds)"
id="test"
type="submit"
class="p-button p-button-sm p-button-primary"
Expand Down Expand Up @@ -348,4 +348,4 @@ <h4 class="modal-title">Terms and Conditions HDS</h4>
</div>
</div>
</div>
</div>
</div>
49 changes: 0 additions & 49 deletions manager2/src/app/user/user.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -395,55 +395,6 @@ <h4>Projects</h4>
<app-user-projects [projects]="new_projects" [user_projects]="user_projects" [user]="user"></app-user-projects>
</div>
</div>

<div *ngIf="config.enable_ui && config.enable_ui.databases" class="card bg-light">
<div class="card-header">
<h4>Databases</h4>
</div>
<div class="card-body">
<div *ngIf="dbmsg" class="alert alert-info alert-dismissible" role="alert">
{{dbmsg}}
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div *ngIf="dbmsg_error" class="alert alert-danger alert-dismissible" role="alert">
{{dbmsg_error}}
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div *ngIf="rm_dbmsg" class="alert alert-warning alert-dismissible" role="alert">
{{rm_dbmsg}}
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="form-group row">
<div class="col-sm-6">
<label for="database">Database name</label>
<input placeholder="no space or accent" type="text" [ngModelOptions]="{standalone: true}" [(ngModel)]="database.name" id='database'class="form-control"/>
</div>
</div>
<div class="form-group">
<button type="button" class="p-button p-button-sm p-button-primary" (click)="db_add()">Create</button>
</div>

<div class="table-responsive">
<table aria-label="databases" *ngIf="databases && databases.length > 0" class="table table-striped">
<thead>
<th scope="col">Name</th><th scope="col"></th>
</thead>
<tbody>
<tr *ngFor="let db of databases">
<td>{{db.name}}</td>
<td><app-my-delete-confirm [onConfirm]="db_delete" [data]="db.name"></app-my-delete-confirm>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>

<div class="col-md-6 col-sm-12" *ngIf="panel == 1">
Expand Down

0 comments on commit 477b783

Please sign in to comment.