diff --git a/app/components/dashboard-row.js b/app/components/dashboard-row.js index 94636c81aa..afec5b4805 100644 --- a/app/components/dashboard-row.js +++ b/app/components/dashboard-row.js @@ -1,4 +1,5 @@ import Component from '@ember/component'; +import { computed } from '@ember/object'; import { inject as service } from '@ember/service'; import { alias, reads } from '@ember/object/computed'; import { task, timeout } from 'ember-concurrency'; @@ -24,6 +25,21 @@ export default Component.extend({ displayMenuTofu: alias('repo.permissions.create_request'), + repositoryProvider: computed('repo.provider', function () { + return this.repo.provider.capitalize(); + }), + + repositoryType: computed('repo.serverType', function () { + switch (this.repo.serverType) { + case 'git': + return 'GIT'; + case 'subversion': + return 'SVN'; + case 'perforce': + return 'P4'; + } + }), + openDropup() { this.set('dropupIsOpen', true); }, diff --git a/app/components/github-apps-repository.js b/app/components/github-apps-repository.js index 5025b17d36..22e0aa95d6 100644 --- a/app/components/github-apps-repository.js +++ b/app/components/github-apps-repository.js @@ -22,6 +22,21 @@ export default Component.extend({ isMatchGithub: match('vcsType', /Github\S+$/), isNotMatchGithub: not('isMatchGithub'), + repositoryProvider: computed('repository.provider', function () { + return this.repository.provider.capitalize(); + }), + + repositoryType: computed('repository.serverType', function () { + switch (this.repository.serverType) { + case 'git': + return 'GIT'; + case 'subversion': + return 'SVN'; + case 'perforce': + return 'P4'; + } + }), + accessSettingsUrl: computed('user.vcsType', 'user.vcsId', function () { return this.user && vcsLinks.accessSettingsUrl(this.user.vcsType, { owner: this.user.login }); }), diff --git a/app/components/repository-layout.js b/app/components/repository-layout.js index c6e9a7dfca..c4b4b0342c 100644 --- a/app/components/repository-layout.js +++ b/app/components/repository-layout.js @@ -14,6 +14,21 @@ export default Component.extend({ currentUser: alias('auth.currentUser'), userRoMode: reads('currentUser.roMode'), + repositoryProvider: computed('repo.provider', function () { + return this.repo.provider.capitalize(); + }), + + repositoryType: computed('repo.serverType', function () { + switch (this.repo.serverType) { + case 'git': + return 'GIT'; + case 'subversion': + return 'SVN'; + case 'perforce': + return 'P4'; + } + }), + repoUrl: computed('repo.{ownerName,vcsName,vcsType}', function () { const owner = this.get('repo.ownerName'); const repo = this.get('repo.vcsName'); diff --git a/app/models/repo.js b/app/models/repo.js index c9e076dfc7..4233f9e01d 100644 --- a/app/models/repo.js +++ b/app/models/repo.js @@ -50,6 +50,7 @@ const Repo = VcsEntity.extend({ migrationStatus: attr('string'), historyMigrationStatus: attr('string'), scanFailedAt: attr('date'), + serverType: attr('string', { defaultValue: 'git' }), currentScan: computed('scanFailedAt', function () { let scanFailedAt = this.get('scanFailedAt'); diff --git a/app/models/user.js b/app/models/user.js index 115e96b047..91c7f31402 100644 --- a/app/models/user.js +++ b/app/models/user.js @@ -78,8 +78,7 @@ export default Owner.extend({ this.set('applyFilterRepos', !isOrganization); return this.api .post(`/user/${this.id}/sync`) - .then(() => this.poll(), - () => this.set('isSyncing', false)); + .then(() => this.poll()); }, schedulePoll() { @@ -91,7 +90,7 @@ export default Owner.extend({ poll() { return this.reload().then(() => { - if (!this.isSyncing) { + if (this.isSyncing) { this.schedulePoll(); } else { this.permissionsService.fetchPermissions.perform(); diff --git a/app/routes/settings.js b/app/routes/settings.js index 94e125871b..bc781cfb1a 100644 --- a/app/routes/settings.js +++ b/app/routes/settings.js @@ -43,6 +43,8 @@ export default TravisRoute.extend({ fetchSshKey() { if (config.endpoints.sshKey) { const repo = this.modelFor('repo'); + if (repo.serverType === 'perforce') return; + const url = `/repos/${repo.get('id')}/key`; return this.api.get(url, { travisApiVersion: null }).then((data) => { const fingerprint = EmberObject.create({ diff --git a/app/styles/app/layout.scss b/app/styles/app/layout.scss index 2b5d8ac634..02eb488bbe 100644 --- a/app/styles/app/layout.scss +++ b/app/styles/app/layout.scss @@ -167,3 +167,6 @@ $padding-top: 24px; display: none !important; } } +.mr-1_2 { + margin-right: 1.2rem; +} diff --git a/app/styles/app/layouts/profile.scss b/app/styles/app/layouts/profile.scss index a97e4e4a62..ebacc305eb 100644 --- a/app/styles/app/layouts/profile.scss +++ b/app/styles/app/layouts/profile.scss @@ -220,10 +220,9 @@ $profile-breakpoint: 600px; .profile-repo { display: flex; position: relative; - flex: 1; + flex: 0; padding: 0.25em 0.5em 0.3em; border-radius: 2px; - margin-right: 1rem; .profile-repo-name { height: 21px; @@ -239,6 +238,18 @@ $profile-breakpoint: 600px; } } +.profile-repo-type { + display: flex; + flex: 1; + + .profile-repo-type-span { + background-color: #d8d8d8; + padding: 2px 6px; + border-radius: 25%; + font-weight: 600; + } +} + .profile-text, .profile-additional, .profile-betafeatures { diff --git a/app/templates/components/dashboard-row.hbs b/app/templates/components/dashboard-row.hbs index 2dd57ff861..efc11609e1 100644 --- a/app/templates/components/dashboard-row.hbs +++ b/app/templates/components/dashboard-row.hbs @@ -70,6 +70,16 @@ {{/if}}
+ {{#if (eq this.repo.provider 'assembla')}} ++ {{this.repositoryType}} +
+