diff --git a/orga/app/components/campaign/activity/participants-list.gjs b/orga/app/components/campaign/activity/participants-list.gjs index 81676e8b822..80a6cba5fcc 100644 --- a/orga/app/components/campaign/activity/participants-list.gjs +++ b/orga/app/components/campaign/activity/participants-list.gjs @@ -1,7 +1,8 @@ import PixIconButton from '@1024pix/pix-ui/components/pix-icon-button'; import PixPagination from '@1024pix/pix-ui/components/pix-pagination'; +import PixTable from '@1024pix/pix-ui/components/pix-table'; +import PixTableColumn from '@1024pix/pix-ui/components/pix-table-column'; import { array, fn } from '@ember/helper'; -import { on } from '@ember/modifier'; import { action } from '@ember/object'; import { LinkTo } from '@ember/routing'; import { service } from '@ember/service'; @@ -9,7 +10,6 @@ import Component from '@glimmer/component'; import { tracked } from '@glimmer/tracking'; import { t } from 'ember-intl'; -import TableHeader from '../../table/header'; import ParticipationStatus from '../../ui/participation-status'; import ParticipationFilters from '../filter/participation-filters'; import DeleteParticipationModal from './delete-participation-modal'; @@ -66,119 +66,114 @@ export default class ParticipantsList extends Component { @onResetFilter={{@onResetFilter}} /> -
-
- - - - - {{#if @campaign.externalIdLabel}} - - {{/if}} - - {{#if @showParticipationCount}} - - {{/if}} - {{#if this.canDeleteParticipation}} - - {{/if}} - - - - {{t "pages.campaign-activity.table.column.last-name"}} - {{t "pages.campaign-activity.table.column.first-name"}} - {{#if @campaign.externalIdLabel}} - {{@campaign.externalIdLabel}} - {{/if}} - {{t "pages.campaign-activity.table.column.status"}} - {{#if @showParticipationCount}} - - {{t "pages.campaign-activity.table.column.participationCount"}} - - {{/if}} - {{#if this.canDeleteParticipation}} - - - {{t "pages.campaign-activity.table.column.delete"}} - - - {{/if}} - - - - {{#if @participations}} - - {{#each @participations as |participation|}} - - - - {{#if @campaign.externalIdLabel}} - - {{/if}} - - {{#if @showParticipationCount}} - - {{/if}} - {{#if this.canDeleteParticipation}} - - {{/if}} - - {{/each}} - - {{/if}} -
- - - {{participation.lastName}} - - {{participation.firstName}}{{participation.participantExternalId}} - - - {{participation.participationCount}} - - -
- - {{#unless @participations}} -

{{t "pages.campaign-activity.table.empty"}}

- {{/unless}} -
- - {{#if @participations}} - - {{/if}} - - -
+ + <:columns as |participation context|> + + <:header> + {{t "pages.campaign-activity.table.column.last-name"}} + + <:cell> + + + {{participation.lastName}} + + + + + + <:header> + {{t "pages.campaign-activity.table.column.first-name"}} + + <:cell> + {{participation.firstName}} + + + + {{#if @campaign.externalIdLabel}} + + <:header> + {{@campaign.externalIdLabel}} + + <:cell> + {{participation.ownerFullName}} + + + {{/if}} + + + <:header> + {{t "pages.campaign-activity.table.column.status"}} + + <:cell> + + + + + {{#if @showParticipationCount}} + + <:header> + {{t "pages.campaign-activity.table.column.participationCount"}} + + <:cell> + {{participation.participationCount}} + + + {{/if}} + + {{#if this.canDeleteParticipation}} + + <:header> + {{t "pages.campaign-activity.table.column.delete"}} + + <:cell> + + + + {{/if}} + + + + + {{#unless @participations}} +

{{t "pages.campaign-activity.table.empty"}}

+ {{/unless}} + + {{#if @participations}} + + {{/if}} + + } diff --git a/orga/app/components/campaign/analysis/competences.gjs b/orga/app/components/campaign/analysis/competences.gjs index 62ad0291097..d5ef2540059 100644 --- a/orga/app/components/campaign/analysis/competences.gjs +++ b/orga/app/components/campaign/analysis/competences.gjs @@ -1,56 +1,60 @@ import PixProgressBar from '@1024pix/pix-ui/components/pix-progress-bar'; +import PixTable from '@1024pix/pix-ui/components/pix-table'; +import PixTableColumn from '@1024pix/pix-ui/components/pix-table-column'; import { hash } from '@ember/helper'; import { t } from 'ember-intl'; -import TableHeader from '../../table/header'; - function getCount(campaignCollectiveResult) { const competenceCollectiveResultsCount = campaignCollectiveResult.get('campaignCompetenceCollectiveResults').length; return competenceCollectiveResultsCount ? competenceCollectiveResultsCount : '-'; } diff --git a/orga/app/components/campaign/analysis/recommendations.gjs b/orga/app/components/campaign/analysis/recommendations.gjs index 0f46d4674d6..53d33ec8f7c 100644 --- a/orga/app/components/campaign/analysis/recommendations.gjs +++ b/orga/app/components/campaign/analysis/recommendations.gjs @@ -1,20 +1,17 @@ -import PixBlock from '@1024pix/pix-ui/components/pix-block'; +import PixTable from '@1024pix/pix-ui/components/pix-table'; import { action } from '@ember/object'; import { service } from '@ember/service'; import { htmlSafe } from '@ember/template'; import Component from '@glimmer/component'; import { tracked } from '@glimmer/tracking'; import { t } from 'ember-intl'; -import { not } from 'ember-truth-helpers'; -import TableHeader from '../../table/header'; -import TableHeaderSort from '../../table/header-sort'; -import TubeRecommendationRow from '../analysis/tube-recommendation-row'; +import TubeRecommendationRow from './tube-recommendation-row'; export default class Recommendations extends Component { @service intl; @tracked sortedRecommendations; - @tracked order; + @tracked order = null; constructor() { super(...arguments); @@ -28,84 +25,62 @@ export default class Recommendations extends Component { }); } - get description() { - return htmlSafe( - this.intl.t('pages.campaign-review.description', { - bubble: - '', - }), - ); - } - @action - async sortRecommendationOrder(order) { - this.order = order; + async sortRecommendationOrder() { const campaignTubeRecommendations = this.sortedRecommendations.slice(); if (!this.sortedRecommendations) { return null; - } else if (order === 'desc') { + } else if (this.order === 'desc') { + this.order = 'asc'; this.sortedRecommendations = campaignTubeRecommendations.sort((a, b) => { return a.averageScore - b.averageScore; }); } else { + this.order = 'desc'; this.sortedRecommendations = campaignTubeRecommendations.sort((a, b) => { return b.averageScore - a.averageScore; }); } } + + get description() { + return htmlSafe( + this.intl.t('pages.campaign-review.description', { + bubble: + '', + }), + ); + } + } diff --git a/orga/app/components/campaign/analysis/tube-recommendation-detail.gjs b/orga/app/components/campaign/analysis/tube-recommendation-detail.gjs new file mode 100644 index 00000000000..e1cf8c113c4 --- /dev/null +++ b/orga/app/components/campaign/analysis/tube-recommendation-detail.gjs @@ -0,0 +1,26 @@ +import dayjsDurationHumanize from 'ember-dayjs/helpers/dayjs-duration-humanize'; +import { t } from 'ember-intl'; + + diff --git a/orga/app/components/campaign/analysis/tube-recommendation-row.gjs b/orga/app/components/campaign/analysis/tube-recommendation-row.gjs index 33e4c4c20fc..efe99124f50 100644 --- a/orga/app/components/campaign/analysis/tube-recommendation-row.gjs +++ b/orga/app/components/campaign/analysis/tube-recommendation-row.gjs @@ -1,101 +1,84 @@ +import PixTableColumn from '@1024pix/pix-ui/components/pix-table-column'; import { action } from '@ember/object'; import Component from '@glimmer/component'; import { tracked } from '@glimmer/tracking'; -import dayjsDurationHumanize from 'ember-dayjs/helpers/dayjs-duration-humanize'; import { t } from 'ember-intl'; -import { gt, not } from 'ember-truth-helpers'; +import { and, gt } from 'ember-truth-helpers'; import Chevron from '../../ui/chevron'; import RecommendationIndicator from './recommendation-indicator'; +import TubeRecommendationDetail from './tube-recommendation-detail'; import TutorialCounter from './tutorial-counter'; export default class TubeRecommendationRowComponent extends Component { @tracked - isOpen = false; + isOpenRecommandationTube = false; @action toggleTutorialsSection() { - this.isOpen = !this.isOpen; + this.isOpenRecommandationTube = !this.isOpenRecommandationTube; } + } diff --git a/orga/app/components/campaign/list.gjs b/orga/app/components/campaign/list.gjs index 010ff24d04e..ff72c9d19d2 100644 --- a/orga/app/components/campaign/list.gjs +++ b/orga/app/components/campaign/list.gjs @@ -1,6 +1,8 @@ import PixButton from '@1024pix/pix-ui/components/pix-button'; import PixCheckbox from '@1024pix/pix-ui/components/pix-checkbox'; import PixPagination from '@1024pix/pix-ui/components/pix-pagination'; +import PixTable from '@1024pix/pix-ui/components/pix-table'; +import PixTableColumn from '@1024pix/pix-ui/components/pix-table-column'; import { fn, uniqueId } from '@ember/helper'; import { on } from '@ember/modifier'; import { action } from '@ember/object'; @@ -10,11 +12,10 @@ import Component from '@glimmer/component'; import { tracked } from '@glimmer/tracking'; import dayjsFormat from 'ember-dayjs/helpers/dayjs-format'; import { t } from 'ember-intl'; -import { eq, not } from 'ember-truth-helpers'; +import { not } from 'ember-truth-helpers'; import InElement from '../in-element'; import SelectableList from '../selectable-list'; -import TableHeader from '../table/header'; import UiActionBar from '../ui/action-bar'; import UiDeletionModal from '../ui/deletion-modal'; import CampaignType from './detail/type'; @@ -39,6 +40,10 @@ export default class List extends Component { return this.args.canDelete ?? false; } + get displayEmptyResult() { + return this.args.campaigns.length === 0; + } + @action toggleDeletionModal() { this.showDeletionModal = !this.showDeletionModal; @@ -67,95 +72,160 @@ export default class List extends Component { } +const Filters = ; + const PixPaginationControl =