[sc-14173] Implement the new simple Knowledge Box UI#2750
Conversation
7257ac2 to
a7594f3
Compare
| </pa-table-cell> | ||
| <pa-table-cell header> | ||
| <span class="title-s">{{ 'simple.column.delete' | translate }}</span> | ||
| </pa-table-cell> |
There was a problem hiding this comment.
We can move headers into an array, and use @for here.
| ? 'error' | ||
| : resource.metadata?.status === RESOURCE_STATUS.PENDING | ||
| ? 'pending' | ||
| : 'success') as TableRow['status'], |
There was a problem hiding this comment.
We can create object like const statusMap = { [RESOURCE_STATUS.ERROR]: 'error', [RESOURCE_STATUS.PENDING]: 'pending', [RESOURCE_STATUS.SUCCESS]: 'success' } and set status like: status: statusMap[resource.metadata?.status]
There was a problem hiding this comment.
ah, I will fix it. Now it's a bit verbose.
| @if (step() === 1) { | ||
| {{ 'simple.title.first-files' | translate }} | ||
| } @else if (step() === 2) { | ||
| @if ((counter?.pending || 0) > 0 || (uploadInProgress | async)) { |
There was a problem hiding this comment.
It will be clearer to have a computed() variable in places like that
| <strong [class.success]="counter?.pending === 0">{{ 'simple.ready' | translate }}</strong> | ||
| <span>: {{ counter?.processed || 0 }}</span> | ||
| </div> | ||
| @if ((counter?.pending || 0) > 0 || (uploadInProgress | async)) { |
There was a problem hiding this comment.
It will be clearer to have a computed() variable in places like that
| @if (step() > 1) { | ||
| <div class="footer"> | ||
| @if (step() === 2) { | ||
| @if (counter?.pending === 0 && !(uploadInProgress | async)) { |
There was a problem hiding this comment.
It will be clearer to have a computed() variable in places like that
| map((processingStatus) => | ||
| processingStatus.results | ||
| .reduce((resources, status) => { | ||
| if (status.schedule_order > -1) { |
There was a problem hiding this comment.
Subtle thing, we can reduce nestedness in case like that
if (!x) return y ...
No description provided.