Skip to content

Commit

Permalink
feat: add a issue template to add a new package (#54)
Browse files Browse the repository at this point in the history
* feat: add new issue template

* fix link to github issue tempalte
  • Loading branch information
marianfoo committed Apr 3, 2022
1 parent 376281d commit cad1f52
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: true
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/new_package.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: "\U0001F680 Add new package"
about: Add your new package to the website

---
# Add new NPM Package

Please make sure to fulfill this:

## Prerequisites

* [ ] Add link to your GitHub Repo in `package.json`
* [ ] Add a license to your project.
* [ ] Add Keywords to your `package.json`.
* [ ] NPM Moduel published with current version.
13 changes: 9 additions & 4 deletions uimodule/src/controller/IconTabHeaderControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ export default class IconTabHeaderControl {

switch (oTabKey) {
case "hot":
that.getOwnerComponent().getModel("settings").setProperty("/packagesVisible", true);
that.getOwnerComponent().getModel("settings").setProperty("/tagsVisible", false);
this.setViewToPackages(true, that);
that.getRouter().getHashChanger().setHash("");
let oSorterHot = new Sorter({
path: "downloads",
Expand All @@ -19,22 +18,23 @@ export default class IconTabHeaderControl {
binding.sort(oSorterHot);
break;
case "recently":
this.setViewToPackages(true, that);
let oSorterRecent = new Sorter({
path: "createdAt",
descending: true,
});
binding.sort(oSorterRecent);
break;
case "all":
this.setViewToPackages(true, that);
let oSorterAll = new Sorter({
path: "downloads",
descending: true,
});
binding.sort(oSorterAll);
break;
case "tags":
that.getOwnerComponent().getModel("settings").setProperty("/packagesVisible", false);
that.getOwnerComponent().getModel("settings").setProperty("/tagsVisible", true);
this.setViewToPackages(false, that);
that.getRouter().getHashChanger().setHash("tags");
break;
default: {
Expand All @@ -43,4 +43,9 @@ export default class IconTabHeaderControl {
}
}
}

private static setViewToPackages(setToPackageView, that): void {
that.getOwnerComponent().getModel("settings").setProperty("/packagesVisible", setToPackageView);
that.getOwnerComponent().getModel("settings").setProperty("/tagsVisible", !setToPackageView);
}
}
7 changes: 7 additions & 0 deletions uimodule/src/view/IconTabHeader.fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,11 @@
</items>
</IconTabHeader>
<ToolbarSpacer/>
<Button
core:require="{ sapMLib: 'sap/m/library' }"
text="Add your own package"
type="Emphasized"
icon="sap-icon://add-product"
press="sapMLib.URLHelper.redirect('https://github.com/ui5-community/ui5-community.github.io/issues/new?assignees=&amp;labels=new%20package&amp;template=new_package.md&amp;title=Add%20new%20package:', true)"
/>
</core:FragmentDefinition>

0 comments on commit cad1f52

Please sign in to comment.