willwillis / job-tracker-dashboard

0 stars 0 forks source link

Real-time Dashboard View #2

Closed AhmedElywa closed 4 years ago

AhmedElywa commented 4 years ago
willwillis commented 4 years ago

image

willwillis commented 4 years ago

image

willwillis commented 4 years ago

The Original Requirement Document May be easier to read in VS Code (Markdown preview mode)

Will's Points Estimate: 2 points

Overview: The Real-time Dashboard View

This is the primary dashboard. The Structure or layout of this page will be defined by the Sections and Steps that are associated with the Dashboard.

The dyanmic data on the page will be associated with the individual job executions, or JobRuns for a given day.

Sections

query:

query dashboardView{
  findOneDashboard(where:{id: 66}){
    name
    sections {
      name
      order
      steps {
        name   # alias for the Job
        order
        job {
          name  # display on hover (tooltip)
          runs {
            startTime
            endTime
            status  # associate to Color and Icon Mapping tables
          }
        }
      }
    }
  }
}

Above query is missing JOurnal Entries

High Priority Features (work on this first)

Configuration / Variables / Mappings

   icon_map  = (
     "RUNNING"      => 'play-circle',
     "STARTING"     => 'play-circle',
     "SUCCESS"      => 'ok',
     "FAILURE"      => 'remove',
     "TERMINATED"   => 'remove',
     "ON_ICE"       => 'asterisk',
     "INACTIVE"     => 'unchecked',
     "ACTIVATED"    => 'unchecked',
     "RESTART"      => 'unchecked',
     "ON_HOLD"      => 'pause',
     "QUE_WAIT"     => 'unchecked',
     "WAIT_REPLY"   => 'unchecked',
     "PEND_MACH"    => 'unchecked',
     "RESWAIT"      => 'unchecked',
     "ON_NOEXEC"    => 'unchecked',
     );
   css_color_map  = (
     "RUNNING"      => 'warning',
     "STARTING"     => 'warning',
     "SUCCESS"      => 'success',
     "FAILURE"      => 'danger',
     "TERMINATED"   => 'danger',
     "ON_ICE"       => 'primary',
     "INACTIVE"     => 'primary',
     "ACTIVATED"    => 'warning',
     "RESTART"      => 'warning',
     "ON_HOLD"      => 'primary',
     "QUE_WAIT"     => 'default',
     "WAIT_REPLY"   => 'default',
     "PEND_MACH"    => 'default',
     "RESWAIT"      => 'default',
     "ON_NOEXEC"    => 'default',
);

Low Priority Features

Routing

A user will need to access a dashboard with a "slug" URL, something similar to this: /realtime/id/dashboard-name-here for the following reasons:

AhmedElywa commented 4 years ago

All the task is done please give the last review and if it's an ok move to done and close this issue

willwillis commented 4 years ago

DashBoard.tsx breaks if step.job.runs.length === 0

I updated, but need a more elegant solution

 <CardBody>
              {section.steps.map((step, index) => {
                const runs = step.job.runs.length;
                const lastRun = step.job.runs[runs - 1];
                if (runs) {
                  return (
                    <Row key={index} middle="xs" style={{ borderBottom: '1px solid #eee' }}>
                      <StyledCol breakPoint={{ xs: 12, lg: 4, xl: 2 }}>
                        <Button
                          status={status[lastRun.status]}
                          appearance="outline"
                          style={{ position: 'relative', display: 'flex', alignItems: 'center' }}
                          shape="Round"
                          size="Tiny"
                        >
                          <EvaIcon name={statusIcons[lastRun.status]} />
                          <span>{lastRun.status}</span>
                        </Button>
                        <Badge position="bottomLeft" status={status[lastRun.status]}>
                          {runs}
                        </Badge>
                      </StyledCol>
                      <StyledCol
                        breakPoint={{ xs: 12, lg: 8, xl: 4 }}
                        style={{ display: 'flex', alignItems: 'center' }}
                      >
                        <Tooltip trigger="hint" placement="top" content={step.job.name} status={status[lastRun.status]}>
                          <span>{step.name}</span>
                        </Tooltip>
                      </StyledCol>
                      <StyledCol breakPoint={{ xs: 12, lg: 4, xl: 2 }}>
                        {moment(lastRun.startTime).format('YYYY-MM-DD HH:mm')}
                      </StyledCol>
                      <StyledCol breakPoint={{ xs: 12, lg: 4, xl: 2 }}>
                        {moment(lastRun.startTime).format('YYYY-MM-DD HH:mm')}
                      </StyledCol>
                      <StyledCol breakPoint={{ xs: 12, lg: 4, xl: 2 }}>
                        <Button appearance="ghost" size="Tiny">
                          <EvaIcon name="edit-outline" />
                        </Button>
                        <Button appearance="ghost" size="Tiny">
                          <EvaIcon name="calendar-outline" />
                        </Button>
                        <Button appearance="ghost" size="Tiny">
                          <EvaIcon name="arrow-forward-outline" />
                        </Button>
                      </StyledCol>
                    </Row>
                  );
                } else {
                  return (
                    <Row key={index} middle="xs" style={{ borderBottom: '1px solid #eee' }}>
                      <StyledCol breakPoint={{ xs: 12, lg: 4, xl: 2 }}></StyledCol>
                      <StyledCol
                        breakPoint={{ xs: 12, lg: 8, xl: 4 }}
                        style={{ display: 'flex', alignItems: 'center' }}
                      >
                        <Tooltip trigger="hint" placement="top" content={step.job.name}>
                          <span>{step.name}</span>
                        </Tooltip>
                      </StyledCol>
                      <StyledCol breakPoint={{ xs: 12, lg: 4, xl: 2 }}>...</StyledCol>
                      <StyledCol breakPoint={{ xs: 12, lg: 4, xl: 2 }}>...</StyledCol>
                      <StyledCol breakPoint={{ xs: 12, lg: 4, xl: 2 }}>
                        <Button appearance="ghost" size="Tiny">
                          <EvaIcon name="edit-outline" />
                        </Button>
                        <Button appearance="ghost" size="Tiny">
                          <EvaIcon name="calendar-outline" />
                        </Button>
                        <Button appearance="ghost" size="Tiny">
                          <EvaIcon name="arrow-forward-outline" />
                        </Button>
                      </StyledCol>
                    </Row>
                  );
                }
              })}
            </CardBody>
willwillis commented 4 years ago

To recreate this case, go to JobRun Model Editor. Connect JobRun { id: 1} to Job { id: 2 }. image it should display like this image

willwillis commented 4 years ago

Step Status indicator should not behave like a button. (mouse pointer should not change)

willwillis commented 4 years ago

No components were made.