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

Plugin-Admin #36

Merged
merged 22 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
cdd9a8c
[plugin-admin] initial commit
TilmanHaupt Mar 18, 2024
b5bf051
[plugin-admin] added icon for condition
TilmanHaupt Mar 18, 2024
11db184
[plugin-admin] hide optionValues with prefix greenhouse
TilmanHaupt Mar 19, 2024
7c58cfb
[plugin-admin] PluginDetails are triggered via id change
TilmanHaupt Mar 19, 2024
be802e7
[plugin-admin] deeplinks fo details enabled
TilmanHaupt Mar 19, 2024
e9d504d
[plugin-admin] pluginList last col reduce width
TilmanHaupt Mar 19, 2024
b0a85eb
[plugin-admin] implement tests for useAPI
TilmanHaupt Mar 19, 2024
994780d
[plugin-admin] Tests for createPluginConfig
TilmanHaupt Mar 19, 2024
7e6e764
[plugin-admin] Fix colorbug tailwind, overflow DataGrid
TilmanHaupt Mar 20, 2024
e676f65
[plugin-admin] Added heading for details
TilmanHaupt Mar 20, 2024
e7f371b
[plugin-admin] datagrid supports hover and active
TilmanHaupt Mar 21, 2024
8f03988
[plugin-admin] Changed UI of PluginDetail
TilmanHaupt Mar 21, 2024
5b9ba85
[plugin-admin] clean up, panel can close via click on list
TilmanHaupt Mar 22, 2024
8f1d64b
[plugin-admin] handling in UI of undefined values and arrays
TilmanHaupt Mar 22, 2024
8dc41b4
[plugin-admin] Disabled plugins are now shown
TilmanHaupt Mar 25, 2024
90ef801
[plugin-admin] comments for the application
TilmanHaupt Mar 25, 2024
b045eb6
Automatic application of license header
Mar 25, 2024
0c84655
[plugin-admin] Cleaned Code, Correct Licence
TilmanHaupt Mar 26, 2024
741c6d4
[plugin-admin] store is now sliced in global and pluginstore
TilmanHaupt Mar 26, 2024
30a0c19
[plugin-admin] tests for sorting of pluginConfig
TilmanHaupt Mar 26, 2024
4fb76b2
[plugin-admin] tests if external service URL are build correctly
TilmanHaupt Mar 26, 2024
fc63943
[plugin-admin] update name
TilmanHaupt Mar 26, 2024
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
Prev Previous commit
Next Next commit
Automatic application of license header
  • Loading branch information
License Bot committed Mar 25, 2024
commit b045eb6d5bea8a1cbc439952f4d2facde8f05958
5 changes: 5 additions & 0 deletions ui/plugin-admin/__mocks__/client.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
* SPDX-License-Identifier: Apache-2.0
*/

import { JSDOM } from "jsdom"
const dom = new JSDOM()
global.document = dom.window.document
Expand Down
5 changes: 5 additions & 0 deletions ui/plugin-admin/__mocks__/fileMock.js
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
* SPDX-License-Identifier: Apache-2.0
*/

module.exports = "test-file-stub"
5 changes: 5 additions & 0 deletions ui/plugin-admin/__mocks__/styleMock.js
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
* SPDX-License-Identifier: Apache-2.0
*/

module.exports = {}
5 changes: 5 additions & 0 deletions ui/plugin-admin/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
* SPDX-License-Identifier: Apache-2.0
*/

module.exports = {
env: {
test: {
Expand Down
5 changes: 5 additions & 0 deletions ui/plugin-admin/esbuild.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
* SPDX-License-Identifier: Apache-2.0
*/

const esbuild = require("esbuild")
const fs = require("node:fs/promises")
const pkg = require("./package.json")
Expand Down
5 changes: 5 additions & 0 deletions ui/plugin-admin/helpers/appProps.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
* SPDX-License-Identifier: Apache-2.0
*/

const path = require("path")
const fs = require("fs")

Expand Down
5 changes: 5 additions & 0 deletions ui/plugin-admin/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
* SPDX-License-Identifier: Apache-2.0
*/

module.exports = {
transform: { "\\.[jt]sx?$": "babel-jest" },
testEnvironment: "jsdom",
Expand Down
5 changes: 5 additions & 0 deletions ui/plugin-admin/public/index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<!--
~ SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
~ SPDX-License-Identifier: Apache-2.0
-->

<!DOCTYPE html>
<html lang="en">
<head>
Expand Down
5 changes: 5 additions & 0 deletions ui/plugin-admin/setupTests.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
* SPDX-License-Identifier: Apache-2.0
*/

// jest-dom adds custom jest matchers for asserting on DOM nodes.
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
Expand Down
5 changes: 5 additions & 0 deletions ui/plugin-admin/src/App.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React, { useEffect } from "react"

import { AppShell, AppShellProvider } from "juno-ui-components"
Expand Down
5 changes: 5 additions & 0 deletions ui/plugin-admin/src/AppContent.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React, { useEffect } from "react"
import { Container } from "juno-ui-components"
import useAPI from "./hooks/useAPI"
Expand Down
5 changes: 5 additions & 0 deletions ui/plugin-admin/src/assets/juno-danger.svg
TilmanHaupt marked this conversation as resolved.
Show resolved Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions ui/plugin-admin/src/assets/map.svg
TilmanHaupt marked this conversation as resolved.
Show resolved Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions ui/plugin-admin/src/components/AsyncWorker.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React from "react"
import useCommunication from "../hooks/useCommunication"
import useUrlState from "../hooks/useUrlState"
Expand Down
5 changes: 5 additions & 0 deletions ui/plugin-admin/src/components/Auth.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React from "react"
import { useLoggedIn } from "./StoreProvider"

Expand Down
5 changes: 5 additions & 0 deletions ui/plugin-admin/src/components/Plugin.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React from "react"
import { DataGridRow, DataGridCell } from "juno-ui-components"
import { useGlobalsActions, useShowDetailsFor } from "./StoreProvider"
Expand Down
5 changes: 5 additions & 0 deletions ui/plugin-admin/src/components/PluginDetail.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React, { useEffect, useState } from "react"
import {
useShowDetailsFor,
Expand Down
5 changes: 5 additions & 0 deletions ui/plugin-admin/src/components/PluginList.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React from "react"
import {
DataGrid,
Expand Down
5 changes: 5 additions & 0 deletions ui/plugin-admin/src/components/StoreProvider.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React, { createContext, useContext } from "react"
import { useStore as create } from "zustand"
import createStore from "../lib/store"
Expand Down
5 changes: 5 additions & 0 deletions ui/plugin-admin/src/hooks/useAPI.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
* SPDX-License-Identifier: Apache-2.0
*/

import { useCallback, useMemo } from "react"
import useClient from "./useClient"
import { useAuthData } from "../components/StoreProvider"
Expand Down
5 changes: 5 additions & 0 deletions ui/plugin-admin/src/hooks/useAPI.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
* SPDX-License-Identifier: Apache-2.0
*/

// test of useAPI hook
import { describe, expect, test } from "@jest/globals"
import { createPluginConfig } from "./useAPI"
Expand Down
5 changes: 5 additions & 0 deletions ui/plugin-admin/src/hooks/useClient.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React, { useMemo } from "react"
import { createClient } from "sapcc-k8sclient"
import { useApiEndpoint } from "../components/StoreProvider"
Expand Down
5 changes: 5 additions & 0 deletions ui/plugin-admin/src/hooks/useCommunication.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React, { useEffect } from "react"
import { useGlobalsActions } from "../components/StoreProvider"

Expand Down
5 changes: 5 additions & 0 deletions ui/plugin-admin/src/hooks/useURLState.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
* SPDX-License-Identifier: Apache-2.0
*/

import { useLayoutEffect, useEffect, useState } from "react"
import { registerConsumer } from "url-state-provider"
import {
Expand Down
5 changes: 5 additions & 0 deletions ui/plugin-admin/src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
* SPDX-License-Identifier: Apache-2.0
*/

import { createRoot } from "react-dom/client"
import React from "react"

Expand Down
5 changes: 5 additions & 0 deletions ui/plugin-admin/src/lib/store/createGlobalsSlice.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
* SPDX-License-Identifier: Apache-2.0
*/

const createGlobalsSlice = (set, get) => ({
globals: {
urlStateKey: "",
Expand Down
5 changes: 5 additions & 0 deletions ui/plugin-admin/src/lib/store/createGlobalsSlice.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
* SPDX-License-Identifier: Apache-2.0
*/

import * as React from "react"
import { renderHook, act } from "@testing-library/react"
import StoreProvider, {
Expand Down
5 changes: 5 additions & 0 deletions ui/plugin-admin/src/lib/store/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
* SPDX-License-Identifier: Apache-2.0
*/

import { createStore } from "zustand"
import { devtools } from "zustand/middleware"
import createGlobalsSlice from "./createGlobalsSlice"
Expand Down
3 changes: 3 additions & 0 deletions ui/plugin-admin/src/styles.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
// SPDX-License-Identifier: Apache-2.0

/* Do not remove these tailwind directives. Without them styles won't work as expected */
@tailwind base;
@tailwind components;
Expand Down
5 changes: 5 additions & 0 deletions ui/plugin-admin/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
* SPDX-License-Identifier: Apache-2.0
*/

// opacity helper to make custom colors work with opacity
function withOpacity(variableName) {
return ({ opacityVariable, opacityValue }) => {
Expand Down