How to use the @jenkins-cd/blueocean-core-js.AppConfig.showOrg function in @jenkins-cd/blueocean-core-js

To help you get started, we’ve selected a few @jenkins-cd/blueocean-core-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jenkinsci / blueocean-plugin / blueocean-dashboard / src / main / js / components / RunDetailsHeader.jsx View on Github external
const displayName = decodeURIComponent(run.pipeline);

        // Messages
        const branchLabel = run.pullRequest
            ? t('rundetail.header.pullRequest', { defaultValue: 'Pull Request' })
            : t('rundetail.header.branch', { defaultValue: 'Branch' });
        const commitLabel = t('rundetail.header.commit', { defaultValue: 'Commit' });
        const dateFormatShort = t('common.date.readable.short', { defaultValue: 'MMM DD h:mma Z' });
        const dateFormatLong = t('common.date.readable.long', { defaultValue: 'MMM DD YYYY h:mma Z' });

        const activityUrl = `${UrlBuilder.buildPipelineUrl(run.organization, pipeline.fullName)}/activity`;

        // Sub-trees
        const title = (
            <h1>
                {AppConfig.showOrg() &amp;&amp; (
                    <span>
                        <a>
                            {run.organization === AppConfig.getOrganizationName() ? AppConfig.getOrganizationDisplayName() : run.organization}
                        </a>
                        <span>&nbsp;/&nbsp;</span>
                    </span>
                )}
                
                    
                
                
            </h1>
        );

        const branchUrl = `${UrlBuilder.buildPipelineUrl(run.organization, pipeline.fullName)}/activity?branch=${run.pipeline}`;
        const labelClassName = run.pullRequest ? 'pullRequest' : '';
github jenkinsci / blueocean-plugin / blueocean-personalization / src / main / js / components / PipelineCard.jsx View on Github external
if (latestRun) {
            status = latestRun.result === 'UNKNOWN' ? latestRun.state : latestRun.result;
            startTime = latestRun.startTime;
            estimatedDuration = latestRun.estimatedDurationInMillis;
            commitId = latestRun.commitId;
        } else {
            status = 'NOT_BUILT';
        }

        const commitText = commitId ? commitId.substr(0, 7) : '';

        const activityUrl = `/organizations/${encodeURIComponent(organizationName)}/` + `${encodeURIComponent(names.fullName)}/activity`;

        let displayPath;
        if (AppConfig.showOrg()) {
            displayPath = `${organizationDisplayName}/${fullDisplayName}`;
        } else {
            displayPath = fullDisplayName;
        }

        // Calculate datetime of last run

        // we need to make sure that we calculate with the correct time offset
        const skewMillis = this.context.config.getServerBrowserTimeSkewMillis();

        const dateFormatShort = t('common.date.readable.short', { defaultValue: 'MMM DD h:mma Z' });
        const dateFormatLong = t('common.date.readable.long', { defaultValue: 'MMM DD YYYY h:mma Z' });

        let runDateTime = null;

        if (latestRun) {
github jenkinsci / blueocean-plugin / blueocean-dashboard / src / main / js / components / Pipelines.jsx View on Github external
pipelines.map(pipeline =&gt; {
                const key = pipeline._links.self.href;
                return ;
            });

        this.props.setTitle('Jenkins');

        return (
            
                
                    <div>
                        
                            <h1>
                                {translate('home.header.dashboard', { defaultValue: 'Dashboard' })}
                                {AppConfig.showOrg() &amp;&amp; organizationName &amp;&amp; ' / '}
                                {AppConfig.showOrg() &amp;&amp; organizationName &amp;&amp; orgLink}
                            </h1>
                        

                        <div>
                            <div>
                                
                            </div>
                            <input placeholder="Search pipelines..." value="{this.state.searchText}"> {
                                    this.onChange(e.target.value ? e.target.value : '');
                                }}
                            /&gt;
                            <div></div></div></div>
github jenkinsci / blueocean-plugin / blueocean-dashboard / src / main / js / components / PipelinePage.jsx View on Github external
const baseUrl = UrlBuilder.buildPipelineUrl(organizationName, fullName);
        const trendsEnabled = AppConfig.isFeatureEnabled('trends');

        const pageTabLinks = [
            {translate('pipelinedetail.common.tab.activity', { defaultValue: 'Activity' })},
            {translate('pipelinedetail.common.tab.branches', { defaultValue: 'Branches' })},
            {translate('pipelinedetail.common.tab.pullrequests', { defaultValue: 'Pull Requests' })},
            trendsEnabled &amp;&amp; {translate('pipelinedetail.common.tab.trends', { defaultValue: 'Trends' })},
        ];

        const pageHeader = isReady ? (
            
                
                <h1>
                    {AppConfig.showOrg() &amp;&amp; (
                        <span>
                            
                                {organizationDisplayName}
                            
                            <span>&nbsp;/&nbsp;</span>
                        </span>
                    )}
                    
                        
                    
                </h1>
                
                {classicConfigLink(pipeline)}
            
        ) : (
github jenkinsci / blueocean-plugin / blueocean-dashboard / src / main / js / components / Pipelines.jsx View on Github external
pipelines.map(pipeline =&gt; {
                const key = pipeline._links.self.href;
                return ;
            });