Skip to content

Commit

Permalink
add templates to repo settings (#385)
Browse files Browse the repository at this point in the history
* add templates to repo settings

* change yml to yaml
  • Loading branch information
Dan Wilson authored Sep 22, 2021
1 parent 52359b2 commit ed60163
Show file tree
Hide file tree
Showing 8 changed files with 4,497 additions and 1,294 deletions.
5,215 changes: 3,922 additions & 1,293 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"dependencies": {
"@emotion/core": "^10.1.1",
"@emotion/styled": "^10.0.27",
"@monaco-editor/react": "^4.2.2",
"@projectstorm/react-diagrams": "^6.0.1-beta.7",
"ansi_up": "^4.0.4",
"axios": "^0.21.0",
Expand Down Expand Up @@ -56,7 +57,7 @@
"husky": "^4.3.5",
"lint-staged": "^10.5.3",
"node-sass": "^4.14.1",
"react-scripts": "^4.0.1",
"react-scripts": "^4.0.3",
"stylelint": "^13.8.0",
"stylelint-config-css-modules": "^2.2.0",
"stylelint-config-recess-order": "^2.3.0",
Expand Down
2 changes: 2 additions & 0 deletions src/hooks/swr/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import useCrons from './use-crons';
import useDeployments from './use-deployments';
import useOrgSecrets from './use-org-secrets';
import useSecrets from './use-secrets';
import useTemplates from './use-templates';
import { useUserList } from './user';
import { useViewer, useViewerToken, useSyncAccount } from './viewer';

Expand All @@ -29,4 +30,5 @@ export {
useStreamBuildEvents,
useStreamLogs,
useUserList,
useTemplates,
};
3 changes: 3 additions & 0 deletions src/hooks/swr/use-templates.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import useSWRBase from './use-swr-base';

export default ({ namespace }) => useSWRBase(`/api/templates/${namespace}`);
11 changes: 11 additions & 0 deletions src/pages/settings/settings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import Cron from './cron';
import General from './general';
import { Secrets, OrgSecrets } from './secrets';
import styles from './settings.module.scss';
import Templates from './templates';

const cx = classNames.bind(styles);

Expand Down Expand Up @@ -128,6 +129,14 @@ export default function Settings({ user, repo }) {
>
Secrets
</NavLink>
<NavLink
className={cx('settings-nav-item')}
activeClassName={cx('settings-nav-item-active')}
to={`/${namespace}/${name}/settings/templates`}
exact
>
Templates
</NavLink>
</nav>
</aside>
<Switch>
Expand All @@ -140,6 +149,8 @@ export default function Settings({ user, repo }) {
<Route path="/:namespace/:name/settings/cron" component={Cron} />
<Route path="/:namespace/:name/settings/badges" component={Badges} />
<Route path="/:namespace/:name/settings/org-secrets" component={OrgSecrets} />
<Route path="/:namespace/:name/settings/templates" component={Templates} />

</Switch>
</section>
) : (
Expand Down
1 change: 1 addition & 0 deletions src/pages/settings/templates/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './templates';
Loading

0 comments on commit ed60163

Please sign in to comment.