Unverified Commit d2f222ea authored by Allison Suarez Miranda's avatar Allison Suarez Miranda Committed by GitHub

feat: Update 'table view', 'alumni' and SLA status badges (#595)

* removed badges section for users cause we dont need that moving forward
Signed-off-by: 's avatarAllison Suarez Miranda <asuarezmiranda@lyft.com>

* removed ALumni badge from user profile and added it to header-bullets instead
Signed-off-by: 's avatarAllison Suarez Miranda <asuarezmiranda@lyft.com>

* removed Alumni badge checks for user profiles
Signed-off-by: 's avatarAllison Suarez Miranda <asuarezmiranda@lyft.com>

* not working for some reason
Signed-off-by: 's avatarAllison Suarez Miranda <asuarezmiranda@lyft.com>

* lint and missed test update
Signed-off-by: 's avatarAllison Suarez Miranda <asuarezmiranda@lyft.com>

* fixed conflict
Signed-off-by: 's avatarAllison Suarez Miranda <asuarezmiranda@lyft.com>

* updated DashboardPage tests
Signed-off-by: 's avatarAllison Suarez Miranda <asuarezmiranda@lyft.com>

* added icons
Signed-off-by: 's avatarAllison Suarez Miranda <asuarezmiranda@lyft.com>

* lint
Signed-off-by: 's avatarAllison Suarez Miranda <asuarezmiranda@lyft.com>

* fixed alignment issue
Signed-off-by: 's avatarAllison Suarez Miranda <asuarezmiranda@lyft.com>

* fixed table view
Signed-off-by: 's avatarAllison Suarez Miranda <asuarezmiranda@lyft.com>

* added variables for style
Signed-off-by: 's avatarAllison Suarez Miranda <asuarezmiranda@lyft.com>

* made component more genric, still need to rename and fix icon issue
Signed-off-by: 's avatarAllison Suarez Miranda <asuarezmiranda@lyft.com>

* updated text to use typography defined
Signed-off-by: 's avatarAllison Suarez Miranda <asuarezmiranda@lyft.com>

* variable
Signed-off-by: 's avatarAllison Suarez Miranda <asuarezmiranda@lyft.com>

* hit icon broken
Signed-off-by: 's avatarAllison Suarez Miranda <asuarezmiranda@lyft.com>

* fixed hit icon a bit
Signed-off-by: 's avatarAllison Suarez Miranda <asuarezmiranda@lyft.com>

* fixed tets
Signed-off-by: 's avatarAllison Suarez Miranda <asuarezmiranda@lyft.com>

* moved setup into it clause
Signed-off-by: 's avatarAllison Suarez Miranda <asuarezmiranda@lyft.com>

* added resource badges back in
Signed-off-by: 's avatarAllison Suarez Miranda <asuarezmiranda@lyft.com>

* lint + added back tests
Signed-off-by: 's avatarAllison Suarez Miranda <asuarezmiranda@lyft.com>

* fixes
Signed-off-by: 's avatarAllison Suarez Miranda <asuarezmiranda@lyft.com>

* lint
Signed-off-by: 's avatarAllison Suarez Miranda <asuarezmiranda@lyft.com>

* fixed icon for hit
Signed-off-by: 's avatarAllison Suarez Miranda <asuarezmiranda@lyft.com>

* bettered updated file
Signed-off-by: 's avatarAllison Suarez Miranda <asuarezmiranda@lyft.com>

* removed text prop
Signed-off-by: 's avatarAllison Suarez Miranda <asuarezmiranda@lyft.com>

* fixed text issue
Signed-off-by: 's avatarAllison Suarez Miranda <asuarezmiranda@lyft.com>

* small fix
Signed-off-by: 's avatarAllison Suarez Miranda <asuarezmiranda@lyft.com>

* cleanup
Signed-off-by: 's avatarAllison Suarez Miranda <asuarezmiranda@lyft.com>
parent 7c9a29a7
......@@ -7,10 +7,10 @@ exports[`strict null compilation`] = {
"js/components/DashboardPage/DashboardOwnerEditor/index.tsx:3906399124": [
[46, 2, 4, "No overload matches this call.\\n The last overload gave the following error.\\n Argument of type \'null\' is not assignable to parameter of type \'{}\'.", "2087897566"]
],
"js/components/DashboardPage/index.spec.tsx:2960511959": [
[57, 4, 8, "Argument of type \'Partial<Location<{} | null | undefined>> | undefined\' is not assignable to parameter of type \'Partial<Location<{} | null | undefined>>\'.\\n Type \'undefined\' is not assignable to type \'Partial<Location<{} | null | undefined>>\'.", "2700611480"],
[242, 10, 18, "Type \'null\' is not assignable to type \'number\'.", "2901767208"],
[243, 10, 29, "Type \'null\' is not assignable to type \'number\'.", "1157138603"]
"js/components/DashboardPage/index.spec.tsx:644863281": [
[53, 4, 8, "Argument of type \'Partial<Location<{} | null | undefined>> | undefined\' is not assignable to parameter of type \'Partial<Location<{} | null | undefined>>\'.\\n Type \'undefined\' is not assignable to type \'Partial<Location<{} | null | undefined>>\'.", "2700611480"],
[212, 10, 18, "Type \'null\' is not assignable to type \'number\'.", "2901767208"],
[213, 10, 29, "Type \'null\' is not assignable to type \'number\'.", "1157138603"]
],
"js/components/Feedback/index.tsx:1605423346": [
[46, 6, 7, "Type \'FC<any> | undefined\' is not assignable to type \'FC<any>\'.\\n Type \'undefined\' is not assignable to type \'FunctionComponent<any>\'.", "3716929964"]
......@@ -21,29 +21,29 @@ exports[`strict null compilation`] = {
[100, 32, 36, "No overload matches this call.\\n Overload 1 of 3, \'(node: ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>, options?: ShallowRendererProps | undefined): ShallowWrapper<...>\', gave the following error.\\n Argument of type \'Element | null\' is not assignable to parameter of type \'ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>\'.\\n Type \'null\' is not assignable to type \'ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>\'.\\n Overload 2 of 3, \'(node: ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>, options?: ShallowRendererProps | undefined): ShallowWrapper<...>\', gave the following error.\\n Argument of type \'Element | null\' is not assignable to parameter of type \'ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>\'.\\n Type \'null\' is not assignable to type \'ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>\'.\\n Overload 3 of 3, \'(node: ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>, options?: ShallowRendererProps | undefined): ShallowWrapper<...>\', gave the following error.\\n Argument of type \'Element | null\' is not assignable to parameter of type \'ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>\'.\\n Type \'null\' is not assignable to type \'ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>\'.", "788521834"],
[110, 39, 4, "Argument of type \'null\' is not assignable to parameter of type \'Partial<NavBarProps> | undefined\'.", "2087897566"]
],
"js/components/ProfilePage/index.spec.tsx:1225244378": [
"js/components/ProfilePage/index.spec.tsx:4086464143": [
[41, 6, 4, "Argument of type \'null\' is not assignable to parameter of type \'Partial<Location<{} | null | undefined>>\'.", "2087897566"]
],
"js/components/ProfilePage/index.tsx:3239951064": [
[177, 6, 7, "Type \'Element\' is not assignable to type \'never\'.", "3716929964"],
[178, 6, 3, "Type \'string\' is not assignable to type \'never\'.", "193424690"],
[179, 6, 5, "Type \'string\' is not assignable to type \'never\'.", "183222373"],
[184, 8, 7, "Type \'Element\' is not assignable to type \'never\'.", "3716929964"],
[185, 8, 3, "Type \'string\' is not assignable to type \'never\'.", "193424690"],
[186, 8, 5, "Type \'string\' is not assignable to type \'never\'.", "183222373"],
[203, 6, 6, "Type \'Element\' is not assignable to type \'null\'.", "1320372020"],
[205, 6, 6, "Type \'Element\' is not assignable to type \'null\'.", "1320372020"],
[210, 6, 8, "Type \'Element\' is not assignable to type \'null\'.", "2362717523"],
[214, 6, 8, "Type \'Element\' is not assignable to type \'null\'.", "2362717523"],
[230, 6, 7, "Type \'Element\' is not assignable to type \'null\'.", "2834855792"],
[232, 6, 7, "Type \'Element\' is not assignable to type \'null\'.", "2834855792"],
[247, 6, 9, "Type \'Element\' is not assignable to type \'null\'.", "4194995369"],
[251, 6, 9, "Type \'Element\' is not assignable to type \'null\'.", "4194995369"],
[267, 6, 11, "Type \'Element\' is not assignable to type \'null\'.", "4082075310"],
[271, 6, 11, "Type \'Element\' is not assignable to type \'null\'.", "4082075310"],
[287, 6, 10, "Type \'Element\' is not assignable to type \'null\'.", "1383320160"],
[291, 6, 10, "Type \'Element\' is not assignable to type \'null\'.", "1383320160"],
[363, 2, 15, "No overload matches this call.\\n The last overload gave the following error.\\n Argument of type \'(state: GlobalState) => { user: PeopleUser; resourceRelations: { table: { bookmarks: Bookmark[]; own: Resource[]; read: Resource[]; }; dashboard: { bookmarks: Bookmark[] | undefined; own: Resource[] | undefined; read: never[]; }; }; }\' is not assignable to parameter of type \'MapStateToPropsParam<StateFromProps, {}, {}>\'.\\n Type \'(state: GlobalState) => { user: PeopleUser; resourceRelations: { table: { bookmarks: Bookmark[]; own: Resource[]; read: Resource[]; }; dashboard: { bookmarks: Bookmark[] | undefined; own: Resource[] | undefined; read: never[]; }; }; }\' is not assignable to type \'MapStateToPropsFactory<StateFromProps, {}, {}>\'.\\n Type \'{ user: PeopleUser; resourceRelations: { table: { bookmarks: Bookmark[]; own: Resource[]; read: Resource[]; }; dashboard: { bookmarks: Bookmark[] | undefined; own: Resource[] | undefined; read: never[]; }; }; }\' is not assignable to type \'MapStateToProps<StateFromProps, {}, {}>\'.\\n Type \'{ user: PeopleUser; resourceRelations: { table: { bookmarks: Bookmark[]; own: Resource[]; read: Resource[]; }; dashboard: { bookmarks: Bookmark[] | undefined; own: Resource[] | undefined; read: never[]; }; }; }\' provides no match for the signature \'(state: {}, ownProps: {}): StateFromProps\'.", "1389821531"]
"js/components/ProfilePage/index.tsx:2593015022": [
[178, 6, 7, "Type \'Element\' is not assignable to type \'never\'.", "3716929964"],
[179, 6, 3, "Type \'string\' is not assignable to type \'never\'.", "193424690"],
[180, 6, 5, "Type \'string\' is not assignable to type \'never\'.", "183222373"],
[185, 8, 7, "Type \'Element\' is not assignable to type \'never\'.", "3716929964"],
[186, 8, 3, "Type \'string\' is not assignable to type \'never\'.", "193424690"],
[187, 8, 5, "Type \'string\' is not assignable to type \'never\'.", "183222373"],
[204, 6, 6, "Type \'Element\' is not assignable to type \'null\'.", "1320372020"],
[206, 6, 6, "Type \'Element\' is not assignable to type \'null\'.", "1320372020"],
[211, 6, 8, "Type \'Element\' is not assignable to type \'null\'.", "2362717523"],
[215, 6, 8, "Type \'Element\' is not assignable to type \'null\'.", "2362717523"],
[222, 6, 7, "Type \'Element\' is not assignable to type \'null\'.", "2834855792"],
[224, 6, 7, "Type \'Element\' is not assignable to type \'null\'.", "2834855792"],
[240, 6, 9, "Type \'Element\' is not assignable to type \'null\'.", "4194995369"],
[244, 6, 9, "Type \'Element\' is not assignable to type \'null\'.", "4194995369"],
[260, 6, 11, "Type \'Element\' is not assignable to type \'null\'.", "4082075310"],
[264, 6, 11, "Type \'Element\' is not assignable to type \'null\'.", "4082075310"],
[280, 6, 10, "Type \'Element\' is not assignable to type \'null\'.", "1383320160"],
[284, 6, 10, "Type \'Element\' is not assignable to type \'null\'.", "1383320160"],
[356, 2, 15, "No overload matches this call.\\n The last overload gave the following error.\\n Argument of type \'(state: GlobalState) => { user: PeopleUser; resourceRelations: { table: { bookmarks: Bookmark[]; own: Resource[]; read: Resource[]; }; dashboard: { bookmarks: Bookmark[] | undefined; own: Resource[] | undefined; read: never[]; }; }; }\' is not assignable to parameter of type \'MapStateToPropsParam<StateFromProps, {}, {}>\'.\\n Type \'(state: GlobalState) => { user: PeopleUser; resourceRelations: { table: { bookmarks: Bookmark[]; own: Resource[]; read: Resource[]; }; dashboard: { bookmarks: Bookmark[] | undefined; own: Resource[] | undefined; read: never[]; }; }; }\' is not assignable to type \'MapStateToPropsFactory<StateFromProps, {}, {}>\'.\\n Type \'{ user: PeopleUser; resourceRelations: { table: { bookmarks: Bookmark[]; own: Resource[]; read: Resource[]; }; dashboard: { bookmarks: Bookmark[] | undefined; own: Resource[] | undefined; read: never[]; }; }; }\' is not assignable to type \'MapStateToProps<StateFromProps, {}, {}>\'.\\n Type \'{ user: PeopleUser; resourceRelations: { table: { bookmarks: Bookmark[]; own: Resource[]; read: Resource[]; }; dashboard: { bookmarks: Bookmark[] | undefined; own: Resource[] | undefined; read: never[]; }; }; }\' provides no match for the signature \'(state: {}, ownProps: {}): StateFromProps\'.", "1389821531"]
],
"js/components/SearchPage/SearchFilter/FilterSection/index.spec.tsx:3610496091": [
[59, 13, 7, "Object is possibly \'undefined\'.", "3716929964"],
......@@ -104,19 +104,19 @@ exports[`strict null compilation`] = {
"js/components/TableDetail/index.spec.tsx:2169788066": [
[32, 4, 8, "Argument of type \'Partial<Location<{} | null | undefined>> | undefined\' is not assignable to parameter of type \'Partial<Location<{} | null | undefined>>\'.\\n Type \'undefined\' is not assignable to type \'Partial<Location<{} | null | undefined>>\'.", "2700611480"]
],
"js/components/TableDetail/index.tsx:2025163043": [
[154, 10, 13, "Type \'null\' is not assignable to type \'((newValue: string, onSuccess?: (() => any) | undefined, onFailure?: (() => any) | undefined) => void) | undefined\'.", "67794331"],
[165, 6, 7, "Type \'Element\' is not assignable to type \'never\'.", "3716929964"],
[172, 6, 3, "Type \'string\' is not assignable to type \'never\'.", "193424690"],
[173, 6, 5, "Type \'string\' is not assignable to type \'never\'.", "183222373"],
[183, 8, 7, "Type \'Element\' is not assignable to type \'never\'.", "3716929964"],
[184, 11, 26, "Type \'{ itemsPerPage: number; source: string; }\' is missing the following properties from type \'Readonly<Pick<TableDashboardResourceListProps, \\"source\\" | \\"dashboards\\" | \\"isLoading\\" | \\"errorText\\" | \\"itemsPerPage\\"> & OwnProps>\': dashboards, isLoading, errorText", "2224258167"],
[189, 8, 3, "Type \'string\' is not assignable to type \'never\'.", "193424690"],
[190, 8, 5, "Type \'string | Element\' is not assignable to type \'never\'.\\n Type \'string\' is not assignable to type \'never\'.", "183222373"],
[264, 16, 7, "Type \'string | null\' is not assignable to type \'string | undefined\'.\\n Type \'null\' is not assignable to type \'string | undefined\'.", "3817619378"],
[306, 20, 35, "Argument of type \'ProgrammaticDescription[] | undefined\' is not assignable to parameter of type \'ProgrammaticDescription[]\'.\\n Type \'undefined\' is not assignable to type \'ProgrammaticDescription[]\'.", "4249007202"],
[320, 20, 36, "Argument of type \'ProgrammaticDescription[] | undefined\' is not assignable to parameter of type \'ProgrammaticDescription[]\'.\\n Type \'undefined\' is not assignable to type \'ProgrammaticDescription[]\'.", "2770872537"],
[325, 16, 36, "Argument of type \'ProgrammaticDescription[] | undefined\' is not assignable to parameter of type \'ProgrammaticDescription[]\'.\\n Type \'undefined\' is not assignable to type \'ProgrammaticDescription[]\'.", "2776557981"]
"js/components/TableDetail/index.tsx:1272928301": [
[153, 10, 13, "Type \'null\' is not assignable to type \'((newValue: string, onSuccess?: (() => any) | undefined, onFailure?: (() => any) | undefined) => void) | undefined\'.", "67794331"],
[164, 6, 7, "Type \'Element\' is not assignable to type \'never\'.", "3716929964"],
[171, 6, 3, "Type \'string\' is not assignable to type \'never\'.", "193424690"],
[172, 6, 5, "Type \'string\' is not assignable to type \'never\'.", "183222373"],
[182, 8, 7, "Type \'Element\' is not assignable to type \'never\'.", "3716929964"],
[183, 11, 26, "Type \'{ itemsPerPage: number; source: string; }\' is missing the following properties from type \'Readonly<Pick<TableDashboardResourceListProps, \\"source\\" | \\"dashboards\\" | \\"isLoading\\" | \\"errorText\\" | \\"itemsPerPage\\"> & OwnProps>\': dashboards, isLoading, errorText", "2224258167"],
[188, 8, 3, "Type \'string\' is not assignable to type \'never\'.", "193424690"],
[189, 8, 5, "Type \'string | Element\' is not assignable to type \'never\'.\\n Type \'string\' is not assignable to type \'never\'.", "183222373"],
[261, 16, 7, "Type \'string | null\' is not assignable to type \'string | undefined\'.\\n Type \'null\' is not assignable to type \'string | undefined\'.", "3817619378"],
[303, 20, 35, "Argument of type \'ProgrammaticDescription[] | undefined\' is not assignable to parameter of type \'ProgrammaticDescription[]\'.\\n Type \'undefined\' is not assignable to type \'ProgrammaticDescription[]\'.", "4249007202"],
[317, 20, 36, "Argument of type \'ProgrammaticDescription[] | undefined\' is not assignable to parameter of type \'ProgrammaticDescription[]\'.\\n Type \'undefined\' is not assignable to type \'ProgrammaticDescription[]\'.", "2770872537"],
[322, 16, 36, "Argument of type \'ProgrammaticDescription[] | undefined\' is not assignable to parameter of type \'ProgrammaticDescription[]\'.\\n Type \'undefined\' is not assignable to type \'ProgrammaticDescription[]\'.", "2776557981"]
],
"js/components/common/Announcements/AnnouncementsList/index.spec.tsx:1710887993": [
[95, 23, 124, "Object is possibly \'null\'.", "4248337497"]
......@@ -160,9 +160,6 @@ exports[`strict null compilation`] = {
"js/components/common/EntityCard/EntityCardSection/index.tsx:1592385405": [
[40, 4, 23, "Object is possibly \'null\'.", "1725552512"]
],
"js/components/common/Flag/index.spec.tsx:910958978": [
[63, 25, 4, "Argument of type \'null\' is not assignable to parameter of type \'string | undefined\'.", "2087897566"]
],
"js/components/common/Flag/index.tsx:128873066": [
[44, 27, 8, "Argument of type \'string | null\' is not assignable to parameter of type \'string\'.\\n Type \'null\' is not assignable to type \'string\'.", "4036080041"]
],
......@@ -185,19 +182,19 @@ exports[`strict null compilation`] = {
"js/components/common/ResourceListItem/DashboardListItem/index.spec.tsx:53357032": [
[163, 14, 29, "Type \'null\' is not assignable to type \'number\'.", "1157138603"]
],
"js/components/common/ResourceListItem/TableListItem/index.spec.tsx:2421977441": [
[162, 14, 18, "Type \'null\' is not assignable to type \'string | undefined\'.", "3750638477"],
[230, 14, 6, "Type \'null\' is not assignable to type \'Badge[] | undefined\'.", "1502764275"]
"js/components/common/ResourceListItem/TableListItem/index.spec.tsx:1564573503": [
[161, 14, 18, "Type \'null\' is not assignable to type \'string | undefined\'.", "3750638477"],
[229, 14, 6, "Type \'null\' is not assignable to type \'Badge[] | undefined\'.", "1502764275"]
],
"js/components/common/ResourceListItem/UserListItem/index.tsx:3815984865": [
"js/components/common/ResourceListItem/UserListItem/index.tsx:101883333": [
[31, 21, 49, "Argument of type \'Element\' is not assignable to parameter of type \'never\'.", "2430213531"],
[34, 21, 49, "Argument of type \'Element\' is not assignable to parameter of type \'never\'.", "1883272571"]
],
"js/components/common/ScrollTracker/index.tsx:727804392": [
[55, 30, 29, "Argument of type \'number | undefined\' is not assignable to parameter of type \'number\'.\\n Type \'undefined\' is not assignable to type \'number\'.", "745919071"]
],
"js/components/common/SearchBar/InlineSearchResults/SearchItemList/SearchItem/tests/index.spec.tsx:3022074895": [
[63, 30, 36, "No overload matches this call.\\n Overload 1 of 3, \'(node: ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>, options?: ShallowRendererProps | undefined): ShallowWrapper<...>\', gave the following error.\\n Argument of type \'Element | null\' is not assignable to parameter of type \'ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>\'.\\n Type \'null\' is not assignable to type \'ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>\'.\\n Overload 2 of 3, \'(node: ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>, options?: ShallowRendererProps | undefined): ShallowWrapper<...>\', gave the following error.\\n Argument of type \'Element | null\' is not assignable to parameter of type \'ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>\'.\\n Type \'null\' is not assignable to type \'ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>\'.\\n Overload 3 of 3, \'(node: ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>, options?: ShallowRendererProps | undefined): ShallowWrapper<...>\', gave the following error.\\n Argument of type \'Element | null\' is not assignable to parameter of type \'ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>\'.\\n Type \'null\' is not assignable to type \'ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>\'.", "4042031348"]
"js/components/common/SearchBar/InlineSearchResults/SearchItemList/SearchItem/tests/index.spec.tsx:3109268054": [
[62, 30, 36, "No overload matches this call.\\n Overload 1 of 3, \'(node: ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>, options?: ShallowRendererProps | undefined): ShallowWrapper<...>\', gave the following error.\\n Argument of type \'Element | null\' is not assignable to parameter of type \'ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>\'.\\n Type \'null\' is not assignable to type \'ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>\'.\\n Overload 2 of 3, \'(node: ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>, options?: ShallowRendererProps | undefined): ShallowWrapper<...>\', gave the following error.\\n Argument of type \'Element | null\' is not assignable to parameter of type \'ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>\'.\\n Type \'null\' is not assignable to type \'ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>\'.\\n Overload 3 of 3, \'(node: ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>, options?: ShallowRendererProps | undefined): ShallowWrapper<...>\', gave the following error.\\n Argument of type \'Element | null\' is not assignable to parameter of type \'ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>\'.\\n Type \'null\' is not assignable to type \'ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>\'.", "4042031348"]
],
"js/components/common/SearchBar/InlineSearchResults/tests/index.spec.tsx:2567444475": [
[51, 13, 56, "Conversion of type \'{ page_index: number; results: { display_name: string; email: string; employee_type: null; first_name: string; full_name: string; github_username: string; is_active: boolean; last_name: string; ... 7 more ...; user_id: string; }[]; total_results: number; }\' to type \'SearchResults<UserResource>\' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to \'unknown\' first.\\n Types of property \'results\' are incompatible.\\n Type \'{ display_name: string; email: string; employee_type: null; first_name: string; full_name: string; github_username: string; is_active: boolean; last_name: string; manager_email: string; manager_fullname: string; ... 5 more ...; user_id: string; }[]\' is not comparable to type \'UserResource[]\'.\\n Type \'{ display_name: string; email: string; employee_type: null; first_name: string; full_name: string; github_username: string; is_active: boolean; last_name: string; manager_email: string; manager_fullname: string; ... 5 more ...; user_id: string; }\' is not comparable to type \'UserResource\'.\\n Types of property \'employee_type\' are incompatible.\\n Type \'null\' is not comparable to type \'string\'.", "3811500358"]
......@@ -206,9 +203,9 @@ exports[`strict null compilation`] = {
[30, 54, 8, "Argument of type \'Partial<Location<{} | null | undefined>> | undefined\' is not assignable to parameter of type \'Partial<Location<{} | null | undefined>>\'.\\n Type \'undefined\' is not assignable to type \'Partial<Location<{} | null | undefined>>\'.", "2700611480"],
[403, 30, 4, "Argument of type \'null\' is not assignable to parameter of type \'Partial<SearchBarProps> | undefined\'.", "2087897566"]
],
"js/components/common/SearchBar/index.tsx:3840434542": [
[248, 6, 11, "No overload matches this call.\\n The last overload gave the following error.\\n Type \'(() => SubmitSearchRequest) | null\' is not assignable to type \'ActionCreator<any>\'.\\n Type \'null\' is not assignable to type \'ActionCreator<any>\'.", "2296208050"],
[263, 4, 18, "No overload matches this call.\\n The last overload gave the following error.\\n Argument of type \'(dispatch: any, ownProps: any) => ActionCreator<unknown>\' is not assignable to parameter of type \'DispatchFromProps\'.\\n Type \'(dispatch: any, ownProps: any) => ActionCreator<unknown>\' is missing the following properties from type \'DispatchFromProps\': submitSearch, onInputChange, onSelectInlineResult", "2926224796"]
"js/components/common/SearchBar/index.tsx:280133100": [
[253, 6, 11, "No overload matches this call.\\n The last overload gave the following error.\\n Type \'(() => SubmitSearchRequest) | null\' is not assignable to type \'ActionCreator<any>\'.\\n Type \'null\' is not assignable to type \'ActionCreator<any>\'.", "2296208050"],
[268, 4, 18, "No overload matches this call.\\n The last overload gave the following error.\\n Argument of type \'(dispatch: any, ownProps: any) => ActionCreator<unknown>\' is not assignable to parameter of type \'DispatchFromProps\'.\\n Type \'(dispatch: any, ownProps: any) => ActionCreator<unknown>\' is missing the following properties from type \'DispatchFromProps\': submitSearch, onInputChange, onSelectInlineResult", "2926224796"]
],
"js/components/common/Tags/TagInput/index.tsx:3754832290": [
[63, 22, 6, "Type \'undefined\' is not assignable to type \'GetAllTagsRequest\'.", "1979467425"],
......@@ -307,31 +304,31 @@ exports[`strict null compilation`] = {
[360, 18, 13, "Object is possibly \'undefined\'.", "1305766902"],
[361, 17, 13, "Object is possibly \'undefined\'.", "1305766902"]
],
"js/ducks/search/sagas.ts:2537273293": [
[116, 10, 7, "Property \'filters\' does not exist on type \'UpdateSearchStatePayload | undefined\'.", "1789297334"],
[116, 19, 8, "Property \'resource\' does not exist on type \'UpdateSearchStatePayload | undefined\'.", "2131237679"],
[116, 29, 9, "Property \'updateUrl\' does not exist on type \'UpdateSearchStatePayload | undefined\'.", "3222485055"],
[116, 40, 12, "Property \'submitSearch\' does not exist on type \'UpdateSearchStatePayload | undefined\'.", "30183583"]
"js/ducks/search/sagas.ts:2952790030": [
[114, 10, 7, "Property \'filters\' does not exist on type \'UpdateSearchStatePayload | undefined\'.", "1789297334"],
[114, 19, 8, "Property \'resource\' does not exist on type \'UpdateSearchStatePayload | undefined\'.", "2131237679"],
[114, 29, 9, "Property \'updateUrl\' does not exist on type \'UpdateSearchStatePayload | undefined\'.", "3222485055"],
[114, 40, 12, "Property \'submitSearch\' does not exist on type \'UpdateSearchStatePayload | undefined\'.", "30183583"]
],
"js/ducks/search/utils.ts:1054027285": [
[22, 13, 12, "Object is possibly \'undefined\'.", "589203217"],
[24, 13, 11, "Object is possibly \'undefined\'.", "668071166"],
[26, 13, 16, "Object is possibly \'undefined\'.", "3205469291"]
],
"js/ducks/tableMetadata/api/helpers.spec.ts:2186521600": [
[191, 44, 8, "Argument of type \'{ display_name: null; email: string; employee_type: string; first_name: string; full_name: string; github_username: string; is_active: boolean; last_name: string; manager_email?: string | undefined; ... 5 more ...; user_id: string; }\' is not assignable to parameter of type \'PeopleUser\'.\\n Types of property \'display_name\' are incompatible.\\n Type \'null\' is not assignable to type \'string\'.", "3765169026"]
"js/ducks/tableMetadata/api/helpers.spec.ts:3775424408": [
[184, 44, 8, "Argument of type \'{ display_name: null; email: string; employee_type: string; first_name: string; full_name: string; github_username: string; is_active: boolean; last_name: string; manager_email?: string | undefined; ... 5 more ...; user_id: string; }\' is not assignable to parameter of type \'PeopleUser\'.\\n Types of property \'display_name\' are incompatible.\\n Type \'null\' is not assignable to type \'string\'.", "3765169026"]
],
"js/ducks/tableMetadata/api/v0.ts:78752867": [
"js/ducks/tableMetadata/api/v0.ts:1644381619": [
[137, 24, 7, "Argument of type \'Promise<AxiosResponse<any> | undefined>\' is not assignable to parameter of type \'never\'.", "1363914868"]
],
"js/ducks/tableMetadata/reducer.ts:1854876685": [
[66, 2, 10, "Type \'null\' is not assignable to type \'number\'.", "3382497788"]
"js/ducks/tableMetadata/index.spec.ts:535377148": [
[485, 66, 4, "Argument of type \'null\' is not assignable to parameter of type \'(() => any) | undefined\'.", "2087897566"],
[512, 53, 4, "Argument of type \'null\' is not assignable to parameter of type \'(() => any) | undefined\'.", "2087897566"],
[625, 16, 4, "Argument of type \'null\' is not assignable to parameter of type \'(() => any) | undefined\'.", "2087897566"],
[657, 16, 4, "Argument of type \'null\' is not assignable to parameter of type \'(() => any) | undefined\'.", "2087897566"]
],
"js/ducks/tableMetadata/tests/index.spec.ts:4184850197": [
[491, 66, 4, "Argument of type \'null\' is not assignable to parameter of type \'(() => any) | undefined\'.", "2087897566"],
[518, 53, 4, "Argument of type \'null\' is not assignable to parameter of type \'(() => any) | undefined\'.", "2087897566"],
[631, 16, 4, "Argument of type \'null\' is not assignable to parameter of type \'(() => any) | undefined\'.", "2087897566"],
[663, 16, 4, "Argument of type \'null\' is not assignable to parameter of type \'(() => any) | undefined\'.", "2087897566"]
"js/ducks/tableMetadata/reducer.ts:2668005658": [
[65, 2, 10, "Type \'null\' is not assignable to type \'number\'.", "3382497788"]
],
"js/ducks/tags/reducer.ts:419330645": [
[130, 16, 48, "Object is possibly \'undefined\'.", "1931932323"]
......
......@@ -29,6 +29,10 @@ $users: (
users: '/static/images/icons/users.svg',
);
$check: (
check: '/static/images/icons/check.svg',
);
// Given a Map of key/value pairs, generates a new class
@mixin iconBackgrounds($map) {
@each $name, $url in $map {
......@@ -43,6 +47,7 @@ span.icon {
@include iconBackgrounds($data-stores);
@include iconBackgrounds($dashboards);
@include iconBackgrounds($users);
@include iconBackgrounds($check);
background-color: $icon-bg;
border: none;
......@@ -55,6 +60,8 @@ span.icon {
}
img.icon {
/*DEPRECATED: follow behavior above to generate
icons*/
background-color: $icon-bg;
border: none;
height: $icon-size;
......
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#F2F2F2" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="feather feather-check"><polyline points="20 6 9 17 4 12"></polyline></svg>
\ No newline at end of file
......@@ -7,4 +7,3 @@ export const ADD_DESC_TEXT = 'Add Description in';
export const EDIT_DESC_TEXT = 'Click to edit description in';
export const LAST_RUN_SUCCEEDED = 'succeeded';
export const LAST_RUN_FAILED = 'failed';
......@@ -10,13 +10,11 @@ import { shallow } from 'enzyme';
import LoadingSpinner from 'components/common/LoadingSpinner';
import Breadcrumb from 'components/common/Breadcrumb';
import BookmarkIcon from 'components/common/Bookmark/BookmarkIcon';
import Flag from 'components/common/Flag';
import ResourceList from 'components/common/ResourceList';
import TabsComponent from 'components/common/TabsComponent';
import { dashboardMetadata } from 'fixtures/metadata/dashboard';
import { NO_TIMESTAMP_TEXT } from 'components/constants';
import { ResourceType } from 'interfaces';
import { BadgeStyle } from 'config/config-types';
import ChartList from './ChartList';
import DashboardOwnerEditor from './DashboardOwnerEditor';
import ImagePreview from './ImagePreview';
......@@ -139,26 +137,6 @@ describe('DashboardPage', () => {
});
});
describe('mapStatusToStyle', () => {
let wrapper;
beforeAll(() => {
({ wrapper } = setup());
});
it('returns BadgeStyle.SUCCESS if status === LAST_RUN_SUCCEEDED', () => {
expect(
wrapper.instance().mapStatusToStyle(Constants.LAST_RUN_SUCCEEDED)
).toBe(BadgeStyle.SUCCESS);
});
it('returns BadgeStyle.DANGER if status !== LAST_RUN_SUCCEEDED', () => {
expect(wrapper.instance().mapStatusToStyle('anythingelse')).toBe(
BadgeStyle.DANGER
);
});
});
describe('render', () => {
const { props, wrapper } = setup();
......@@ -215,19 +193,13 @@ describe('DashboardPage', () => {
expect(wrapper.find(DashboardOwnerEditor).exists()).toBe(true);
});
it('renders a Flag for last run state', () => {
const mockStyle = BadgeStyle.DANGER;
const mapStatusToStyleSpy = jest
.spyOn(wrapper.instance(), 'mapStatusToStyle')
.mockImplementationOnce(() => mockStyle);
wrapper.instance().forceUpdate();
const element = wrapper.find('.last-run-state').find(Flag);
expect(element.props().text).toBe(props.dashboard.last_run_state);
expect(mapStatusToStyleSpy).toHaveBeenCalledWith(
props.dashboard.last_run_state
);
expect(element.props().labelStyle).toBe(mockStyle);
it('renders a ResourceStatusMarker for last run state', () => {
const expected = 1;
const actual = wrapper
.find('.last-run-state')
.find('ResourceStatusMarker').length;
expect(actual).toEqual(expected);
});
it('renders an ImagePreview with correct props', () => {
......
......@@ -13,7 +13,6 @@ import * as ReactMarkdown from 'react-markdown';
import AvatarLabel from 'components/common/AvatarLabel';
import Breadcrumb from 'components/common/Breadcrumb';
import BookmarkIcon from 'components/common/Bookmark/BookmarkIcon';
import Flag from 'components/common/Flag';
import EditableSection from 'components/common/EditableSection';
import LoadingSpinner from 'components/common/LoadingSpinner';
import TabsComponent from 'components/common/TabsComponent';
......@@ -25,15 +24,16 @@ import { DashboardMetadata } from 'interfaces/Dashboard';
import DashboardOwnerEditor from 'components/DashboardPage/DashboardOwnerEditor';
import QueryList from 'components/DashboardPage/QueryList';
import ChartList from 'components/DashboardPage/ChartList';
import ResourceStatusMarker from 'components/common/ResourceStatusMarker';
import { formatDateTimeShort } from 'utils/dateUtils';
import ResourceList from 'components/common/ResourceList';
import {
ADD_DESC_TEXT,
EDIT_DESC_TEXT,
DASHBOARD_SOURCE,
LAST_RUN_SUCCEEDED,
OWNER_HEADER_TEXT,
DASHBOARD_SOURCE,
TABLES_PER_PAGE,
LAST_RUN_SUCCEEDED,
} from 'components/DashboardPage/constants';
import TagInput from 'components/common/Tags/TagInput';
import { ResourceType } from 'interfaces';
......@@ -109,11 +109,11 @@ export class DashboardPage extends React.Component<
}
}
mapStatusToStyle = (status: string): BadgeStyle => {
mapStatusToBoolean = (status: string): boolean => {
if (status === LAST_RUN_SUCCEEDED) {
return BadgeStyle.SUCCESS;
return true;
}
return BadgeStyle.DANGER;
return false;
};
renderTabs() {
......@@ -304,10 +304,9 @@ export class DashboardPage extends React.Component<
: NO_TIMESTAMP_TEXT}
</time>
<div className="last-run-state">
<Flag
caseType="sentenceCase"
text={dashboard.last_run_state}
labelStyle={this.mapStatusToStyle(
<ResourceStatusMarker
stateText={dashboard.last_run_state}
succeeded={this.mapStatusToBoolean(
dashboard.last_run_state
)}
/>
......
......@@ -18,3 +18,5 @@ export const GITHUB_LINK_TEXT = 'Github';
export const EMPTY_TEXT_PREFIX = 'User has no';
export const FOOTER_TEXT_PREFIX = 'View all';
export const NOT_ACTIVE_USER_TEXT = 'Alumni';
......@@ -335,23 +335,6 @@ describe('ProfilePage', () => {
);
});
it('renders Flag with correct props if user not active', () => {
const userCopy = {
...globalState.user.profile.user,
is_active: false,
};
const { wrapper } = setup({
user: userCopy,
});
expect(
wrapper.find('.header-title-text').find(Flag).props()
).toMatchObject({
caseType: 'sentenceCase',
labelStyle: BadgeStyle.DANGER,
text: 'Alumni',
});
});
it('renders user role', () => {
expect(wrapper.find('#user-role').text()).toEqual('Tester');
});
......@@ -366,6 +349,18 @@ describe('ProfilePage', () => {
);
});
it('renders alumni bullet is user not active', () => {
const userCopy = {
...globalState.user.profile.user,
is_active: false,
};
const { wrapper } = setup({
user: userCopy,
});
const expected = 1;
expect(wrapper.find('#alumni').length).toEqual(expected);
});
it('renders github link with correct href', () => {
expect(wrapper.find('#github-link').props().href).toEqual(
'https://github.com/githubName'
......
......@@ -43,6 +43,7 @@ import {
FOOTER_TEXT_PREFIX,
GITHUB_LINK_TEXT,
ITEMS_PER_PAGE,
NOT_ACTIVE_USER_TEXT,
OWNED_LABEL,
OWNED_SOURCE,
OWNED_TITLE_PREFIX,
......@@ -213,16 +214,7 @@ export class ProfilePage extends React.Component<
);
} else {
userName = (
<h1 className="h3 header-title-text truncated">
{user.display_name}
{!user.is_active && (
<Flag
caseType="sentenceCase"
labelStyle={BadgeStyle.DANGER}
text="Alumni"
/>
)}
</h1>
<h1 className="h3 header-title-text truncated">{user.display_name}</h1>
);
}
......@@ -238,6 +230,7 @@ export class ProfilePage extends React.Component<
{user.manager_fullname && (
<li id="user-manager">{`Manager: ${user.manager_fullname}`}</li>
)}
{!user.is_active && <li id="alumni">{NOT_ACTIVE_USER_TEXT}</li>}
</ul>
</div>
);
......
......@@ -15,6 +15,7 @@ import TableHeaderBullets, { TableHeaderBulletsProps } from '.';
const MOCK_RESOURCE_DISPLAY_NAME = 'Test';
const MOCK_DB_DISPLAY_NAME = 'AlsoTest';
const TABLE_VIEW_TEXT = 'table view';
jest.mock('config/config-utils', () => ({
getDisplayNameByResource: jest.fn(),
......@@ -26,6 +27,7 @@ describe('TableHeaderBullets', () => {
const props: TableHeaderBulletsProps = {
database: 'hive',
cluster: 'main',
isView: true,
...propOverrides,
};
const wrapper = shallow(<TableHeaderBullets {...props} />);
......@@ -71,5 +73,9 @@ describe('TableHeaderBullets', () => {
it('renders a list with cluster', () => {
expect(listElement.find('li').at(2).text()).toEqual(props.cluster);
});
it('renders a list with table view', () => {
expect(listElement.find('li').at(3).text()).toEqual(TABLE_VIEW_TEXT);
});
});
});
......@@ -10,20 +10,25 @@ import {
import { ResourceType } from 'interfaces/Resources';
import { TABLE_VIEW_TEXT } from './constants';
export interface TableHeaderBulletsProps {
cluster: string;
database: string;
isView: boolean;
}
const TableHeaderBullets: React.FC<TableHeaderBulletsProps> = ({
cluster,
database,
isView,
}: TableHeaderBulletsProps) => {
return (
<ul className="header-bullets">
<li>{getDisplayNameByResource(ResourceType.table)}</li>
<li>{getSourceDisplayName(database, ResourceType.table)}</li>
<li>{cluster}</li>
{isView && <li>{TABLE_VIEW_TEXT}</li>}
</ul>
);
};
......@@ -31,6 +36,7 @@ const TableHeaderBullets: React.FC<TableHeaderBulletsProps> = ({
TableHeaderBullets.defaultProps = {
cluster: '',
database: '',
isView: false,
};
export default TableHeaderBullets;
......@@ -27,7 +27,6 @@ import TabsComponent from 'components/common/TabsComponent';
import TagInput from 'components/common/Tags/TagInput';
import EditableText from 'components/common/EditableText';
import LoadingSpinner from 'components/common/LoadingSpinner';
import Flag from 'components/common/Flag';
import ColumnList from 'components/TableDetail/ColumnList';
import DataPreviewButton from 'components/TableDetail/DataPreviewButton';
......@@ -238,11 +237,9 @@ export class TableDetail extends React.Component<
<TableHeaderBullets
database={data.database}
cluster={data.cluster}
isView={data.is_view}
/>
{data.badges.length > 0 && <BadgeList badges={data.badges} />}
{data.is_view && (
<Flag text="table view" labelStyle={BadgeStyle.WARNING} />
)}
</div>
</div>
<div className="header-section header-links">
......
......@@ -86,7 +86,8 @@ $card-copy-max-lines: 3;
@each $line in $shimmer-loader-items {
.shimmer-row-line--#{$line} {
width: (
width:
(
random($shimmer-loader-row-max-width - $shimmer-loader-row-min-width) +
$shimmer-loader-row-min-width
) +
......
......@@ -182,38 +182,6 @@ describe('UserListItem', () => {
expect(resourceBadges.exists()).toBe(true);
});
it('does not render Alumni flag if user is active', () => {
expect(resourceBadges.find(Flag).exists()).toBe(false);
});
it('renders Alumni flag if user not active', () => {
const { wrapper } = setup({
user: {
type: ResourceType.user,
display_name: 'firstname lastname',
email: 'test@test.com',
employee_type: 'fulltime',
first_name: 'firstname',
full_name: 'firstname lastname',
github_username: 'githubName',
is_active: false,
last_name: 'lastname',
manager_fullname: 'Test Manager',
profile_url: 'www.test.com',
role_name: 'Tester',
slack_id: 'www.slack.com',
team_name: 'QA',
user_id: 'test0',
},
});
const flagComponent = wrapper.find('.resource-badges').find(Flag);
expect(flagComponent.exists()).toBe(true);
expect(flagComponent.props()).toMatchObject({
text: 'Alumni',
labelStyle: BadgeStyle.DANGER,
});
});
it('renders correct end icon', () => {
const expectedClassName = 'icon icon-right';
expect(resourceBadges.find('img').props().className).toEqual(
......
......@@ -56,9 +56,6 @@ class UserListItem extends React.Component<UserListItemProps, {}> {
</div>
<div className="resource-type">User</div>
<div className="resource-badges">
{!user.is_active && (
<Flag text="Alumni" labelStyle={BadgeStyle.DANGER} />
)}
<img className="icon icon-right" alt="" />
</div>
</Link>
......
// Copyright Contributors to the Amundsen project.
// SPDX-License-Identifier: Apache-2.0
import * as React from 'react';
import { mount } from 'enzyme';
import ResourceStatusMarker, { StatusMarkerProps } from '.';
const setup = (propsOverrides?: Partial<StatusMarkerProps>) => {
const props = {
stateText: '',
succeeded: false,
...propsOverrides,
};
const wrapper = mount<typeof ResourceStatusMarker>(
<ResourceStatusMarker {...props} />
);
return { props, wrapper };
};
describe('RunStateContainer', () => {
describe('Succeded', () => {
it('renders SuccessState when lastRunState successful', () => {
const { wrapper } = setup({
stateText: 'Succeeded',
succeeded: true,
});
const expected = 1;
const actual = wrapper.find('.success').length;
expect(actual).toEqual(expected);
});
});
describe('Failed', () => {
const { wrapper } = setup({
stateText: 'Failed',
});
it('renders MissedState when lastRunState failed', () => {
const expected = 1;
const actual = wrapper.find('.failure').length;
expect(actual).toEqual(expected);
});
it('renders failure icon', () => {
const expected = 1;
const actual = wrapper.find('.failure-icon').length;
expect(expected).toEqual(actual);
});
});
});
// Copyright Contributors to the Amundsen project.
// SPDX-License-Identifier: Apache-2.0
import * as React from 'react';
import './styles.scss';
export interface StatusMarkerProps {
stateText: string;
succeeded: boolean;
}
export interface StateProps {
stateText: string;
}
const FailureState: React.FC<StateProps> = ({ stateText }: StateProps) => {
return (
<div className="failure">
<div className="failure-icon">
<div className="exclamation-top" />
<div className="exclamation-bottom" />
</div>
<span className="status-text">{stateText}</span>
</div>
);
};
const SuccessState: React.FC<StateProps> = ({ stateText }: StateProps) => {
return (
<div className="success">
<div className="success-icon">
<span className="icon icon-check" />
</div>
<span className="status-text">{stateText}</span>
</div>
);
};
const ResourceStatusMarker: React.FC<StatusMarkerProps> = ({
stateText,
succeeded,
}: StatusMarkerProps) => {
const state = stateText.charAt(0).toUpperCase() + stateText.slice(1);
if (succeeded) {
return <SuccessState stateText={state} />;
}
return <FailureState stateText={state} />;
};
export default ResourceStatusMarker;
// Copyright Contributors to the Amundsen project.
// SPDX-License-Identifier: Apache-2.0
@import 'variables';
@import 'typography-default';
$icon-status-color: #f2f2f2;
$icon-status-missed: $sunset60;
$icon-status-hit: #00824c;
$icon-size: 14px;
.failure-icon,
.success-icon {
width: $icon-size;
height: $icon-size;
border-radius: 100%;
display: inline-block;
vertical-align: middle;
}
.failure-icon {
background-color: $icon-status-missed;
.exclamation-top {
width: 2px;
height: 4px;
background-color: $icon-status-color;
margin: 4px 6px 3px;
}
.exclamation-bottom {
width: 2px;
height: 2px;
border-radius: 100%;
background-color: $icon-status-color;
margin: -2px 6px;
}
}
.success-icon {
background-color: $icon-status-hit;
.icon-check {
background-color: $icon-status-color;
width: 10px;
height: 10px;
margin-top: -6px;
margin-left: 2px;
min-width: 0;
}
}
.status-text {
@extend %text-body-w2;
display: inline-block;
margin-left: $spacer-1;
vertical-align: middle;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment