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

Show full timestamp instead of just date #4329

Merged
merged 1 commit into from
Feb 9, 2023
Merged
Show file tree
Hide file tree
Changes from all 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: 4 additions & 3 deletions api/src/audit-logs/objects/audit-log.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { GraphQLObjectType, GraphQLString } from 'graphql'
import { GraphQLObjectType } from 'graphql'
import { globalIdField } from 'graphql-relay'
import { DomainRemovalReasonEnum } from '../../enums'
import { UserActionEnums } from '../../enums/user-action'
import { nodeInterface } from '../../node'
import { initiatedByType } from './initiated-by'
import { targetResourceType } from './target-resource'
import { GraphQLDateTime } from 'graphql-scalars'

export const auditLogType = new GraphQLObjectType({
name: 'AuditLog',
Expand All @@ -13,8 +14,8 @@ export const auditLogType = new GraphQLObjectType({
fields: () => ({
id: globalIdField('auditLog'),
timestamp: {
type: GraphQLString,
description: 'Datetime string the activity occured.',
type: GraphQLDateTime,
description: 'Datetime string the activity occurred.',
resolve: ({ timestamp }) => timestamp,
},
initiatedBy: {
Expand Down
4 changes: 2 additions & 2 deletions api/src/email-scan/objects/__tests__/dkim.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { GraphQLNonNull, GraphQLID } from 'graphql'
import { GraphQLDate } from 'graphql-scalars'
import { GraphQLDateTime } from 'graphql-scalars'
import { toGlobalId } from 'graphql-relay'

import { domainType } from '../../../domain/objects'
Expand All @@ -24,7 +24,7 @@ describe('given the dkimType object', () => {
const demoType = dkimType.getFields()

expect(demoType).toHaveProperty('timestamp')
expect(demoType.timestamp.type).toMatchObject(GraphQLDate)
expect(demoType.timestamp.type).toMatchObject(GraphQLDateTime)
})
it('has a results field', () => {
const demoType = dkimType.getFields()
Expand Down
4 changes: 2 additions & 2 deletions api/src/email-scan/objects/__tests__/dmarc.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { GraphQLNonNull, GraphQLID, GraphQLString, GraphQLInt } from 'graphql'
import { toGlobalId } from 'graphql-relay'
import { GraphQLJSON, GraphQLDate } from 'graphql-scalars'
import { GraphQLJSON, GraphQLDateTime } from 'graphql-scalars'

import { domainType } from '../../../domain/objects'
import { guidanceTagConnection } from '../../../guidance-tag/objects'
Expand All @@ -24,7 +24,7 @@ describe('given the dmarcType object', () => {
const demoType = dmarcType.getFields()

expect(demoType).toHaveProperty('timestamp')
expect(demoType.timestamp.type).toMatchObject(GraphQLDate)
expect(demoType.timestamp.type).toMatchObject(GraphQLDateTime)
})
it('has a record field', () => {
const demoType = dmarcType.getFields()
Expand Down
4 changes: 2 additions & 2 deletions api/src/email-scan/objects/__tests__/spf.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { GraphQLNonNull, GraphQLID, GraphQLInt, GraphQLString } from 'graphql'
import { toGlobalId } from 'graphql-relay'
import { GraphQLJSON, GraphQLDate } from 'graphql-scalars'
import { GraphQLJSON, GraphQLDateTime } from 'graphql-scalars'

import { domainType } from '../../../domain/objects'
import { guidanceTagConnection } from '../../../guidance-tag/objects'
Expand All @@ -24,7 +24,7 @@ describe('given the spfType object', () => {
const demoType = spfType.getFields()

expect(demoType).toHaveProperty('timestamp')
expect(demoType.timestamp.type).toMatchObject(GraphQLDate)
expect(demoType.timestamp.type).toMatchObject(GraphQLDateTime)
})
it('has a lookups field', () => {
const demoType = spfType.getFields()
Expand Down
4 changes: 2 additions & 2 deletions api/src/email-scan/objects/dkim.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { GraphQLObjectType } from 'graphql'
import { connectionArgs, globalIdField } from 'graphql-relay'
import { GraphQLDate } from 'graphql-scalars'
import { GraphQLDateTime } from 'graphql-scalars'

import { dkimResultConnection } from './dkim-result-connection'
import { dkimResultOrder } from '../inputs'
Expand All @@ -22,7 +22,7 @@ export const dkimType = new GraphQLObjectType({
},
},
timestamp: {
type: GraphQLDate,
type: GraphQLDateTime,
description: `The time when the scan was initiated.`,
resolve: ({ timestamp }) => new Date(timestamp),
},
Expand Down
4 changes: 2 additions & 2 deletions api/src/email-scan/objects/dmarc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { GraphQLInt, GraphQLObjectType, GraphQLString } from 'graphql'
import { connectionArgs, globalIdField } from 'graphql-relay'
import { GraphQLJSON, GraphQLDate } from 'graphql-scalars'
import { GraphQLJSON, GraphQLDateTime } from 'graphql-scalars'

import { domainType } from '../../domain/objects'
import { nodeInterface } from '../../node'
Expand All @@ -22,7 +22,7 @@ export const dmarcType = new GraphQLObjectType({
},
},
timestamp: {
type: GraphQLDate,
type: GraphQLDateTime,
description: `The time when the scan was initiated.`,
resolve: ({ timestamp }) => new Date(timestamp),
},
Expand Down
14 changes: 7 additions & 7 deletions api/src/email-scan/objects/email-scan.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { GraphQLObjectType } from 'graphql'
import { connectionArgs } from 'graphql-relay'
import { GraphQLDate } from 'graphql-scalars'
import { GraphQLDateTime } from 'graphql-scalars'

import { dkimOrder, dmarcOrder, spfOrder } from '../inputs'
import { dkimConnection } from './dkim-connection'
Expand All @@ -24,11 +24,11 @@ export const emailScanType = new GraphQLObjectType({
type: dkimConnection.connectionType,
args: {
startDate: {
type: GraphQLDate,
type: GraphQLDateTime,
description: 'Start date for date filter.',
},
endDate: {
type: GraphQLDate,
type: GraphQLDateTime,
description: 'End date for date filter.',
},
orderBy: {
Expand All @@ -54,11 +54,11 @@ export const emailScanType = new GraphQLObjectType({
type: dmarcConnection.connectionType,
args: {
startDate: {
type: GraphQLDate,
type: GraphQLDateTime,
description: 'Start date for date filter.',
},
endDate: {
type: GraphQLDate,
type: GraphQLDateTime,
description: 'End date for date filter.',
},
orderBy: {
Expand All @@ -84,11 +84,11 @@ export const emailScanType = new GraphQLObjectType({
type: spfConnection.connectionType,
args: {
startDate: {
type: GraphQLDate,
type: GraphQLDateTime,
description: 'Start date for date filter.',
},
endDate: {
type: GraphQLDate,
type: GraphQLDateTime,
description: 'End date for date filter.',
},
orderBy: {
Expand Down
4 changes: 2 additions & 2 deletions api/src/email-scan/objects/spf.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { GraphQLInt, GraphQLObjectType, GraphQLString } from 'graphql'
import { connectionArgs, globalIdField } from 'graphql-relay'
import { GraphQLJSON, GraphQLDate } from 'graphql-scalars'
import { GraphQLJSON, GraphQLDateTime } from 'graphql-scalars'

import { domainType } from '../../domain/objects'
import { nodeInterface } from '../../node'
Expand All @@ -22,7 +22,7 @@ export const spfType = new GraphQLObjectType({
},
},
timestamp: {
type: GraphQLDate,
type: GraphQLDateTime,
description: `The time the scan was initiated.`,
resolve: ({ timestamp }) => new Date(timestamp),
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { GraphQLNonNull, GraphQLID } from 'graphql'
import { toGlobalId } from 'graphql-relay'
import { GraphQLDate } from 'graphql-scalars'
import { GraphQLDateTime } from 'graphql-scalars'

import { verifiedOrganizationConnection } from '../../../verified-organizations/objects'
import { verifiedDomainType } from '../index'
Expand All @@ -25,7 +25,7 @@ describe('given the verified domains object', () => {
const demoType = verifiedDomainType.getFields()

expect(demoType).toHaveProperty('lastRan')
expect(demoType.lastRan.type).toMatchObject(GraphQLDate)
expect(demoType.lastRan.type).toMatchObject(GraphQLDateTime)
})
it('has a status field', () => {
const demoType = verifiedDomainType.getFields()
Expand Down
4 changes: 2 additions & 2 deletions api/src/verified-domains/objects/verified-domain.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { GraphQLObjectType } from 'graphql'
import { connectionArgs, globalIdField } from 'graphql-relay'
import { GraphQLDate } from 'graphql-scalars'
import { GraphQLDateTime } from 'graphql-scalars'

import { domainStatus } from '../../domain/objects'
import { Domain } from '../../scalars'
Expand All @@ -18,7 +18,7 @@ export const verifiedDomainType = new GraphQLObjectType({
resolve: ({ domain }) => domain,
},
lastRan: {
type: GraphQLDate,
type: GraphQLDateTime,
description: 'The last time that a scan was ran on this domain.',
resolve: ({ lastRan }) => lastRan,
},
Expand Down
4 changes: 2 additions & 2 deletions api/src/web-scan/objects/__tests__/https.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { GraphQLID, GraphQLNonNull, GraphQLString } from 'graphql'
import { toGlobalId } from 'graphql-relay'
import { GraphQLDate, GraphQLJSON } from 'graphql-scalars'
import { GraphQLDateTime, GraphQLJSON } from 'graphql-scalars'

import { domainType } from '../../../domain/objects'
import { guidanceTagConnection } from '../../../guidance-tag/objects'
Expand All @@ -24,7 +24,7 @@ describe('given the https gql object', () => {
const demoType = httpsType.getFields()

expect(demoType).toHaveProperty('timestamp')
expect(demoType.timestamp.type).toMatchObject(GraphQLDate)
expect(demoType.timestamp.type).toMatchObject(GraphQLDateTime)
})
it('has a implementation field', () => {
const demoType = httpsType.getFields()
Expand Down
4 changes: 2 additions & 2 deletions api/src/web-scan/objects/__tests__/ssl.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
GraphQLBoolean,
} from 'graphql'
import { toGlobalId } from 'graphql-relay'
import { GraphQLJSON, GraphQLDate } from 'graphql-scalars'
import { GraphQLJSON, GraphQLDateTime } from 'graphql-scalars'

import { domainType } from '../../../domain/objects'
import { guidanceTagConnection } from '../../../guidance-tag/objects'
Expand Down Expand Up @@ -88,7 +88,7 @@ describe('given the ssl gql object', () => {
const demoType = sslType.getFields()

expect(demoType).toHaveProperty('timestamp')
expect(demoType.timestamp.type).toMatchObject(GraphQLDate)
expect(demoType.timestamp.type).toMatchObject(GraphQLDateTime)
})
it('has a weakCiphers field', () => {
const demoType = sslType.getFields()
Expand Down
4 changes: 2 additions & 2 deletions api/src/web-scan/objects/https.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { GraphQLObjectType, GraphQLString } from 'graphql'
import { connectionArgs, globalIdField } from 'graphql-relay'
import { GraphQLDate, GraphQLJSON } from 'graphql-scalars'
import { GraphQLDateTime, GraphQLJSON } from 'graphql-scalars'

import { domainType } from '../../domain/objects'
import { nodeInterface } from '../../node'
Expand All @@ -22,7 +22,7 @@ export const httpsType = new GraphQLObjectType({
},
},
timestamp: {
type: GraphQLDate,
type: GraphQLDateTime,
description: `The time the scan was initiated.`,
resolve: ({ timestamp }) => new Date(timestamp),
},
Expand Down
4 changes: 2 additions & 2 deletions api/src/web-scan/objects/ssl.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
GraphQLString,
} from 'graphql'
import { connectionArgs, globalIdField } from 'graphql-relay'
import { GraphQLJSON, GraphQLDate } from 'graphql-scalars'
import { GraphQLJSON, GraphQLDateTime } from 'graphql-scalars'

import { domainType } from '../../domain/objects'
import { nodeInterface } from '../../node'
Expand Down Expand Up @@ -73,7 +73,7 @@ export const sslType = new GraphQLObjectType({
supportsEcdhKeyExchange,
},
timestamp: {
type: GraphQLDate,
type: GraphQLDateTime,
description: `The time when the scan was initiated.`,
resolve: ({ timestamp }) => new Date(timestamp),
},
Expand Down
10 changes: 5 additions & 5 deletions api/src/web-scan/objects/web-scan.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { GraphQLObjectType } from 'graphql'
import { connectionArgs } from 'graphql-relay'
import { GraphQLDate } from 'graphql-scalars'
import { GraphQLDateTime } from 'graphql-scalars'

import { domainType } from '../../domain/objects'
import { httpsOrder, sslOrder } from '../inputs'
Expand All @@ -23,11 +23,11 @@ export const webScanType = new GraphQLObjectType({
type: httpsConnection.connectionType,
args: {
startDate: {
type: GraphQLDate,
type: GraphQLDateTime,
description: 'Start date for date filter.',
},
endDate: {
type: GraphQLDate,
type: GraphQLDateTime,
description: 'End date for date filter.',
},
orderBy: {
Expand All @@ -53,11 +53,11 @@ export const webScanType = new GraphQLObjectType({
type: sslConnection.connectionType,
args: {
startDate: {
type: GraphQLDate,
type: GraphQLDateTime,
description: 'Start date for date filter.',
},
endDate: {
type: GraphQLDate,
type: GraphQLDateTime,
description: 'End date for date filter.',
},
orderBy: {
Expand Down