Ghost/ghost/admin/app/components/member-attribution/modals/all-sources.js
Rishabh 190031f38c Added modal for showing all attribution sources
refs https://github.com/TryGhost/Team/issues/1941

- limits the source attribution list to top 5 on dashboard, and shows all sources on clicking on `Other` link

Fixed lint
2022-09-26 10:43:05 +05:30

21 lines
635 B
JavaScript

import Component from '@glimmer/component';
import {inject as service} from '@ember/service';
export default class FullAttributionTable extends Component {
@service membersUtils;
get sources() {
const availableSources = this.args.data.sources.filter(source => source.source);
const unavailableSources = this.args.data.sources.filter(sourceData => !sourceData.source).map((sourceData) => {
return {
...sourceData,
source: 'Unavailable'
};
});
return [
...availableSources,
...unavailableSources
];
}
}