<commit_before>import Component from '@glimmer/component';
import {action} from '@ember/object';
import {formatPostTime} from 'ghost-admin/helpers/gh-format-post-time';
import {inject as service} from '@ember/service';
import {tracked} from '@glimmer/tracking';

export default class PostsListItemClicks extends Component {
    @service feature;
    @service session;
    @service settings;

    @tracked isHovered = false;

    get scheduledText() {
        let {post} = this.args;
        let text = [];

        let formattedTime = formatPostTime(
            post.publishedAtUTC,
            {timezone: this.settings.get('timezone'), scheduled: true}
        );
        text.push(formattedTime);

        return text.join(' ');
    }

    get isAnalytics() {
        return ((!this.session.user.isContributor) && this.args.post.isPost && (this.args.post.isSent || this.args.post.isPublished) && (this.settings.get('emailTrackClicks') || this.feature.get('memberAttribution')));
    }

    get routeForLink() {
        if (this.isAnalytics) {
            return 'posts.analytics';
        }
        return 'editor.edit';
    }

    get modelsForLink() {
        if (this.isAnalytics) {
            return [this.args.post];
        }
        return [this.args.post.displayName, this.args.post.id];<commit_msg>Hidden analytics page button for published post when attribution is disabled<commit_after>import Component from '@glimmer/component';
import {action} from '@ember/object';
import {formatPostTime} from 'ghost-admin/helpers/gh-format-post-time';
import {inject as service} from '@ember/service';
import {tracked} from '@glimmer/tracking';

export default class PostsListItemClicks extends Component {
    @service feature;
    @service session;
    @service settings;

    @tracked isHovered = false;

    get scheduledText() {
        let {post} = this.args;
        let text = [];

        let formattedTime = formatPostTime(
            post.publishedAtUTC,
            {timezone: this.settings.get('timezone'), scheduled: true}
        );
        text.push(formattedTime);

        return text.join(' ');
    }

    get isAnalytics() {
        return !this.session.user.isContributor
            && this.args.post.isPost
            && (
                (
                    // We have clicks or opens data
                    (this.args.post.isSent || (this.args.post.isPublished && this.args.post.email)) 
                        && (this.settings.get('emailTrackClicks') || this.settings.get('emailTrackOpens'))
                ) 
                || (
                    // We have attribution data for pubished posts
                    this.args.post.isPublished && this.feature.get('memberAttribution')
                )
            );
    }

    get routeForLink() {
        if (this.isAnalytics) {
            return 'posts.analytics';
        }
        return 'editor.edit';
    }

    get modelsForLink() {
        if (this.isAnalytics) {
            return [this.args.post];
        }
        return [this.args.post.displayName, this.args.post.id];
{'fraction_non_alphanumeric': 0.12426805465191933, 'fraction_numerical': 0.0, 'mean_word_length': 2.203125, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '370698', 'n_tokens_mistral': 893, 'n_tokens_neox': 857, 'n_words': 187}