mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 22:43:30 +03:00
e93f6071cd
refs https://github.com/TryGhost/Team/issues/1932 - removes null sources from attribution chart - moves null sources count to bottom of attribution table
21 lines
627 B
JavaScript
21 lines
627 B
JavaScript
import Component from '@glimmer/component';
|
|
import {inject as service} from '@ember/service';
|
|
|
|
export default class SourceAttributionTable extends Component {
|
|
@service membersUtils;
|
|
|
|
get sources() {
|
|
const availableSources = this.args.sources.filter(source => source.source);
|
|
const unavailableSources = this.args.sources.filter(sourceData => !sourceData.source).map((sourceData) => {
|
|
return {
|
|
...sourceData,
|
|
source: 'Unavailable'
|
|
};
|
|
});
|
|
return [
|
|
...availableSources,
|
|
...unavailableSources
|
|
];
|
|
}
|
|
}
|