Skip to content

Commit

Permalink
Merge pull request #2117 from owncloud/bugfix/conditional-icon-rendering
Browse files Browse the repository at this point in the history
Fix password handling in public links
  • Loading branch information
Vincent Petry authored Oct 10, 2019
2 parents 0f98f59 + 2986760 commit d1b7867
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions apps/files/src/components/FileLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<li v-for="(link, index) in $_links" :key="'li-' + index">
<oc-grid flex gutter="small">
<div class="uk-width-auto">
<oc-icon v-if="link.password" name="lock" size="medium" />
<oc-icon v-else name="link" size="medium" />
<oc-icon v-show="link.password" name="lock" size="medium" />
<oc-icon v-show="!link.password" name="link" size="medium" />
</div>
<div class="uk-width-expand uk-text-truncate">
<span class="uk-text-bold">{{ link.name }}</span><br>
Expand Down
9 changes: 8 additions & 1 deletion apps/files/src/components/FileLinkForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@
</div>
<div class="uk-width-1-1 uk-width-3-5@m">
<label class="uk-form-label" for=""><span v-translate>Password</span><em v-if="$_passwordEnforced" class="uk-margin-small-left">(<span v-translate>required</span>)</em></label>
<input type="password" autocomplete="new-password" class="uk-input" :class="{ 'uk-form-danger': !$_passwordIsValid }" v-model="password" :placeholder="hasPassword && password === null? '********' : placeholder.password" id="oc-files-file-link-password" />
<div class="uk-position-relative">
<input type="password" autocomplete="new-password" class="uk-input" :class="{ 'uk-form-danger': !$_passwordIsValid }" v-model="password" :placeholder="hasPassword && password === null? '********' : placeholder.password" id="oc-files-file-link-password" />
<div uk-close v-if="!$_passwordEnforced && hasPassword && password!=''" class="uk-position-small uk-position-center-right oc-cursor-pointer" @click="password=''" :uk-tooltip="$_passwordRemoveText" />
</div>
</div>
</div>
<!-- @TODO: Enable Mail API to use the following
Expand Down Expand Up @@ -187,6 +190,10 @@ export default {
if (permissions >= 5 && password.read_write === '1') { return true }
return false
},
$_passwordRemoveText () {
return this.$gettext('Remove password')
}
},
methods: {
Expand Down

0 comments on commit d1b7867

Please sign in to comment.