diff --git a/package-lock.json b/package-lock.json index 6f72e23d..55f865ce 100644 --- a/package-lock.json +++ b/package-lock.json @@ -56,6 +56,7 @@ "@typescript-eslint/eslint-plugin": "^6.0.0", "@typescript-eslint/parser": "^6.0.0", "@vitejs/plugin-react": "^4.2.0", + "autoprefixer": "^10.4.16", "concurrently": "^8.2.2", "eslint": "^8.45.0", "eslint-config-standard-with-typescript": "^39.1.1", @@ -68,7 +69,8 @@ "ts-jest": "^29.1.1", "tsx": "^4.1.4", "typescript": "^5.0.2", - "vite": "^5.0.0" + "vite": "^5.0.0", + "vite-plugin-static-copy": "^1.0.0" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -4122,6 +4124,43 @@ "dev": true, "license": "MIT" }, + "node_modules/autoprefixer": { + "version": "10.4.16", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.16.tgz", + "integrity": "sha512-7vd3UC6xKp0HLfua5IjZlcXvGAGy7cBAXTg2lyQ/8WpNhd6SiZ8Be+xm3FyBSYJx5GKcpRCzBh7RH4/0dnY+uQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/autoprefixer" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "browserslist": "^4.21.10", + "caniuse-lite": "^1.0.30001538", + "fraction.js": "^4.3.6", + "normalize-range": "^0.1.2", + "picocolors": "^1.0.0", + "postcss-value-parser": "^4.2.0" + }, + "bin": { + "autoprefixer": "bin/autoprefixer" + }, + "engines": { + "node": "^10 || ^12 || >=14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, "node_modules/available-typed-arrays": { "version": "1.0.5", "dev": true, @@ -6725,6 +6764,19 @@ "node": ">= 0.6" } }, + "node_modules/fraction.js": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.7.tgz", + "integrity": "sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==", + "dev": true, + "engines": { + "node": "*" + }, + "funding": { + "type": "patreon", + "url": "https://github.com/sponsors/rawify" + } + }, "node_modules/fresh": { "version": "0.5.2", "license": "MIT", @@ -6732,6 +6784,29 @@ "node": ">= 0.6" } }, + "node_modules/fs-extra": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", + "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, + "node_modules/fs-extra/node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "engines": { + "node": ">= 10.0.0" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "license": "ISC" @@ -8539,6 +8614,27 @@ "node": ">=6" } }, + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/jsonfile/node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "engines": { + "node": ">= 10.0.0" + } + }, "node_modules/keyv": { "version": "4.5.4", "dev": true, @@ -8881,6 +8977,15 @@ "node": ">=0.10.0" } }, + "node_modules/normalize-range": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz", + "integrity": "sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/npm-run-path": { "version": "4.0.1", "dev": true, @@ -11174,6 +11279,24 @@ } } }, + "node_modules/vite-plugin-static-copy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/vite-plugin-static-copy/-/vite-plugin-static-copy-1.0.0.tgz", + "integrity": "sha512-kMlrB3WDtC5GzFedNIPkpjnOAr8M11PfWOiUaONrUZ3AqogTsOmIhTt6w7Fh311wl8pN81ld7sfuOEogFJ9N8A==", + "dev": true, + "dependencies": { + "chokidar": "^3.5.3", + "fast-glob": "^3.2.11", + "fs-extra": "^11.1.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "peerDependencies": { + "vite": "^5.0.0" + } + }, "node_modules/vite/node_modules/esbuild": { "version": "0.19.6", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.6.tgz", diff --git a/package.json b/package.json index ee883a9e..6d028a22 100644 --- a/package.json +++ b/package.json @@ -65,6 +65,7 @@ "@typescript-eslint/eslint-plugin": "^6.0.0", "@typescript-eslint/parser": "^6.0.0", "@vitejs/plugin-react": "^4.2.0", + "autoprefixer": "^10.4.16", "concurrently": "^8.2.2", "eslint": "^8.45.0", "eslint-config-standard-with-typescript": "^39.1.1", @@ -77,6 +78,7 @@ "ts-jest": "^29.1.1", "tsx": "^4.1.4", "typescript": "^5.0.2", - "vite": "^5.0.0" + "vite": "^5.0.0", + "vite-plugin-static-copy": "^1.0.0" } } diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 00000000..9d55d43f --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,7 @@ +export default { + plugins: { + 'postcss-import': {}, + tailwindcss: {}, + autoprefixer: {} + } +} diff --git a/src/components/PlanningTable/Columns/Actions.tsx b/src/components/PlanningTable/Columns/Actions.tsx index cd12751d..01b20c76 100644 --- a/src/components/PlanningTable/Columns/Actions.tsx +++ b/src/components/PlanningTable/Columns/Actions.tsx @@ -31,9 +31,8 @@ export const actions: ColumnDef = { - {!deliverableUuids.length && 'No deliverables'} - {deliverableUuids.length && - deliverableUuids.map((uuid) => { + {deliverableUuids.length + ? deliverableUuids.map((uuid) => { return ( @@ -42,6 +41,7 @@ export const actions: ColumnDef = { ) }) + : 'No deliverables' } diff --git a/src/components/PlanningTable/Columns/Assignees.tsx b/src/components/PlanningTable/Columns/Assignees.tsx index 7082eed1..b32c84cb 100644 --- a/src/components/PlanningTable/Columns/Assignees.tsx +++ b/src/components/PlanningTable/Columns/Assignees.tsx @@ -9,7 +9,7 @@ export const assignees: ColumnDef = { cell: ({ row }) => { const assignees = row.getValue('assignees') || [] return ( -
3 && 'border rounded-full hidden lg:flex')}> {(assignees || []).slice(0, 3).map((assignee: string, index: number) => { const [first, last] = assignee.trim().split(' ') @@ -18,7 +18,7 @@ export const assignees: ColumnDef = { -
+
{initials}
@@ -40,7 +40,7 @@ export const assignees: ColumnDef = { const initials = `${first[0]}${last[0]}` return (
-
+
{initials}

{assignee}

diff --git a/src/components/PlanningTable/Columns/Section.tsx b/src/components/PlanningTable/Columns/Section.tsx index 8adc51ef..8007d8ab 100644 --- a/src/components/PlanningTable/Columns/Section.tsx +++ b/src/components/PlanningTable/Columns/Section.tsx @@ -10,9 +10,9 @@ export const section: ColumnDef = { cell: ({ row }) => { const sector = sectors.find((label) => label.value === row.original._source['document.rel.sector.title'][0]) - return sector && + return sector &&
- {sector.label} + {sector.label} } } diff --git a/src/components/PlanningTable/Columns/Title.tsx b/src/components/PlanningTable/Columns/Title.tsx index b3db6e6b..a124424a 100644 --- a/src/components/PlanningTable/Columns/Title.tsx +++ b/src/components/PlanningTable/Columns/Title.tsx @@ -29,7 +29,7 @@ export const title: ColumnDef = { {row.getValue('title')} {!!slugline?.length && ( - {slugline[0]} + {slugline[0]} )}
) diff --git a/tsconfig.json b/tsconfig.json index f29de8e8..8be13e6e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -50,6 +50,7 @@ "srv-src", "vite.config.ts", "tailwind.config.ts", + "postcss.config.js", "setupTests.ts", "jest.config.ts", "__mocks__/**/*", diff --git a/vite.config.ts b/vite.config.ts index 382937b8..f710bcc6 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,9 +1,20 @@ import path from 'path' import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' +import { viteStaticCopy } from 'vite-plugin-static-copy' export default defineConfig({ - plugins: [react()], + plugins: [ + react(), + viteStaticCopy({ + targets: [ + { + src: './node_modules/@ttab/elephant-ui/dist/styles/**/*', + dest: './' + } + ] + }) + ], resolve: { alias: { '@': path.resolve(__dirname, './src')