Skip to content

Commit 4532177

Browse files
AndriiMyskovitalie
authored andcommitted
[PRD] TCI/Assembla Handshake with SVN/P4 (#2769)
1 parent a61a11b commit 4532177

File tree

12 files changed

+98
-7
lines changed

12 files changed

+98
-7
lines changed

app/components/dashboard-row.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Component from '@ember/component';
2+
import { computed } from '@ember/object';
23
import { inject as service } from '@ember/service';
34
import { alias, reads } from '@ember/object/computed';
45
import { task, timeout } from 'ember-concurrency';
@@ -24,6 +25,21 @@ export default Component.extend({
2425

2526
displayMenuTofu: alias('repo.permissions.create_request'),
2627

28+
repositoryProvider: computed('repo.provider', function () {
29+
return this.repo.provider.capitalize();
30+
}),
31+
32+
repositoryType: computed('repo.serverType', function () {
33+
switch (this.repo.serverType) {
34+
case 'git':
35+
return 'GIT';
36+
case 'subversion':
37+
return 'SVN';
38+
case 'perforce':
39+
return 'P4';
40+
}
41+
}),
42+
2743
openDropup() {
2844
this.set('dropupIsOpen', true);
2945
},

app/components/github-apps-repository.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,21 @@ export default Component.extend({
2222
isMatchGithub: match('vcsType', /Github\S+$/),
2323
isNotMatchGithub: not('isMatchGithub'),
2424

25+
repositoryProvider: computed('repository.provider', function () {
26+
return this.repository.provider.capitalize();
27+
}),
28+
29+
repositoryType: computed('repository.serverType', function () {
30+
switch (this.repository.serverType) {
31+
case 'git':
32+
return 'GIT';
33+
case 'subversion':
34+
return 'SVN';
35+
case 'perforce':
36+
return 'P4';
37+
}
38+
}),
39+
2540
accessSettingsUrl: computed('user.vcsType', 'user.vcsId', function () {
2641
return this.user && vcsLinks.accessSettingsUrl(this.user.vcsType, { owner: this.user.login });
2742
}),

app/components/repository-layout.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,21 @@ export default Component.extend({
1414
currentUser: alias('auth.currentUser'),
1515
userRoMode: reads('currentUser.roMode'),
1616

17+
repositoryProvider: computed('repo.provider', function () {
18+
return this.repo.provider.capitalize();
19+
}),
20+
21+
repositoryType: computed('repo.serverType', function () {
22+
switch (this.repo.serverType) {
23+
case 'git':
24+
return 'GIT';
25+
case 'subversion':
26+
return 'SVN';
27+
case 'perforce':
28+
return 'P4';
29+
}
30+
}),
31+
1732
repoUrl: computed('repo.{ownerName,vcsName,vcsType}', function () {
1833
const owner = this.get('repo.ownerName');
1934
const repo = this.get('repo.vcsName');

app/models/repo.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ const Repo = VcsEntity.extend({
5050
migrationStatus: attr('string'),
5151
historyMigrationStatus: attr('string'),
5252
scanFailedAt: attr('date'),
53+
serverType: attr('string', { defaultValue: 'git' }),
5354

5455
currentScan: computed('scanFailedAt', function () {
5556
let scanFailedAt = this.get('scanFailedAt');

app/models/user.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ export default Owner.extend({
7878
this.set('applyFilterRepos', !isOrganization);
7979
return this.api
8080
.post(`/user/${this.id}/sync`)
81-
.then(() => this.poll(),
82-
() => this.set('isSyncing', false));
81+
.then(() => this.poll());
8382
},
8483

8584
schedulePoll() {
@@ -91,7 +90,7 @@ export default Owner.extend({
9190

9291
poll() {
9392
return this.reload().then(() => {
94-
if (!this.isSyncing) {
93+
if (this.isSyncing) {
9594
this.schedulePoll();
9695
} else {
9796
this.permissionsService.fetchPermissions.perform();

app/routes/settings.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ export default TravisRoute.extend({
4343
fetchSshKey() {
4444
if (config.endpoints.sshKey) {
4545
const repo = this.modelFor('repo');
46+
if (repo.serverType === 'perforce') return;
47+
4648
const url = `/repos/${repo.get('id')}/key`;
4749
return this.api.get(url, { travisApiVersion: null }).then((data) => {
4850
const fingerprint = EmberObject.create({

app/styles/app/layout.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,3 +167,6 @@ $padding-top: 24px;
167167
display: none !important;
168168
}
169169
}
170+
.mr-1_2 {
171+
margin-right: 1.2rem;
172+
}

app/styles/app/layouts/profile.scss

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,13 +220,13 @@ $profile-breakpoint: 600px;
220220
.profile-repo {
221221
display: flex;
222222
position: relative;
223-
flex: 1;
223+
flex: 0;
224224
padding: 0.25em 0.5em 0.3em;
225225
border-radius: 2px;
226-
margin-right: 1rem;
227226

228227
.profile-repo-name {
229228
height: 21px;
229+
white-space: nowrap;
230230
overflow: hidden;
231231
}
232232

@@ -239,6 +239,18 @@ $profile-breakpoint: 600px;
239239
}
240240
}
241241

242+
.profile-repo-type {
243+
display: flex;
244+
flex: 1;
245+
246+
.profile-repo-type-span {
247+
background-color: #d8d8d8;
248+
padding: 2px 6px;
249+
border-radius: 25%;
250+
font-weight: 600;
251+
}
252+
}
253+
242254
.profile-text,
243255
.profile-additional,
244256
.profile-betafeatures {

app/templates/components/dashboard-row.hbs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,16 @@
7070
{{/if}}
7171
</p>
7272
</section>
73+
{{#if (eq this.repo.provider 'assembla')}}
74+
<section class="dash-last">
75+
<h3 class="label">
76+
Repo type
77+
</h3>
78+
<p class="row-content color">
79+
{{this.repositoryType}}
80+
</p>
81+
</section>
82+
{{/if}}
7383
{{#if this.repo.currentBuild}}
7484
<section class="dash-last {{this.repo.currentBuild.state}}">
7585
<h3 class="label">

app/templates/components/github-apps-repository.hbs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@
1313
</span>
1414
{{/if}}
1515
</LinkTo>
16+
{{#if (eq this.repository.provider 'assembla')}}
17+
<span class="profile-repo-type">
18+
<span class="profile-repo-type-span">
19+
{{this.repositoryType}}
20+
<EmberTooltip @text="{{this.repositoryProvider}} {{this.repositoryType}} Repository" />
21+
</span>
22+
</span>
23+
{{/if}}
1624
{{#if this.hasSettingsPermission}}
1725
{{#if this.isNotMatchGithub}}
1826
<TravisSwitch
@@ -60,4 +68,4 @@
6068
{{/if}}
6169
</p>
6270
</div>
63-
{{/if}}
71+
{{/if}}

0 commit comments

Comments
 (0)