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

Ci/test reviewdog #38

Draft
wants to merge 8 commits into
base: dev
Choose a base branch
from
Draft
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
6 changes: 4 additions & 2 deletions web/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ module.exports = {
'@typescript-eslint',
],
rules: {
'import/extensions': 'off',
'import/no-unresolved': 'off',
},
ignorePatterns: [
"dist",
"public"
'dist',
'public',
],
};
3 changes: 2 additions & 1 deletion web/src/modules/point/components/IssueRow.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<template>
<div class="q-py-xs ellipsis">
<span style="display: inline-block; min-width: 100px;">
<span style="display: inline-block; min-width: 100px">
<a
:href="`https://pm.vzota.com.vn/browse/${issue.key}`"
class="link"
target="_blank"
rel="noreferrer"
>
<q-badge
:color="color"
Expand Down
141 changes: 82 additions & 59 deletions web/src/modules/point/components/IssueTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
>
<template v-slot:body-cell-key="props">
<q-td :props="props" class="key">
<a :href="`https://pm.vzota.com.vn/browse/${props.row.key}`" class="link" target="_blank">
<a
:href="`https://pm.vzota.com.vn/browse/${props.row.key}`"
class="link"
target="_blank"
rel="noreferrer"
>
{{ props.value }}
</a>
</q-td>
Expand All @@ -28,77 +33,95 @@
</template>

<script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator';
import { TableColumn, TablePagination } from '@/types/datatable';
import { IIssue } from '@/model/point';
import { Component, Prop, Vue } from 'vue-property-decorator';
import { TableColumn, TablePagination } from '@/types/datatable';
import { IIssue } from '@/model/point';

interface IItem extends IIssue {
projectKey: string;
index: number;
}
interface IItem extends IIssue {
projectKey: string;
index: number;
}

@Component({})
export default class IssueTable extends Vue {
@Prop({ type: Array, required: true }) issues!: IIssue[];
@Component({})
export default class IssueTable extends Vue {
@Prop({ type: Array, required: true }) issues!: IIssue[];

// TODO: implement custom sort for issue's key
columns: Array<TableColumn> = [
{
name: 'key', label: 'Key', field: 'key', align: 'left', sortable: true,
sort: (keyA: string, keyB: string, a: IItem, b: IItem) => {
if (a.projectKey !== b.projectKey) return a.index - b.index;
return a.projectKey.localeCompare(b.projectKey);
},
},
{ name: 'point', label: 'Point', field: 'point', align: 'right', sortable: true },
{
name: 'summary', label: 'Summary', field: 'summary', align: 'left', sortable: true,
// TODO: implement custom sort for issue's key
columns: Array<TableColumn> = [
{
name: 'key',
label: 'Key',
field: 'key',
align: 'left',
sortable: true,
sort: (keyA: string, keyB: string, a: IItem, b: IItem) => {
if (a.projectKey !== b.projectKey) return a.index - b.index;
return a.projectKey.localeCompare(b.projectKey);
},
];
pagination: TablePagination = {
sortBy: 'points', descending: true, rowsPerPage: -1,
};
},
{
name: 'point',
label: 'Point',
field: 'point',
align: 'right',
sortable: true,
},
{
name: 'summary',
label: 'Summary',
field: 'summary',
align: 'left',
sortable: true,
},
];

get rows(): IItem[] {
return this.issues.map((i: IIssue): IItem => {
const ar = i.key.split('-');
return { ...i, projectKey: ar[0], index: Number(ar[1]) };
});
}
pagination: TablePagination = {
sortBy: 'points',
descending: true,
rowsPerPage: -1,
};

get rows(): IItem[] {
return this.issues.map((i: IIssue): IItem => {
const ar = i.key.split('-');
return { ...i, projectKey: ar[0], index: Number(ar[1]) };
});
}

get issueCount() {
return this.issues.length;
}
get issueCount() {
return this.issues.length;
}

get totalPoint() {
return this.issues.map(i => i.point).reduce((p, c) => p + c);
}
get totalPoint() {
return this.issues.map((i) => i.point).reduce((p, c) => p + c);
}
}
</script>

<style lang="scss">
td.key {
cursor: pointer;
}
td.key {
cursor: pointer;
}

a.link {
color: white;
text-decoration: none;
}
a.link {
color: white;
text-decoration: none;
}

.issue-table {
th:first-child, td.key:first-child {
position: sticky;
left: 0;
z-index: 1;
background-color: #161616;
}
.issue-table {
th:first-child,
td.key:first-child {
position: sticky;
left: 0;
z-index: 1;
background-color: #161616;
}

td.sticky {
position: sticky;
left: 0;
z-index: 1;
background-color: #161616;
}
td.sticky {
position: sticky;
left: 0;
z-index: 1;
background-color: #161616;
}
}
</style>
21 changes: 11 additions & 10 deletions web/src/modules/point/components/PointTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@
</template>

<script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator';
import { TableColumn, TablePagination } from '@/types/datatable';
import { IUserPoint } from '@/model/point';
import { Routes } from '@/router/names';
import formatter from '@/utils/formatter';
import { Component, Prop, Vue } from 'vue-property-decorator';
import { TableColumn, TablePagination } from '@/types/datatable';
import { IUserPoint } from '@/model/point';
import { Routes } from '@/router/names';
import formatter from '@/utils/formatter';

@Component
export default class PointTable extends Vue {
export default class PointTable extends Vue {
@Prop({ type: Boolean, required: true }) loading!: boolean;

@Prop({ type: Array, required: true }) users!: IUserPoint[];

columns: Array<TableColumn> = [
Expand All @@ -53,6 +54,7 @@
format: formatter.storyPoint,
},
];

pagination: TablePagination = {
sortBy: 'points',
descending: true,
Expand All @@ -64,11 +66,10 @@
return this.users.sort((a: IUserPoint, b: IUserPoint) => {
if (a.pointTotal !== b.pointTotal) {
return -(a.pointTotal - b.pointTotal);
} else if (a.issues.length !== b.issues.length) {
} if (a.issues.length !== b.issues.length) {
return -(a.issues.length - b.issues.length);
} else {
return a.name > b.name ? 1 : -1;
}
return a.name > b.name ? 1 : -1;
});
} catch (e) {
return [];
Expand All @@ -78,7 +79,7 @@
goToIssues(name: string) {
this.$router.push({ name: Routes.PointIssues, params: { name } });
}
}
}
</script>

<style lang="scss" scoped>
Expand Down
12 changes: 6 additions & 6 deletions web/src/modules/point/components/PointTimeFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@
</template>

<script lang="ts">
import { Component, Vue } from 'vue-property-decorator';
import { PointModule } from '@/store';
import { Month } from '@/types/datetime';
import formatter from '@/utils/formatter';
import { Component, Vue } from 'vue-property-decorator';
import { PointModule } from '@/store';
import { Month } from '@/types/datetime';
import formatter from '@/utils/formatter';

interface MonthItem {
label: string;
value: Month;
}

@Component
export default class PointTimeFilter extends Vue {
export default class PointTimeFilter extends Vue {
months: MonthItem[] = [];

get month(): MonthItem {
Expand Down Expand Up @@ -56,5 +56,5 @@
}
this.months.reverse();
}
}
}
</script>
9 changes: 5 additions & 4 deletions web/src/modules/point/components/ReportTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ import IssueRow from '@/modules/point/components/IssueRow.vue';
})
export default class ReportTable extends Vue {
@Prop({ type: Array, required: true }) points!: IUserPoint[];

@Prop({ type: Boolean, default: false }) loading!: boolean;

columns: TableColumn[] = [
Expand All @@ -103,25 +104,25 @@ export default class ReportTable extends Vue {
align: 'right',
},
];

pagination: TablePagination = {
rowsPerPage: 0,
sortBy: 'name',
};

collapsed = false;

get rows(): IUserPoint[] {
return this.points.map((up: IUserPoint) => ({
...up,
issues: up.issues.sort((a: IIssue, b: IIssue) =>
a.status.localeCompare(b.status)
),
issues: up.issues.sort((a: IIssue, b: IIssue) => a.status.localeCompare(b.status)),
}));
}

onClickHeader(id: string) {
this.collapsed = !this.collapsed;
this.$nextTick().then(() => {
const el = this.$el.querySelector('#' + id)!;
const el = this.$el.querySelector(`#${id}`)!;
el.scrollIntoView();
});
}
Expand Down
3 changes: 2 additions & 1 deletion web/src/modules/point/components/ReportTimeFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@

<script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator';
import { TimeRange } from '@/types/datetime';
import { date } from 'quasar';
import { TimeRange } from '@/types/datetime';

@Component({})
export default class ReportTimeFilter extends Vue {
@Prop({ type: TimeRange, required: true }) range!: TimeRange;

startDate!: string;

created() {
Expand Down
2 changes: 1 addition & 1 deletion web/src/modules/point/views/Issues.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default class Issues extends Vue {
}

get issues() {
const user = PointModule.users.find(u => u.name === this.name);
const user = PointModule.users.find((u) => u.name === this.name);
if (!user) return [];
this.displayName = user.displayName;
return user.issues;
Expand Down