-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(telecom-dashboard): add ftth eligibilities list
ref: UXCT-549 Signed-off-by: Stephanie Moallic <stephanie.moallic@corp.ovh.com>
- Loading branch information
Stephanie Moallic
committed
Jun 5, 2024
1 parent
22dfb5b
commit 00c563f
Showing
17 changed files
with
628 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
packages/manager/apps/telecom/src/app/telecom/pack/access-list/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import angular from 'angular'; | ||
|
||
import ngTranslateAsyncLoader from '@ovh-ux/ng-translate-async-loader'; | ||
import uiRouter from '@uirouter/angularjs'; | ||
import angularTranslate from 'angular-translate'; | ||
|
||
import component from './xdsl-access-list.component'; | ||
import routing from './xdsl-access-list.routing'; | ||
import service from './xdsl-access-list.service'; | ||
|
||
const moduleName = 'ovhManagerTelecomXdslAccessList'; | ||
|
||
angular | ||
.module(moduleName, [ngTranslateAsyncLoader, uiRouter, angularTranslate]) | ||
.component('xdslAccessList', component) | ||
.service('XdslAccessListService', service) | ||
.config(routing) | ||
.run(/* @ngTranslationsInject:json ./translations */); | ||
|
||
export default moduleName; |
17 changes: 17 additions & 0 deletions
17
...es/manager/apps/telecom/src/app/telecom/pack/access-list/translations/Messages_fr_FR.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"xdsl_access_list_title": "Mes services", | ||
"xlds_access_list_copper_closure_info": "En savoir plus sur la fermeture du cuivre.", | ||
"xdsl_access_list_service_name": "Nom du service", | ||
"xdsl_access_list_service": "Service", | ||
"xdsl_access_list_migration": "Migration fibre", | ||
"xdsl_access_list_copper_closure_date": "Date de fermeture du cuivre", | ||
"xdsl_access_list_actions": "Actions", | ||
"xdsl_access_list_copper": "Ligne xDSL", | ||
"xdsl_access_list_fiber": "Ligne FTTH", | ||
"xdsl_access_list_not_eligible": "Non éligible", | ||
"xdsl_access_list_no_building": "Pas de bâtiment", | ||
"xdsl_access_list_eligible": "Eligible", | ||
"xdsl_access_list_not_concerned": "Non concerné", | ||
"xdsl_access_list_not_available": "Non disponible", | ||
"xdsl_access_list_migrate": "Migrer vers la fibre" | ||
} |
7 changes: 7 additions & 0 deletions
7
packages/manager/apps/telecom/src/app/telecom/pack/access-list/xdsl-access-list.component.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import controller from './xdsl-access-list.controller'; | ||
import template from './xdsl-access-list.html'; | ||
|
||
export default { | ||
controller, | ||
template, | ||
}; |
19 changes: 19 additions & 0 deletions
19
packages/manager/apps/telecom/src/app/telecom/pack/access-list/xdsl-access-list.constant.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export const ELIGIBILITY = { | ||
not_eligible: 'not_eligible', | ||
eligible: 'eligible', | ||
not_concerned: 'not_concerned', | ||
}; | ||
|
||
export const PAGE_SIZE = 10; | ||
|
||
export const ACCESS_TYPE = { | ||
adsl: 'adsl', | ||
sdsl: 'sdsl', | ||
vdsl: 'vdsl', | ||
ftth: 'ftth', | ||
}; | ||
|
||
export const URL_CLOSURE_INFO = | ||
'https://www.ovhcloud.com/fr/lp/fermeture-reseau-cuivre/'; | ||
|
||
export default { ELIGIBILITY, PAGE_SIZE, ACCESS_TYPE, URL_CLOSURE_INFO }; |
118 changes: 118 additions & 0 deletions
118
...ages/manager/apps/telecom/src/app/telecom/pack/access-list/xdsl-access-list.controller.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
import { | ||
ELIGIBILITY, | ||
PAGE_SIZE, | ||
ACCESS_TYPE, | ||
URL_CLOSURE_INFO, | ||
} from './xdsl-access-list.constant'; | ||
|
||
export default class XdslAccessListCtrl { | ||
/* @ngInject */ | ||
constructor(coreURLBuilder, XdslAccessListService, TucToastError) { | ||
this.coreURLBuilder = coreURLBuilder; | ||
this.XdslAccessListService = XdslAccessListService; | ||
this.TucToastError = TucToastError; | ||
} | ||
|
||
$onInit() { | ||
this.ELIGIBILITY = ELIGIBILITY; | ||
this.pageSize = PAGE_SIZE; | ||
this.ACCESS_TYPE = ACCESS_TYPE; | ||
|
||
this.links = { | ||
copperClosureMore: URL_CLOSURE_INFO, | ||
}; | ||
|
||
this.getServices(); | ||
} | ||
|
||
getServices() { | ||
this.services = []; | ||
this.XdslAccessListService.getServices() | ||
.then(({ data }) => this.buildServicesList(data || [])) | ||
.catch(({ data }) => { | ||
this.TucToastError(data.message); | ||
}); | ||
} | ||
|
||
buildServicesList(services) { | ||
// Retrieve service info for each service | ||
services.forEach((serviceName) => { | ||
this.XdslAccessListService.getServiceDetail(serviceName).then( | ||
({ data }) => { | ||
if (data.accessType !== 'ftth') { | ||
this.getListFiberEligibilities(serviceName, data); | ||
} else { | ||
const { accessName, accessType, description, packName } = data; | ||
this.services.push({ | ||
accessName, | ||
accessType, | ||
description, | ||
packName, | ||
migrationAvailable: this.ELIGIBILITY.not_concerned, | ||
accessLink: this.coreURLBuilder.buildURL( | ||
'telecom', | ||
`#/pack/${packName}/xdsl/${accessName}`, | ||
), | ||
migrationLink: this.coreURLBuilder.buildURL( | ||
'telecom', | ||
`#/pack/${packName}/migration`, | ||
), | ||
}); | ||
} | ||
}, | ||
); | ||
}); | ||
} | ||
|
||
getListFiberEligibilities(serviceName, service) { | ||
this.XdslAccessListService.getFiberEligibilityList(serviceName).then( | ||
({ data }) => { | ||
if (data.length === 1) { | ||
this.getFiberEligibility(serviceName, service, data); | ||
} else { | ||
const { accessName, accessType, description, packName } = service; | ||
this.services.push({ | ||
accessName, | ||
accessType, | ||
description, | ||
packName, | ||
migrationAvailable: this.ELIGIBILITY.not_eligible, | ||
accessLink: this.coreURLBuilder.buildURL( | ||
'telecom', | ||
`#/pack/${packName}/xdsl/${accessName}`, | ||
), | ||
migrationLink: this.coreURLBuilder.buildURL( | ||
'telecom', | ||
`#/pack/${packName}/migration`, | ||
), | ||
}); | ||
} | ||
}, | ||
); | ||
} | ||
|
||
getFiberEligibility(serviceName, service, fiberEligibilities) { | ||
this.XdslAccessListService.getFiberEligibilityDetail( | ||
serviceName, | ||
fiberEligibilities[0], | ||
).then(({ data }) => { | ||
const { accessName, accessType, description, packName } = service; | ||
this.services.push({ | ||
accessName, | ||
accessType, | ||
description, | ||
packName, | ||
migrationAvailable: data.status, | ||
copperGridClosureTrajectory: data.copperGridClosureTrajectory, | ||
accessLink: this.coreURLBuilder.buildURL( | ||
'telecom', | ||
`#/pack/${packName}/xdsl/${accessName}`, | ||
), | ||
migrationLink: this.coreURLBuilder.buildURL( | ||
'telecom', | ||
`#/pack/${packName}/migration`, | ||
), | ||
}); | ||
}); | ||
} | ||
} |
96 changes: 96 additions & 0 deletions
96
packages/manager/apps/telecom/src/app/telecom/pack/access-list/xdsl-access-list.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
<div class="m-4"> | ||
<header class="widget-presentation-header"> | ||
<h2 | ||
class="widget-presentation-title" | ||
data-translate="xdsl_access_list_title" | ||
></h2> | ||
</header> | ||
|
||
<tuc-toast-message></tuc-toast-message> | ||
|
||
<oui-message data-type="info"> | ||
<a | ||
data-ng-href="{{ $ctrl.links.copperClosureMore }}" | ||
data-translate-attr="{ 'title': 'xlds_access_list_copper_closure_info' }" | ||
target="_blank" | ||
rel="noopener" | ||
> | ||
<span data-translate="xlds_access_list_copper_closure_info"></span> | ||
<span | ||
class="oui-icon oui-icon-external-link" | ||
aria-hidden="true" | ||
></span> | ||
</a> | ||
</oui-message> | ||
|
||
<oui-datagrid | ||
data-rows="$ctrl.services" | ||
data-page-size="{{$ctrl.pageSize}}" | ||
> | ||
<oui-datagrid-column | ||
data-title="'xdsl_access_list_service_name' | translate" | ||
data-property="accessName" | ||
data-sortable="desc" | ||
> | ||
<div> | ||
<a data-ng-href="{{ $row.accessLink }}"> | ||
<span data-ng-bind="$row.accessName"></span> | ||
</a> | ||
</div> | ||
<div data-ng-bind="$row.description"></div> | ||
</oui-datagrid-column> | ||
<oui-datagrid-column | ||
data-title="'xdsl_access_list_service' | translate" | ||
data-property="accessType" | ||
data-sortable | ||
> | ||
<span | ||
data-translate="{{$row.accessType === $ctrl.ACCESS_TYPE.ftth ? 'xdsl_access_list_fiber' : 'xdsl_access_list_copper'}}" | ||
></span> | ||
</oui-datagrid-column> | ||
<oui-datagrid-column | ||
data-title="'xdsl_access_list_migration' | translate" | ||
data-property="migrationAvailable" | ||
data-sortable | ||
> | ||
<span | ||
class="oui-badge oui-badge_success" | ||
data-translate="{{'xdsl_access_list_' + $row.migrationAvailable}}" | ||
data-ng-if="$row.migrationAvailable === $ctrl.ELIGIBILITY.eligible" | ||
></span> | ||
<span | ||
data-translate="{{'xdsl_access_list_' + $row.migrationAvailable}}" | ||
data-ng-if="$row.migrationAvailable != $ctrl.ELIGIBILITY.eligible" | ||
></span> | ||
</oui-datagrid-column> | ||
<oui-datagrid-column | ||
data-title="'xdsl_access_list_copper_closure_date' | translate" | ||
> | ||
<span | ||
data-ng-if="$row.migrationAvailable === $ctrl.ELIGIBILITY.eligible && $row.copperGridClosureTrajectory.technicalClosureDate" | ||
data-ng-bind="$row.copperGridClosureTrajectory.technicalClosureDate | date:'shortDate'" | ||
> | ||
</span> | ||
<span | ||
data-ng-if="$row.migrationAvailable === $ctrl.ELIGIBILITY.eligible && !$row.copperGridClosureTrajectory.technicalClosureDate" | ||
data-translate="xdsl_access_list_not_available" | ||
></span> | ||
<span | ||
data-ng-if="$row.migrationAvailable != $ctrl.ELIGIBILITY.eligible" | ||
data-translate="xdsl_access_list_not_concerned" | ||
></span> | ||
</oui-datagrid-column> | ||
<oui-datagrid-column | ||
data-title="'xdsl_access_list_actions' | translate" | ||
> | ||
<a | ||
class="oui-button oui-button_secondary" | ||
data-ng-href="{{$row.migrationLink}}" | ||
data-ng-if="$row.migrationAvailable === $ctrl.ELIGIBILITY.eligible && $row.accessType !== $ctrl.ACCESS_TYPE.sdsl" | ||
data-translate-attr="{'title': 'xdsl_access_list_migrate'}" | ||
> | ||
<span data-translate="xdsl_access_list_migrate"></span> | ||
</a> | ||
</oui-datagrid-column> | ||
</oui-datagrid> | ||
</div> |
11 changes: 11 additions & 0 deletions
11
packages/manager/apps/telecom/src/app/telecom/pack/access-list/xdsl-access-list.routing.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export default /* @ngInject */ ($stateProvider) => { | ||
$stateProvider.state('telecom.xdsl-access-list', { | ||
url: '/xdsl-access-list', | ||
views: { | ||
'telecomView@telecom': 'xdslAccessList', | ||
}, | ||
resolve: { | ||
hideBreadcrumb: () => true, | ||
}, | ||
}); | ||
}; |
22 changes: 22 additions & 0 deletions
22
packages/manager/apps/telecom/src/app/telecom/pack/access-list/xdsl-access-list.service.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
export default class XdslAccessListService { | ||
/* @ngInject */ | ||
constructor($http) { | ||
this.$http = $http; | ||
} | ||
|
||
getServices() { | ||
return this.$http.get('/xdsl'); | ||
} | ||
|
||
getServiceDetail(serviceName) { | ||
return this.$http.get(`/xdsl/${serviceName}`); | ||
} | ||
|
||
getFiberEligibilityList(serviceName) { | ||
return this.$http.get(`/xdsl/${serviceName}/fiberEligibilities`); | ||
} | ||
|
||
getFiberEligibilityDetail(serviceName, id) { | ||
return this.$http.get(`/xdsl/${serviceName}/fiberEligibilities/${id}`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...les/telecom-dashboard/src/ftth-eligibility/telecom-dashboard-ftth-eligibility.constant.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export const ELIGIBILITY = { | ||
not_eligible: 'not_eligible', | ||
eligible: 'eligible', | ||
not_concerned: 'not_concerned', | ||
}; | ||
|
||
export const ACCESS_TYPE = { | ||
adsl: 'adsl', | ||
sdsl: 'sdsl', | ||
vdsl: 'vdsl', | ||
ftth: 'ftth', | ||
}; | ||
|
||
export const CLOSURE_DETAIL_URL = | ||
'https://www.ovhcloud.com/fr/lp/fermeture-reseau-cuivre/'; | ||
|
||
export default { ELIGIBILITY, ACCESS_TYPE, CLOSURE_DETAIL_URL }; |
Oops, something went wrong.