How to use the @jenkins-cd/blueocean-core-js.UrlBuilder.buildPipelineUrl 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 / RunDetails.jsx View on Github external
afterClose = () => {
        const { router, params } = this.context;
        router.push(UrlBuilder.buildPipelineUrl(params.organization, params.pipeline));
    };
github jenkinsci / blueocean-plugin / blueocean-dashboard / src / main / js / components / Activity.jsx View on Github external
navigateToBranch = branch => {
        const organization = this.context.params.organization;
        const pipeline = this.context.params.pipeline;
        const baseUrl = UrlBuilder.buildPipelineUrl(organization, pipeline);
        let activitiesURL = `${baseUrl}/activity`;
        if (branch) {
            activitiesURL += '?branch=' + encodeURIComponent(branch);
        }
        this.context.router.push(activitiesURL);
    };
github jenkinsci / blueocean-plugin / blueocean-pipeline-editor / src / main / js / EditorPage.jsx View on Github external
goToActivity() {
        const { organization, pipeline, branch } = this.props.params;
        const { router } = this.context;
        const location = UrlBuilder.buildPipelineUrl(organization, pipeline);
        activityService.removeItem(activityService.pagerKey(organization, pipeline, branch));
        router.push(location);
    }
github jenkinsci / blueocean-plugin / blueocean-dashboard / src / main / js / components / PipelinePage.jsx View on Github external
const orgUrl = UrlBuilder.buildOrganizationUrl(organizationName);
        const activityUrl = UrlBuilder.buildPipelineUrl(organizationName, fullName, 'activity');
        const isReady = !!pipeline;

        if (!pipeline && this.error) {
            logger.log(`Error finding pipeline page for ${fullName}.`, this.error);
            return ;
        }

        if (isReady) {
            setTitle(`${organizationDisplayName} / ${name}`);
        } else {
            setTitle(translate('common.pager.loading', { defaultValue: 'Loading...' }));
        }

        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 && {translate('pipelinedetail.common.tab.trends', { defaultValue: 'Trends' })},
        ];

        const pageHeader = isReady ? (
            
                
                <h1>
                    {AppConfig.showOrg() &amp;&amp; (
                        <span>
                            </span></h1>
github jenkinsci / blueocean-plugin / blueocean-dashboard / src / main / js / components / Activity.jsx View on Github external
this.createPipeline()}&gt;
                                {t('creation.git.step1.create_button')}
                            
                        }
                    /&gt;
                );
            }
            if (!runs || !runs.length) {
                if (!isMultiBranchPipeline) {
                    return ;
                } else if (!branch) {
                    const { params } = this.context;
                    const branchesUrl = UrlBuilder.buildPipelineUrl(params.organization, params.pipeline, 'branches');
                    return ;
                }
            }
        }

        const showTable = branch || (runs &amp;&amp; runs.length &gt; 0);
        const head = 'pipelinedetail.activity.header';

        const status = t(`${head}.status`, { defaultValue: 'Status' });
        const runHeader = t(`${head}.run`, { defaultValue: 'Run' });
        const commit = t(`${head}.commit`, { defaultValue: 'Commit' });
        const message = t(`${head}.message`, { defaultValue: 'Message' });
        const duration = t(`${head}.duration`, { defaultValue: 'Duration' });
        const completed = t(`${head}.completed`, { defaultValue: 'Completed' });
        const branchText = t(`${head}.branch`, { defaultValue: 'Branch' });
        const decodedBranchName = branch ? decodeURIComponent(branch) : branch;
github jenkinsci / blueocean-plugin / blueocean-dashboard / src / main / js / creation / git / GitCompletedStep.jsx View on Github external
finish() {
        const pipeline = this.props.flowManager.pipeline;
        const url = UrlBuilder.buildPipelineUrl(pipeline.organization, pipeline.fullName, 'activity');
        this.props.flowManager.completeFlow({ url });
    }
github jenkinsci / blueocean-plugin / blueocean-dashboard / src / main / js / components / PipelineTrends.jsx View on Github external
navigateToBranch = branch => {
        const organization = this.props.params.organization;
        const pipeline = this.props.params.pipeline;
        const baseUrl = UrlBuilder.buildPipelineUrl(organization, pipeline);
        let activitiesURL = `${baseUrl}/trends`;
        if (branch) {
            activitiesURL += '?branch=' + encodeURIComponent(branch);
        }
        this.context.router.push(activitiesURL);
    };
github jenkinsci / blueocean-plugin / blueocean-dashboard / src / main / js / components / PipelinePage.jsx View on Github external
render() {
        const pipeline = this.context.pipelineService.getPipeline(this.href);

        const { setTitle } = this.props;
        const { location = {} } = this.context;

        const { organization, name, fullName, fullDisplayName } = pipeline || {};

        const organizationName = organization || AppConfig.getOrganizationName();
        const organizationDisplayName = organization === AppConfig.getOrganizationName() ? AppConfig.getOrganizationDisplayName() : organization;

        const orgUrl = UrlBuilder.buildOrganizationUrl(organizationName);
        const activityUrl = UrlBuilder.buildPipelineUrl(organizationName, fullName, 'activity');
        const isReady = !!pipeline;

        if (!pipeline &amp;&amp; this.error) {
            logger.log(`Error finding pipeline page for ${fullName}.`, this.error);
            return ;
        }

        if (isReady) {
            setTitle(`${organizationDisplayName} / ${name}`);
        } else {
            setTitle(translate('common.pager.loading', { defaultValue: 'Loading...' }));
        }

        const baseUrl = UrlBuilder.buildPipelineUrl(organizationName, fullName);
        const trendsEnabled = AppConfig.isFeatureEnabled('trends');
github jenkinsci / blueocean-plugin / blueocean-dashboard / src / main / js / components / RunDetails.jsx View on Github external
navigateToPipeline = () => {
        const { organization, fullName } = this.props.pipeline;
        const { location } = this.context;
        const pipelineUrl = UrlBuilder.buildPipelineUrl(organization, fullName);
        location.pathname = pipelineUrl;
        this.context.router.push(location);
    };