mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-05 09:50:34 +03:00
190031f38c
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
21 lines
635 B
JavaScript
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
|
|
];
|
|
}
|
|
}
|