-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9f35ba5
commit 12f35d2
Showing
8 changed files
with
923 additions
and
615 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import { | ||
createFrontendPlugin, | ||
PageBlueprint, | ||
ApiBlueprint, | ||
createApiFactory, | ||
} from '@backstage/frontend-plugin-api'; | ||
import React from 'react'; | ||
|
||
import { rootRouteRef } from './routes'; | ||
import { | ||
compatWrapper, | ||
convertLegacyRouteRef, | ||
} from '@backstage/core-compat-api'; | ||
import { GitlabCIApiRef, GitlabCIClient } from './api'; | ||
import { | ||
configApiRef, | ||
discoveryApiRef, | ||
gitlabAuthApiRef, | ||
identityApiRef, | ||
} from '@backstage/core-plugin-api'; | ||
|
||
const gitlabAPI = ApiBlueprint.make({ | ||
params: { | ||
factory: createApiFactory({ | ||
api: GitlabCIApiRef, | ||
deps: { | ||
configApi: configApiRef, | ||
discoveryApi: discoveryApiRef, | ||
identityApi: identityApiRef, | ||
gitlabAuthApi: gitlabAuthApiRef, | ||
}, | ||
factory: ({ | ||
configApi, | ||
discoveryApi, | ||
identityApi, | ||
gitlabAuthApi, | ||
}) => | ||
GitlabCIClient.setupAPI({ | ||
discoveryApi, | ||
identityApi, | ||
codeOwnersPath: configApi.getOptionalString( | ||
'gitlab.defaultCodeOwnersPath' | ||
), | ||
readmePath: configApi.getOptionalString( | ||
'gitlab.defaultReadmePath' | ||
), | ||
gitlabAuthApi, | ||
useOAuth: configApi.getOptionalBoolean('gitlab.useOAuth'), | ||
}), | ||
}), | ||
}, | ||
}); | ||
|
||
export default createFrontendPlugin({ | ||
id: 'Gitlab', | ||
// bind all the extensions to the plugin | ||
extensions: [gitlabAPI], | ||
}); | ||
|
||
export const EntityGitlabContent = PageBlueprint.make({ | ||
name: 'EntityGitlabContent', | ||
params: { | ||
// you can reuse the existing routeRef | ||
// by wrapping into the convertLegacyRouteRef. | ||
routeRef: convertLegacyRouteRef(rootRouteRef), | ||
defaultPath: '/gitlab', | ||
// these inputs usually match the props required by the component. | ||
loader: () => | ||
import('./components/GitlabCI').then((m) => | ||
compatWrapper(<m.GitlabCI />) | ||
), | ||
}, | ||
}); | ||
|
||
export { | ||
LanguagesCard as EntityGitlabLanguageCard, | ||
PeopleCard as EntityGitlabPeopleCard, | ||
MergeRequestsTable as EntityGitlabMergeRequestsTable, | ||
MergeRequestStats as EntityGitlabMergeRequestStatsCard, | ||
PipelinesTable as EntityGitlabPipelinesTable, | ||
ReleasesCard as EntityGitlabReleasesCard, | ||
CoverageCard as EntityGitlabCoverageCard, | ||
IssuesTable as EntityGitlabIssuesTable, | ||
ReadmeCard as EntityGitlabReadmeCard, | ||
} from './components/widgets/index'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.