Skip to content

Commit d63cc11

Browse files
committed
translations icons; tweaking search results
1 parent 9e44c73 commit d63cc11

File tree

1 file changed

+41
-23
lines changed

1 file changed

+41
-23
lines changed

Diff for: src/components/Form/fields/FieldAffiliations.vue

+41-23
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,15 @@
5656
class="pkpButton cursor-pointer border-transparent py-2 text-lg-semibold text-primary hover:enabled:underline"
5757
@click="toggleEditMode(affiliationIndex)"
5858
>
59-
<MultilingualProgress
60-
v-bind="{
61-
count: translations(affiliation).count,
62-
total: translations(affiliation).total,
63-
}"
59+
<Icon
60+
:icon="
61+
translations(affiliation).count ===
62+
translations(affiliation).total
63+
? 'Complete'
64+
: 'InProgress'
65+
"
66+
:class="'mr-2 h-6 w-6'"
67+
:inline="true"
6468
/>
6569
&nbsp;
6670
{{ translations(affiliation).label }}
@@ -100,7 +104,7 @@
100104
}}
101105
</label>
102106
</div>
103-
<div>
107+
<div class="pkpFormField--sizelarge">
104108
<input
105109
v-if="
106110
supportedFormLocaleKeys.includes(affiliationNameLocale)
@@ -197,7 +201,10 @@
197201
class="cursor-pointer border-transparent px-2 py-2 text-lg-normal text-primary hover:bg-hover hover:text-on-dark hover:enabled:underline"
198202
target="_blank"
199203
>
200-
<Icon :icon="'external-link'" :inline="true" />
204+
<span
205+
class="fa fa-external-link pkpIcon--inline mr-2 inline-block h-6 w-6 align-middle rtl:scale-x-[-1]"
206+
aria-hidden="true"
207+
></span>
201208
</a>
202209
</li>
203210
</ul>
@@ -207,11 +214,15 @@
207214
<div v-if="showNewAffiliation">
208215
<div>
209216
<span class="inline-block py-2 text-lg-semibold">
210-
<MultilingualProgress
211-
v-bind="{
212-
count: translations(newAffiliation).count,
213-
total: translations(newAffiliation).total,
214-
}"
217+
<Icon
218+
:icon="
219+
translations(newAffiliation).count ===
220+
translations(newAffiliation).total
221+
? 'Complete'
222+
: 'InProgress'
223+
"
224+
:class="'mr-2 h-6 w-6'"
225+
:inline="true"
215226
/>
216227
&nbsp;
217228
{{ translations(newAffiliation).label }}
@@ -259,7 +270,7 @@
259270
}}
260271
</span>
261272
</div>
262-
<div>
273+
<div class="pkpFormField--sizelarge">
263274
<input
264275
v-if="
265276
supportedFormLocaleKeys.includes(
@@ -283,16 +294,22 @@
283294
</div>
284295
</TableCell>
285296
<TableCell>
286-
<div v-if="showNewAffiliation">
297+
<div>
287298
<button
288-
class="pkpButton cursor-pointer border-transparent py-2 text-lg-semibold text-primary hover:enabled:underline"
289-
:disabled="!validate(newAffiliation)"
299+
class="pkpButton border-transparent py-2 text-lg-semibold text-primary"
300+
:class="
301+
!showNewAffiliation
302+
? 'disabled'
303+
: 'cursor-pointer hover:enabled:underline'
304+
"
305+
:disabled="!showNewAffiliation"
290306
@click="addAffiliation"
291307
>
292308
{{ t('common.add', {}) }}
293309
</button>
294310
<br />
295311
<button
312+
v-if="showNewAffiliation"
296313
class="pkpButton cursor-pointer border-transparent py-2 text-lg-semibold text-primary hover:enabled:underline"
297314
@click="closeNewAffiliation"
298315
>
@@ -312,7 +329,6 @@ import {ref, computed, onMounted, watch, onBeforeUnmount} from 'vue';
312329
import {t} from '@/utils/i18n';
313330
import DropdownActions from '@/components/DropdownActions/DropdownActions.vue';
314331
import Icon from '@/components/Icon/Icon.vue';
315-
import MultilingualProgress from '@/components/MultilingualProgress/MultilingualProgress.vue';
316332
import PkpTable from '@/components/Table/Table.vue';
317333
import TableHeader from '@/components/Table/TableHeader.vue';
318334
import TableBody from '@/components/Table/TableBody.vue';
@@ -580,11 +596,6 @@ const translations = function (affiliation) {
580596
return result;
581597
};
582598
583-
/** Validates an affiliation */
584-
const validate = function (affiliation) {
585-
return !!(affiliation.ror || affiliation.name[primaryLocale]);
586-
};
587-
588599
/** Watch for changes in currentValue to ensure compatibility */
589600
watch(
590601
currentValue,
@@ -702,6 +713,7 @@ function sortNamesPrimaryFirst(names) {
702713
703714
table td a {
704715
display: inline-block;
716+
line-height: 24px;
705717
}
706718
707719
table td:nth-child(3) {
@@ -713,10 +725,10 @@ function sortNamesPrimaryFirst(names) {
713725
background-color: #fff;
714726
height: auto;
715727
max-height: 200px;
728+
overflow-x: hidden;
716729
overflow-y: scroll;
717730
position: absolute;
718731
z-index: 9999;
719-
border: 1px solid #ccc;
720732
min-width: 30%;
721733
722734
ul {
@@ -736,11 +748,17 @@ function sortNamesPrimaryFirst(names) {
736748
737749
ul li:nth-child(1n + 2) a:nth-child(1) {
738750
width: calc(100% - 30px);
751+
text-wrap: nowrap;
739752
}
740753
741754
ul li:nth-child(1n + 2) a:nth-child(2) {
742755
float: right;
743756
width: 30px;
757+
display: block;
758+
}
759+
760+
ul li:nth-child(1n + 2) a:nth-child(2) span {
761+
line-height: inherit;
744762
}
745763
}
746764
</style>

0 commit comments

Comments
 (0)