Skip to content

Commit

Permalink
style: apply black and prettier
Browse files Browse the repository at this point in the history
Reviewed-by: andriacap
  • Loading branch information
andriacap committed Aug 23, 2023
1 parent 6b33658 commit 6ce5bc7
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 33 deletions.
2 changes: 1 addition & 1 deletion backend/gn_module_monitoring/monitoring/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def attribute_names(cls):
for prop in class_mapper(cls).iterate_properties
if isinstance(prop, ColumnProperty)
]

# TODO: Voir si on garde cette méthode pour simplifier la recherche des relationship lors des filtres
@classmethod
def attribute_names_relationship(cls):
Expand Down
7 changes: 4 additions & 3 deletions backend/gn_module_monitoring/monitoring/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,15 @@ def set_pk(self, obj):

def get_id_sites_group(self, obj):
return obj.id_sites_group

def get_id_inventor(self, obj):
return obj.id_inventor

def get_inventor_name(self, obj):
if obj.inventor :
if obj.inventor:
return [obj.inventor.nom_complet]


class MonitoringVisitsSchema(MA.SQLAlchemyAutoSchema):
class Meta:
model = TMonitoringVisits
Expand Down
4 changes: 3 additions & 1 deletion frontend/app/components/modal-msg/modal-msg.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
.hide-modal {
opacity: 0;
visibility: hidden;
transition: visibility 0.6s, opacity 0.5s;
transition:
visibility 0.6s,
opacity 0.5s;
}

.show-modal {
Expand Down
8 changes: 6 additions & 2 deletions frontend/app/components/modules/modules.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ h2 {
justify-content: center;
box-shadow: 0px 0px 10px grey;
opacity: 0.7;
transition: opacity 0.2s, box-shadow 0.2s;
transition:
opacity 0.2s,
box-shadow 0.2s;
}

a {
Expand All @@ -44,7 +46,9 @@ a {
.flex-item:hover {
opacity: 1;
box-shadow: 0px 0px 10px black;
transition: opacity 0.2s, box-shadow 0.2s;
transition:
opacity 0.2s,
box-shadow 0.2s;
}

.module h2 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,9 @@ export class MonitoringFormComponentG implements OnInit {
onCancelEdit() {
if (this.bEdit) {
const urlTree = this._router.parseUrl(this._router.url);
const urlWithoutParams = urlTree.root.children['primary'].segments.map(it => it.path).join('/');
const urlWithoutParams = urlTree.root.children['primary'].segments
.map((it) => it.path)
.join('/');
this._router.navigate([urlWithoutParams]);
this.bEditChange.emit(false);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class MonitoringObjectComponent implements OnInit {

objForm: FormGroup;

checkEditParam:boolean;
checkEditParam: boolean;
bEdit = false;
bLoadingModal = false;

Expand Down
55 changes: 31 additions & 24 deletions frontend/app/resolver/sites-groups.resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class SitesGroupsReslver
constructor(
public service: SitesGroupService,
public serviceSite: SitesService,
public _configJsonService : ConfigJsonService
public _configJsonService: ConfigJsonService
) {}

resolve(
Expand All @@ -32,43 +32,50 @@ export class SitesGroupsReslver
sites: { data: IPaginated<ISite>; objConfig: IobjObs<ISite> };
route: string;
}> {

const $configSitesGroups = this.service.initConfig();
const $configSites = this.serviceSite.initConfig();

const resolvedData = forkJoin([$configSitesGroups,$configSites]).pipe(
const resolvedData = forkJoin([$configSitesGroups, $configSites]).pipe(
map((configs) => {

const configSchemaSiteGroup= this._configJsonService.configModuleObject(
const configSchemaSiteGroup = this._configJsonService.configModuleObject(
configs[0].moduleCode,
configs[0].objectType
)
);

const configSchemaSite= this._configJsonService.configModuleObject(
const configSchemaSite = this._configJsonService.configModuleObject(
configs[1].moduleCode,
configs[1].objectType
)

const sortSiteGroupInit = "sorts" in configSchemaSiteGroup ?{sort_dir:configSchemaSiteGroup.sorts[0].dir, sort:configSchemaSiteGroup.sorts[0].prop} : {};
const sortSiteInit = "sorts" in configSchemaSite ? {sort_dir:configSchemaSite.sorts[0].dir, sort:configSchemaSite.sorts[0].prop} : {};
);

const sortSiteGroupInit =
'sorts' in configSchemaSiteGroup
? {
sort_dir: configSchemaSiteGroup.sorts[0].dir,
sort: configSchemaSiteGroup.sorts[0].prop,
}
: {};
const sortSiteInit =
'sorts' in configSchemaSite
? { sort_dir: configSchemaSite.sorts[0].dir, sort: configSchemaSite.sorts[0].prop }
: {};

const $getSiteGroups = this.service.get(1, LIMIT,sortSiteGroupInit);
const $getSiteGroups = this.service.get(1, LIMIT, sortSiteGroupInit);
const $getSites = this.serviceSite.get(1, LIMIT, sortSiteInit);
return forkJoin([$getSiteGroups, $getSites]).pipe(
map(([siteGroups,sites]) => {
return {
sitesGroups: { data: siteGroups, objConfig: configs[0] },
sites: { data: sites, objConfig: configs[1] },

return forkJoin([$getSiteGroups, $getSites]).pipe(
map(([siteGroups, sites]) => {
return {
sitesGroups: { data: siteGroups, objConfig: configs[0] },
sites: { data: sites, objConfig: configs[1] },
route: route['_urlSegment'].segments[1].path,
}
};
})
)
);
}),
mergeMap((result) => {
return result
return result;
})
)
return resolvedData
}
);
return resolvedData;
}
}

0 comments on commit 6ce5bc7

Please sign in to comment.