Skip to content
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
1 change: 0 additions & 1 deletion app/models/external-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export enum CredentialsFormat {
ACCESS_SECRET_KEYS = 'ACCESS_KEY_SECRET_KEY',
REPO_TOKEN = 'PERSONAL_ACCESS_TOKEN',
DATAVERSE_API_TOKEN = 'DATAVERSE_API_TOKEN',
URL_USERNAME_PASSWORD = 'url_username_password',
}

export enum ExternalServiceCapabilities {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default class AddonAccountSetupComponent extends Component<Args> {

@tracked selectedRepo?: string;
@tracked otherRepo?: string;
@tracked url?: string;
@tracked url?: string = this.args.account?.apiBaseUrl;
@tracked newAccount?: AllAuthorizedAccountTypes;
@tracked pendingOauth = false;
@tracked credentialsObject: AddonCredentialFields = {};
Expand All @@ -63,7 +63,7 @@ export default class AddonAccountSetupComponent extends Component<Args> {
}

get showUrlField() {
return this.args.provider.credentialsFormat === CredentialsFormat.URL_USERNAME_PASSWORD;
return this.args.provider.configurableApiRoot;
}

otherRepoLabel = this.intl.t('addons.accountCreate.other-repo-label');
Expand Down Expand Up @@ -106,7 +106,7 @@ export default class AddonAccountSetupComponent extends Component<Args> {
const credentials = this.credentialsObject;
const t = this.intl.t.bind(this.intl);
switch (this.args.provider.credentialsFormat) {
case CredentialsFormat.USERNAME_PASSWORD, CredentialsFormat.URL_USERNAME_PASSWORD: {
case CredentialsFormat.USERNAME_PASSWORD: {
const passwordPostText = t('addons.accountCreate.password-post-text');
return [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,13 @@
{{t 'addons.accountCreate.url-label'}}
</label>
<div local-class='post-text'>
{{t 'addons.accountCreate.owncloud-url-post-text' htmlSafe=true }}
{{t 'addons.accountCreate.url-post-text' htmlSafe=true }}
</div>
<Input
id={{url-id}}
data-test-input='url'
local-class='input'
name='url'
placeholder={{t 'addons.accountCreate.url-placeholder'}}
@type='text'
@value={{this.url}}
/>
Expand Down
2 changes: 1 addition & 1 deletion mirage/fixtures/external-storage-services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export default [
{
id: 'owncloud',
displayName: 'ownCloud',
credentialsFormat: CredentialsFormat.URL_USERNAME_PASSWORD,
credentialsFormat: CredentialsFormat.USERNAME_PASSWORD,
supportedFeatures: [
ExternalServiceCapabilities.ADD_UPDATE_FILES,
ExternalServiceCapabilities.DELETE_FILES,
Expand Down
8 changes: 0 additions & 8 deletions mirage/views/addons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -467,14 +467,6 @@ function fakeCheckCredentials(
throw new Error('Username and password are required');
}
break;
case CredentialsFormat.URL_USERNAME_PASSWORD:
if (!attrs.apiBaseUrl || !credentials.username || !credentials.password) {
throw new Error('URL, username, and password are required');
}
if (attrs.apiBaseUrl.indexOf('http') < 0) {
throw new Error('Invalid URL');
}
break;
default: // OAuth or OAuth2 should be authorized using the address found in authUrl. Faked below for mirage
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/settings/addons-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ module('Acceptance | settings | addons', hooks => {
{
id: 'owncloud',
displayName: 'ownCloud',
credentialsFormat: CredentialsFormat.URL_USERNAME_PASSWORD,
credentialsFormat: CredentialsFormat.USERNAME_PASSWORD,
supportedFeatures: [
ExternalServiceCapabilities.ADD_UPDATE_FILES,
ExternalServiceCapabilities.DELETE_FILES,
Expand Down
3 changes: 1 addition & 2 deletions translations/en-us.yml
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,7 @@ addons:
display-name-placeholder: 'Account name'
display-name-help: 'This is help text for the display name'
url-label: 'Host URL'
url-placeholder: 'owncloud.example.org'
owncloud-url-post-text: 'Only ownCloud instances supporting <a href="https://doc.owncloud.com/">WebDAV</a> and <a href"https://www.freedesktop.org/wiki/Specifications/open-collaboration-services-1.7/">OCS v1.7</a> are supported.'
url-post-text: 'Please include <i>http</i> or <i>https</i>'
username-label: 'Username'
password-label: 'Password'
username-placeholder: 'Username'
Expand Down