How to use the @jenkins-cd/blueocean-core-js.UrlConfig.getBlueOceanAppURL 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-pipeline-editor / src / main / js / services / PipelineMetadataService.js View on Github external
_fetch(method, handler, mapper) {
        if (this.cache[method]) {
            handler(this.cache[method]);
            return;
        }
        Fetch.fetchJSON(`${UrlConfig.getBlueOceanAppURL()}/rest/pipeline-metadata/${method}?depth=20`).then(data => {
            if (mapper) {
                data = mapper(data);
            }
            this.cache[method] = data;
            handler(this.cache[method]);
        });
    }
github jenkinsci / blueocean-plugin / blueocean-personalization / src / main / js / redux / FavoritesActions.jsx View on Github external
return (dispatch) => {
            const baseUrl = UrlConfig.getBlueOceanAppURL();
            const username = user.id;
            const organization = AppConfig.getOrganizationName();
            const url = cleanSlashes(`${baseUrl}/rest/organizations/${organization}/users/${username}/favorites/`);
            if (fetchFlags[ACTION_TYPES.SET_FAVORITES]) {
                return null;
            }

            fetchFlags[ACTION_TYPES.SET_FAVORITES] = true;

            return dispatch(actions.generateData(
                { url },
                ACTION_TYPES.SET_FAVORITES
            ));
        };
    },
github jenkinsci / blueocean-plugin / blueocean-personalization / src / main / js / model / FavoriteStore.js View on Github external
get favorites() {
        if (!this._fetched) {
            const user = User.current();
            this._fetched = true;
            if (user && !user.isAnonymous()) {
                const baseUrl = UrlConfig.getBlueOceanAppURL();
                const username = user.id;
                const organization = AppConfig.getOrganizationName();
                const url = cleanSlashes(`${baseUrl}/rest/organizations/${organization}/users/${username}/favorites/?start=0&limit=26`);
                this.fetch(url).then(favorites => this._setFavorites(sortHelper.applyStandardSort(favorites)));
            }
        }
        return this._favorites;
    }
github jenkinsci / blueocean-plugin / src / main / js / services / PipelineStepListStore.js View on Github external
getStepListing(handler) {
        if (this.stepData) {
            handler(this.stepData);
            return;
        }
        Fetch.fetchJSON(`${UrlConfig.getBlueOceanAppURL()}/rest/pipeline-metadata/pipelineStepMetadata?depth=20`).then(data => {
            this.stepData = this.filterStepListing(data);
            handler(this.stepData);
        });
    }
    filterStepListing(steps) {