Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/html lint documentation #208

Merged
merged 4 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
1af1c6ca3bfd591d41e9e3d749dc09fe03a1dddb
1af1c6ca3bfd591d41e9e3d749dc09fe03a1dddb

# prettier
01574ef481d7392912ee4e493d0c348fe0e8fd95
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[submodule "dependencies/GeoNature"]
path = dependencies/GeoNature
url = https://github.com/PnX-SI/GeoNature.git
url = ../GeoNature.git
[submodule "dependencies/Utils-Flask-SQLAlchemy"]
path = dependencies/Utils-Flask-SQLAlchemy
url = https://github.com/PnX-SI/Utils-Flask-SQLAlchemy.git
url = ../Utils-Flask-SQLAlchemy.git
[submodule "dependencies/Utils-Flask-SQLAlchemy-Geo"]
path = dependencies/Utils-Flask-SQLAlchemy-Geo
url = https://github.com/PnX-SI/Utils-Flask-SQLAlchemy-Geo.git
url = ../Utils-Flask-SQLAlchemy-Geo.git
3 changes: 2 additions & 1 deletion frontend/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
build
dist
dist
.angular
6 changes: 5 additions & 1 deletion frontend/.prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@
"useTabs": false,
"tabWidth": 2,
"semi": true,
"bracketSpacing": true
"bracketSpacing": true,
"trailingComma": "es5",
"singleAttributePerLine": true,
"bracketSameLine": false,
"htmlWhitespaceSensitivity": "ignore"
}
50 changes: 38 additions & 12 deletions frontend/app/export-list/export-list.component.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<div id="all" class="container-fluid">
<div
id="all"
class="container-fluid"
>
<div class="wrapper row">
<div class="container card">
<div class="card-body">
Expand All @@ -8,12 +11,19 @@ <h2>EXPORTS</h2>
</div>
<!-- Liste des exports disponibles au téléchargement -->
<div *ngIf="exports">
<div class="card export-card mb-3" *ngFor="let export of exports; let i = index">
<div
class="card export-card mb-3"
*ngFor="let export of exports; let i = index"
>
<div class="card-body">
<h5 class="card-title">
<span class="badge badge-info" title="ID de l'export" data-toggle="tooltip">{{
export.id
}}</span>
<span
class="badge badge-info"
title="ID de l'export"
data-toggle="tooltip"
>
{{ export.id }}
</span>
{{ export.label }}
</h5>
<p class="card-text">{{ export.desc }}</p>
Expand Down Expand Up @@ -43,7 +53,10 @@ <h5 class="card-title">
Token
</button>
</div>
<div class="ctn-token" [hidden]="!objectToken[i].display">
<div
class="ctn-token"
[hidden]="!objectToken[i].display"
>
<p>Token : "{{ objectToken[i].token }}" copié</p>
</div>
</div>
Expand All @@ -57,7 +70,11 @@ <h5 class="card-title">
</div>

<!-- Modal Téléchargement Popup-->
<ng-template #export_download let-c="close" let-d="dismiss">
<ng-template
#export_download
let-c="close"
let-d="dismiss"
>
<div class="modal-content">
<!-- Modal content-->
<div class="modal-header">
Expand All @@ -67,7 +84,7 @@ <h4 class="modal-title">Configuration de l'export</h4>
<div class="modal-body">
<!-- Formulaire pour le choix des standards et des formats de téléchargement des fichiers -->
<form [formGroup]="modalForm">
<label> Choisissez un format </label>
<label>Choisissez un format</label>
<select
class="form-control"
id="formatSelection"
Expand All @@ -91,31 +108,40 @@ <h4 class="modal-title">Configuration de l'export</h4>
class="wrapper-licence"
[ngClass]="{ 'checkbox-invalid': !modalForm.controls['exportLicence'].valid }"
>
<div class="form-check" id="checkLicence">
<div
class="form-check"
id="checkLicence"
>
<input
type="checkbox"
class="form-check-input"
id="exportLicence"
formControlName="exportLicence"
required
/>
<label class="form-check-label" for="exportLicence">
<label
class="form-check-label"
for="exportLicence"
>
Accepter la licence
<a
href="{{ _export.licence.url_licence }}"
alt="Lire la licence"
title="Lire la licence"
target="_blank"
>
<b> {{ _export.licence.name_licence }} </b>
<b>{{ _export.licence.name_licence }}</b>
</a>
</label>
</div>
</div>
</form>
</div>
<!-- Bouton de fermeture de la modal pop-up ou lancement du téléchargement -->
<div class="modal-footer" id="choicePopup">
<div
class="modal-footer"
id="choicePopup"
>
<button
type="submit"
class="btn btn-danger"
Expand Down
9 changes: 4 additions & 5 deletions frontend/app/export-list/export-list.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ form.ng-invalid {
padding-left: 3px;
}

.ctn-token{
text-align: end;
font-size: medium;
padding-top: 5px;
.ctn-token {
text-align: end;
font-size: medium;
padding-top: 5px;
}

14 changes: 7 additions & 7 deletions frontend/app/export-list/export-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class ExportListComponent implements OnInit {
private _commonService: CommonService,
private _userService: UserDataService,
public _authService: AuthService,
public config: ConfigService,
public config: ConfigService
) {
this.exportFormat = this.config.EXPORTS['export_format_map'];
this.api_endpoint = `${this.config.API_ENDPOINT}${this.config.EXPORTS.MODULE_URL}`;
Expand All @@ -62,7 +62,7 @@ export class ExportListComponent implements OnInit {
element.cor_roles_exports.splice(1);
});
return exports;
}),
})
)
.subscribe(
(exports: Export[]) => {
Expand All @@ -82,10 +82,10 @@ export class ExportListComponent implements OnInit {
(errorMsg: ApiErrorResponse) => {
this._commonService.regularToaster(
'error',
errorMsg.error.message ? errorMsg.error.message : errorMsg.message,
errorMsg.error.message ? errorMsg.error.message : errorMsg.message
);
this.loadingIndicator = false;
},
}
);
}

Expand Down Expand Up @@ -118,15 +118,15 @@ export class ExportListComponent implements OnInit {
(response) => {
this._commonService.regularToaster(
'success',
response && response.message ? response.message : '',
response && response.message ? response.message : ''
);
},
(response: ApiErrorResponse) => {
this._commonService.regularToaster(
'error',
response.error.message ? response.error.message : response.message,
response.error.message ? response.error.message : response.message
);
},
}
);
}
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/app/services/export.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface ApiErrorResponse extends HttpErrorResponse {
export class ExportService {
constructor(
private _api: HttpClient,
public config: ConfigService,
public config: ConfigService
) {}

getExports() {
Expand All @@ -35,7 +35,7 @@ export class ExportService {
downloadExport(x: Export, format: string) {
return this._api.post<any>(
`${this.config.API_ENDPOINT}${this.config.EXPORTS.MODULE_URL}/${x.id}/${format}`,
{},
{}
);
}
}
4 changes: 2 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"description": "GeoNature export data module",
"license": "GPLv3",
"scripts": {
"format": "prettier --config .prettierrc --ignore-path .prettierignore --write '**/*.ts' ",
"format:check": "prettier --config .prettierrc --ignore-path .prettierignore '**/*.ts' "
"format": "prettier --config .prettierrc --ignore-path .prettierignore --write '**/*.{ts,html,scss}' ",
"format:check": "prettier --config .prettierrc --ignore-path .prettierignore '**/*.{ts,html,scss}' "
},
"devDependencies": {
"prettier": "^3.0.1"
Expand Down
Loading