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

Implemented: Updated the DataManager Logs page to be dynamic in Job Manager(#680) #729

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

R-Sourabh
Copy link
Contributor

@R-Sourabh R-Sourabh commented Sep 20, 2024

Related Issues

#680

Short Description and Why It's Useful

  • Added a dynamic section where details related to the files used in jobs are displayed below the main job information.
  • Implemented a detail page that allows users to view the Data Manager overview from the previous page, along with other MDM configuration details on the right-hand side.
  • Included a dynamic section where individual Data Manager logs are listed.
  • Added ion-chips to dynamically update the list according to the job status.
  • Added a popover option to download file.
  • Implemented the code to download different log files from the list item as well as from the popover.

Screenshots of Visual Changes before/after (If There Are Any)

Screenshot from 2024-09-20 20-19-55
Screenshot from 2024-09-20 20-19-51

Contribution and Currently Important Rules Acceptance

<template>
<ion-content>
<ion-list>
<ion-list-header>{{ translate('Log Id') }}</ion-list-header>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will the data manager log ID not the text "Log Id".

<ion-item button @click="downloadLogFile('logFile')">
{{ translate('Log file') }}
</ion-item>
<ion-item button :lines="log?.errorRecordContentId ? undefined : 'none'" @click="downloadLogFile('uploadedFle')">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should show error item disabled instead of hiding, if there is not error content.

let dataResource = {} as any;

if (type === 'logFile') {
contentIdType = 'logFileContentId';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename contentIdType to contentId and fetch the contentId in the if/else block itself.

let logs = [] as any
const payload = {
"inputFields": {
"statusId": ["SERVICE_CANCELLED", "SERVICE_CRASHED", "SERVICE_FAILED", "SERVICE_FINISHED", "SERVICE_PENDING", "SERVICE_RUNNING", "SERVICE_QUEUED"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to apply any filter on status.

}).catch((err: any) => {
logger.error(err);
})
commit(types.JOB_DATA_RESOURCE_IDS_UPDATED, dataResourceIds);
Copy link
Contributor

@ravilodhi ravilodhi Sep 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of storing dataResourceIds separately, I think you should add the needed field in the respective data manager config record itself.

commit(types.JOB_DATA_RESOURCE_IDS_UPDATED, dataResourceIds);
},

async fetchDataManagerConfig({ commit }, params) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we are not storing anything to state here, we can skip using action here. Service itself should fulfil the purpose.


if (dataResource) {
try {
const response = await JobService.downloadCsv({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename this service name to something like fetchFileData.

src/utils/index.ts Outdated Show resolved Hide resolved
</div>

<div class="ion-padding">
<ion-chip v-for="(chip, index) in chips" :key="index" outline @click="updateLogs(chip.label)">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The list name should be logFilters or dataManagerLogFilters instead of chips.

</div>

<div class="ion-padding">
<ion-chip v-for="(chip, index) in chips" :key="index" outline @click="updateLogs(chip.label)">
Copy link
Contributor

@ravilodhi ravilodhi Sep 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The updateLogs should also be rename to something filterLogs or filterDataManagerLogs.

<p>{{ translate('Finished') }}</p>
</ion-label>

<ion-badge color="success" v-if="log.statusId === 'SERVICE_FINISHED'">{{ translate('Finished') }}</ion-badge>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Display the status description here. You need to fetch the status data for statusTypeId='SERVICE_STATUS' and then create uiLables for all the statuses.

return {
configDetails: {},
selectedChip: 'All',
chips: [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be renamed to logFilters and it should be the array of object, each filter object with key and value. So that when apply filters you can pass the ID.

}

.config {
.config-details {
align-self: end;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is needed. The content should instead expand to fill the remaining space. both grid columns should take equal space. The Width of the grid should be restricted to control the width of its children.

Copy link
Contributor Author

@R-Sourabh R-Sourabh Oct 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The align-self property is aligning the grid column to the end vertically, not horizontally, as the layout suggests. I used this property to position the configuration name section at the bottom vertically as mentioned in the figma. After removing it, this is how it looks:

Screenshot from 2024-10-18 11-06-48

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense, I mixed up justify and align. Thanks for clarifying. It was correct the way you had it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants