How to use the @jenkins-cd/blueocean-core-js.AppConfig.getRestRoot 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 / PipelineTrends.jsx View on Github external
fetchTrendsData(theProps) {
        const { pipeline } = theProps;
        const baseUrl = `${AppConfig.getRestRoot()}/organizations/${AppConfig.getOrganizationName()}/pipelines/${pipeline.fullName}`;

        let fullUrl;

        if (capable(pipeline, MULTIBRANCH_PIPELINE)) {
            const branchName = this._selectedBranch(theProps, pipeline);
            fullUrl = `${baseUrl}/branches/${encodeURIComponent(branchName)}/trends/`;
        } else {
            fullUrl = `${baseUrl}/trends/`;
        }

        Fetch.fetchJSON(fullUrl).then(data => this._loadTrendsSuccess(data));
    }
github jenkinsci / blueocean-plugin / blueocean-dashboard / src / main / js / credentials / git / GitCredentialsPickerSSH.jsx View on Github external
constructor(props) {
        super(props);
        this.state = {
            credential: null,
            credentialError: null,
        };
        this.restOrgPrefix = AppConfig.getRestRoot() + '/organizations/' + AppConfig.getOrganizationName();
    }
github jenkinsci / blueocean-plugin / blueocean-dashboard / src / main / js / components / karaoke / urls / detailUrl.js View on Github external
export const generateDetailUrl = (pipeline, branch, runId) => {
    const baseUrl = `${AppConfig.getRestRoot()}/organizations/${pipeline.organization}/` + `pipelines/${pipeline.fullName}`;
    const isMultiBranchPipeline = capable(pipeline, MULTIBRANCH_PIPELINE);
    let returnUrl;
    if (isMultiBranchPipeline) {
        returnUrl = `${baseUrl}/branches/${UrlUtils.doubleUriEncode(branch)}/runs/${runId}`;
    } else {
        returnUrl = `${baseUrl}/runs/${runId}`;
    }
    logger.debug(returnUrl);
    return returnUrl;
};