Skip to content

Commit

Permalink
feat(ui): add more info from github (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
marianfoo committed Mar 30, 2022
1 parent e46471d commit f89113a
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 13 deletions.
2 changes: 1 addition & 1 deletion crawler/src/gh-repos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export default class GitHubRepositoriesProvider {
packageJson.stars = repoInfo.stars;
packageJson.updatedAt = repoInfo.updatedAt;
packageJson.createdAt = repoInfo.createdAt;
packageJson.link = repoInfo.link;
packageJson.link = `${repoInfo.link}/tree/main/${source.subpath}/${packageContent.name}`;
try {
const readme = await GitHubRepositoriesProvider.octokit.rest.repos.getContent({
mediaType: {
Expand Down
3 changes: 3 additions & 0 deletions uimodule/src/Component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ export default class Component extends UIComponent {
// call the base component's init function
super.init();

// force english language
sap.ui.getCore().getConfiguration().setLanguage("en");

// create the views based on the url/hash
this.getRouter().initialize();

Expand Down
12 changes: 6 additions & 6 deletions uimodule/src/control/PackageListItemContent.control.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
<tnt:InfoLabel id="trend-item-type" class="sapUiTinyMarginEnd" text="{$this>type}" renderMode="Narrow"
colorScheme="2" displayOnly="false" />

<tnt:InfoLabel id="trend-item-tag3" class="sapUiTinyMarginEnd" text="{$this>tags/0}" renderMode="Narrow"
colorScheme="5" displayOnly="false" visible="{= !!${$this>tags/0} }" />
<tnt:InfoLabel id="trend-item-tag3" class="sapUiTinyMarginEnd" text=" STARS {$this>stars}" renderMode="Narrow"
colorScheme="5" displayOnly="false" visible="{= !!${$this>stars} }" />

<tnt:InfoLabel id="trend-item-tag1" class="sapUiTinyMarginEnd" text="{$this>tags/1}" renderMode="Narrow"
colorScheme="5" displayOnly="false" visible="{= !!${$this>tags/1} }" />
<tnt:InfoLabel id="trend-item-tag1" class="sapUiTinyMarginEnd" text="FORKS {$this>forks}" renderMode="Narrow"
colorScheme="5" displayOnly="false" visible="{= !!${$this>forks} }" />

<tnt:InfoLabel id="trend-item-tag2" class="sapUiTinyMarginEnd" text="{$this>tags/2}" renderMode="Narrow"
colorScheme="5" displayOnly="false" visible="{= !!${$this>tags/2} }" />

<!-- <tnt:InfoLabel id="trend-item-last-update" class="sapUiTinyMarginEnd" renderMode="Narrow" colorScheme="6"
<tnt:InfoLabel id="trend-item-last-update" class="sapUiTinyMarginEnd" renderMode="Narrow" colorScheme="6"
displayOnly="false" text="{= ${i18n>listItemTagUpdated}.replace('{0}', ${
path: '$this>updatedAt',
type: 'sap.ui.model.type.Date',
Expand All @@ -47,7 +47,7 @@
relativeScale: 'auto',
relativeStyle: 'wide'
}
}) }" visible="{= !!${$this>createdAt} }" /> -->
}) }" visible="{= !!${$this>createdAt} }" />
</HBox>
</VBox>

Expand Down
2 changes: 2 additions & 0 deletions uimodule/src/control/PackageListItemContent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ export default class PackageListItemContent extends XMLComposite {
link: { type: "string" },
type: { type: "string" },
tags: { type: "array" },
stars: { type: "string" },
forks: { type: "string" },
createdAt: { type: "Date" },
updatedAt: { type: "Date" },
rank: { type: "int" },
Expand Down
4 changes: 2 additions & 2 deletions uimodule/src/i18n/i18n_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ app_description=Description of com.sap.ui5community
#XTIT: Main view title
title=ui5community Packages

listItemTagUpdated=listItemTagUpdated
listItemTagCreated=listItemTagCreated
listItemTagCreated=Created {0}
listItemTagUpdated=Updated {0}
2 changes: 1 addition & 1 deletion uimodule/src/model/packages.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion uimodule/src/model/types.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"name":"app"},{"name":"middleware"},{"name":"task"},{"name":"tooling"}]
[{"name":"app"},{"name":"middleware"},{"name":"task"},{"name":"tooling"},{"name":"cc"}]
6 changes: 4 additions & 2 deletions uimodule/src/view/Main.view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@
</MultiInput>
<List id="_IDGenList1" headerText="Packages" mode="None" items="{path: 'packages>/'}">
<CustomListItem id="_IDGenCustomListItem1" type="Navigation" press="onPress">
<ui5cc:PackageListItemContent name="{packages>name}" description="{
<ui5cc:PackageListItemContent name="{packages>name}" link="{packages>link}" description="{
parts: ['packages>description', 'settings>/search'],
formatter: '.formatter.formatHighlight'
}" type="{packages>type}"/>
}" type="{packages>type}" stars="{packages>stars}" forks="{packages>forks}"
updatedAt="{packages>updatedAt}" createdAt="{packages>createdAt}"
/>
</CustomListItem>
<layoutData>
<FlexItemData minWidth="{= ${device>/system/phone} === true ? '' : '800px' }" />
Expand Down

0 comments on commit f89113a

Please sign in to comment.