Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate KEmptyPlaceholder to use KOptionalText #10050

Merged
merged 7 commits into from
Feb 28, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
7 changes: 3 additions & 4 deletions kolibri/core/assets/src/views/ElapsedTime.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<template>

<span v-if="date">
{{ $formatRelative(ceilingDate, { now: now }) }}
</span>
<KEmptyPlaceholder v-else />
<KOptionalText
:text="date ? $formatRelative(ceilingDate, { now: now }) : ''"
/>

</template>

Expand Down
5 changes: 3 additions & 2 deletions kolibri/core/assets/src/views/TimeDuration.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<template>

<span v-if="seconds">{{ formattedTime }}</span>
<KEmptyPlaceholder v-else />
<KOptionalText
:text="seconds ? formattedTime : ''"
/>

</template>

Expand Down
7 changes: 3 additions & 4 deletions kolibri/core/assets/src/views/UserTable/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,9 @@
</td>
<template v-if="showDemographicInfo">
<td class="id-col">
<span v-if="user.id_number">
{{ user.id_number }}
</span>
<KEmptyPlaceholder v-else />
<KOptionalText
:text="user.id_number ? user.id_number : ''"
/>
</td>
<td>
<GenderDisplayText :gender="user.gender" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<template>

<span v-if="isSpecified && birthYear">
{{ $formatDate(birthYear, { year: 'numeric' }) }}
</span>
<KEmptyPlaceholder v-else />
<KOptionalText
:text="
(isSpecified && birthYear) ? $formatDate(birthYear, { year: 'numeric' }) : ''"
/>

</template>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<template>

<span v-if="isSpecified && displayText">
{{ displayText }}
</span>
<KEmptyPlaceholder v-else />
<KOptionalText
:text="
(isSpecified && displayText) ? displayText : ''"
/>

</template>

Expand Down
2 changes: 1 addition & 1 deletion kolibri/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"intl": "^1.2.4",
"knuth-shuffle-seeded": "^1.0.6",
"kolibri-constants": "0.1.42",
"kolibri-design-system": "https://github.com/learningequality/kolibri-design-system#e203de2141dd9c8e807a1285a9d695a083576fc8",
"kolibri-design-system": "https://github.com/AlexVelezLl/kolibri-design-system#add-koptionaltext",
AlexVelezLl marked this conversation as resolved.
Show resolved Hide resolved
"lockr": "0.8.5",
"lodash": "^4.17.21",
"loglevel": "^1.8.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@
{{ coachString('descriptionLabel') }}
</KGridItem>
<KGridItem :layout12="layout12Value">
<template v-if="lesson.description">
{{ lesson.description }}
</template>
<KEmptyPlaceholder v-else />
<KOptionalText>
<template v-if="lesson.description">
{{ lesson.description }}
</template>
</KOptionalText>
</KGridItem>
</div>
</KGrid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ exports[`ReportsLearnersTable doesn't render groups information when show groups
</td>
<!---->
<!---->
<td><span>92 seconds</span></td>
<td><span>
92 seconds
</span></td>
<!---->
<td><span>
yesterday
</span></td>
yesterday
</span></td>
</tr>
<tr>
<td><span class="labeled-icon-wrapper"><span class="icon"><svg viewBox="0 0 24 24" role="presentation" focusable="false" xmlns="http://www.w3.org/2000/svg" width="24" height="24" class="" style="fill: #212121; top: 2px;"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"></path></svg></span> <span class="label" style="margin-left: 1.975em; max-width: calc(100% - 1.975em);"><span dir="auto" class="debug-warning"><a dir="auto" class="KRouterLink-noKey-0_1jjc9c8 link"><!----> <span class="link-text">learner2</span>
Expand All @@ -49,11 +51,13 @@ exports[`ReportsLearnersTable doesn't render groups information when show groups
</td>
<!---->
<!---->
<td><span>17 seconds</span></td>
<td><span>
17 seconds
</span></td>
<!---->
<td><span>
3 hours ago
</span></td>
3 hours ago
</span></td>
</tr>
</transition-group-stub>
</table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ exports[`ReportsLessonResourceLearnerListPage for a lesson restricted to some gr
<th>
Average time spent
</th>
<td><span>2 minutes</span></td>
<td><span>
2 minutes
</span></td>
</tr>
</table>
`;
Expand Down Expand Up @@ -62,7 +64,9 @@ exports[`ReportsLessonResourceLearnerListPage for a lesson restricted to some gr
<th>
Average time spent
</th>
<td><span>2 minutes</span></td>
<td><span>
2 minutes
</span></td>
</tr>
</table>
`;
Expand Down Expand Up @@ -92,7 +96,9 @@ exports[`ReportsLessonResourceLearnerListPage for an entire class lesson when di
<th>
Average time spent
</th>
<td><span>3 minutes</span></td>
<td><span>
3 minutes
</span></td>
</tr>
</table>
`;
Expand Down Expand Up @@ -157,7 +163,9 @@ exports[`ReportsLessonResourceLearnerListPage for an entire class lesson when di
<th>
Average time spent
</th>
<td><span>3 minutes</span></td>
<td><span>
3 minutes
</span></td>
</tr>
</table>
`;
Expand All @@ -170,7 +178,9 @@ exports[`ReportsLessonResourceLearnerListPage for an entire class lesson when di
<th>
Average time spent
</th>
<td><span>2 minutes</span></td>
<td><span>
2 minutes
</span></td>
</tr>
</table>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
/>
</div>
</form>

<transition mode="out-in">
<p
v-if="!searchHasBeenMade"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,9 @@
</td>
<td>
<span :ref="`coachNames${classroom.id}`">
<template v-if="coachNames(classroom).length">
{{ formattedCoachNames(classroom) }}
</template>
<KEmptyPlaceholder v-else />
<KOptionalText
:text="coachNames(classroom).length ? formattedCoachNames(classroom) : ''"
/>
</span>
<KTooltip
v-if="formattedCoachNamesTooltip(classroom)"
Expand Down
15 changes: 15 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7390,6 +7390,21 @@ [email protected]:
resolved "https://registry.yarnpkg.com/kolibri-constants/-/kolibri-constants-0.1.42.tgz#2f62a8d8b8894e5cfbd47ee6564b31018818c93f"
integrity sha512-2hUxYnzUEfhLFJO9egVSwYW8/PKob9wLeDYfB74mtIzgQ4zy6huRj3574WetK9gREi+W1Jcm7HGPsfZIFzFvrA==

"kolibri-design-system@https://github.com/AlexVelezLl/kolibri-design-system#d0ec826d6dfee3be9805fd48ecb2d707df7999cf":
AlexVelezLl marked this conversation as resolved.
Show resolved Hide resolved
version "1.3.0"
resolved "https://github.com/AlexVelezLl/kolibri-design-system#d0ec826d6dfee3be9805fd48ecb2d707df7999cf"
dependencies:
aphrodite "https://github.com/learningequality/aphrodite/"
autosize "^3.0.21"
css-element-queries "^1.2.0"
frame-throttle "^3.0.0"
fuzzysearch "^1.0.3"
keen-ui "^1.3.0"
lodash "^4.17.15"
popper.js "^1.14.6"
purecss "^0.6.2"
tippy.js "^4.2.1"

"kolibri-design-system@https://github.com/learningequality/kolibri-design-system#e203de2141dd9c8e807a1285a9d695a083576fc8":
version "1.3.0"
resolved "https://github.com/learningequality/kolibri-design-system#e203de2141dd9c8e807a1285a9d695a083576fc8"
Expand Down