Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repo tab sends user to list of all repos #12

Merged
merged 1 commit into from
Dec 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions frontend/src/components/layout/MainSidebar/MainSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

<div class="nav-wrapper">
<d-nav class="flex-column mainSideBarNav">
<li v-for="(item, navItemIdx) in items" :key="navItemIdx" class="nav-item dropdown" @click="checkForRepoRouteChange($event)">
<li v-for="(item, navItemIdx) in items" :key="navItemIdx" class="nav-item dropdown">
<d-link class="mainSideBarLink" :class="['nav-link', item.items && item.items.length ? 'dropdown-toggle' : '']" :to="item.to" v-d-toggle="`snc-${navItemIdx}`">
<div class="item-icon-wrapper" v-if="item.htmlBefore" v-html="item.htmlBefore" />
<span v-if="item.title" class="mainSideBarV">{{ item.title }}</span>
Expand Down Expand Up @@ -130,7 +130,7 @@
}, {
title: 'Repos',
to: {
name: 'group_overview',
name: 'repos',
params: { }
},
htmlBefore: '<i class="material-icons">table_chart</i>',
Expand Down Expand Up @@ -193,19 +193,19 @@
findRepoGroup() {
console.log(Object.keys(this.$store.state.common.apiGroups));
}
checkForRepoRouteChange(e: any) {
console.log(e);
if (e.target.innerHTML !== 'Repos') {
return;
}
let currentlySelectedRepoGroup = Object.keys(this.$store.state.common.apiGroups)[Object.keys(this.$store.state.common.apiGroups).length - 1].split('/')[0];
console.log('HERE: ' + currentlySelectedRepoGroup);
if (currentlySelectedRepoGroup === 'undefined') {
this.$router.push({ name: 'repo_groups' });
} else {
this.$router.push(`/group/${currentlySelectedRepoGroup}/overview`);
}
}
// checkForRepoRouteChange(e: any) {
// console.log(e);
// if (e.target.innerHTML !== 'Repos') {
// return;
// }
// //let currentlySelectedRepoGroup = Object.keys(this.$store.state.common.apiGroups)[Object.keys(this.$store.state.common.apiGroups).length - 1].split('/')[0];
// //console.log('HERE: ' + currentlySelectedRepoGroup);
// //if (currentlySelectedRepoGroup === 'undefined') {
// // this.$router.push({ name: 'repo_groups' });
// //} else {
// this.$router.push(`/repos`);
// //}
// }
}
</script>

Expand Down
39 changes: 21 additions & 18 deletions frontend/src/views/Repos.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
<tbody>
<tr v-for="repo in sortedRepos(sortColumn,ascending)" v-bind:item="repo" :key="repo.url">
<td>
<a href="#" @click="onGitRepo(repo.rg_name, repo.repo_name)">{{ repo.url }}</a>
<router-link tag="a" :to="'/repo/' + repo.rg_name + '/' + repo.repo_name + '/overview'">{{ repo.url }}</router-link>
</td>
<td>{{ repo.rg_name }}</td>
<!-- <td>{{ repo.description }}</td> -->
Expand Down Expand Up @@ -184,23 +184,26 @@ export default class Repos extends Vue{
}
}

onGitRepo (rg_name: String, repo_name: String) {
// this.$router.push({
// name: 'repo_overview',
// params: {group:e.rg_name, repo:e.repo_name, repo_group_id: e.repo_group_id, repo_id: e.repo_id, url:e.url}
// }, () => {
// console.dir(e);
// });
if (rg_name == null || repo_name == null ) {
window.alert('Error - repo name not found in store');
console.log(this.sortedRepos(this.sortColumn,this.ascending));
} else {
this.$router.push(`repo/${rg_name}/${repo_name}/overview`, () => {
console.log(`RG_NAME: ${rg_name}`);
console.log(`REPO_NAME: ${repo_name}`);
});
}
}
// Removed 12/9/2021
// Replaced by router-link element
// If something broke in regards to parameter passing to the router, this could be it
// onGitRepo (rg_name: String, repo_name: String) {
// // this.$router.push({
// // name: 'repo_overview',
// // params: {group:e.rg_name, repo:e.repo_name, repo_group_id: e.repo_group_id, repo_id: e.repo_id, url:e.url}
// // }, () => {
// // console.dir(e);
// // });
// if (rg_name == null || repo_name == null ) {
// window.alert('Error - repo name not found in store');
// console.log(this.sortedRepos(this.sortColumn,this.ascending));
// } else {
// this.$router.push(`repo/${rg_name}/${repo_name}/overview`, () => {
// console.log(`RG_NAME: ${rg_name}`);
// console.log(`REPO_NAME: ${repo_name}`);
// });
// }
// }
}

</script>