Skip to content

Commit fab30bc

Browse files
committed
make sortable
1 parent ddbf211 commit fab30bc

File tree

3 files changed

+22
-10
lines changed

3 files changed

+22
-10
lines changed

public/permissions.png

42.9 KB
Loading

src/pages/Dashboard.vue

+8-3
Original file line numberDiff line numberDiff line change
@@ -187,18 +187,23 @@ export default class PageDashboard extends Vue {
187187
}
188188
189189
async switchState(state: string, pr: BitbucketPullRequest, repo: string) {
190-
const newTitle = `[${state}]${this.trimTitle(pr.title)}`;
190+
const newTitle =
191+
state === 'READY'
192+
? this.trimTitle(pr.title)
193+
: `[${state}]${this.trimTitle(pr.title)}`;
191194
if (newTitle === pr.title) {
192195
return;
193196
}
194197
this.loading = true;
195198
try {
196199
await this.$store.dispatch('bitbucket/setPullRequestTitle', {
197200
pullRequest: pr,
198-
repository: repo,
199-
workspace: this.currentWorkspace,
200201
title: newTitle
201202
});
203+
await this.$store.dispatch('bitbucket/updateRepositoryPullRequests', {
204+
repository: repo,
205+
workspace: this.currentWorkspace
206+
});
202207
} catch (e) {
203208
this.$q.notify('Update pull request state failed');
204209
}

src/store/bitbucket/actions.ts

+14-7
Original file line numberDiff line numberDiff line change
@@ -94,27 +94,34 @@ const actions: ActionTree<BitbucketStateInterface, StateInterface> = {
9494
pullRequestList: result
9595
});
9696
},
97-
async setPullRequestTitle(
97+
async updateRepositoryPullRequests(
9898
context,
9999
{
100-
title,
101-
pullRequest,
102100
workspace,
103101
repository
104102
}: {
105-
title: string;
106-
repository: string;
107103
workspace: BitbucketWorkspace;
108-
pullRequest: BitbucketPullRequest;
104+
repository: string;
109105
}
110106
) {
111-
await bitbucket.put(pullRequest.links.self.href, { title });
112107
await context.dispatch('loadPullRequests', {
113108
workspace,
114109
repository: repository
115110
});
116111
await context.dispatch('updateBuildStatuses', { repository });
117112
},
113+
async setPullRequestTitle(
114+
context,
115+
{
116+
title,
117+
pullRequest
118+
}: {
119+
title: string;
120+
pullRequest: BitbucketPullRequest;
121+
}
122+
) {
123+
await bitbucket.put(pullRequest.links.self.href, { title });
124+
},
118125
async updateShowRepositories(
119126
context,
120127
{

0 commit comments

Comments
 (0)