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

Add "Edit" page to Repository tab #375

Merged

Conversation

dogmar
Copy link
Collaborator

@dogmar dogmar commented Jul 19, 2022

dogmar and others added 9 commits July 19, 2022 11:30
Update linting options
Prevent file upload/delete buttons from submitting form

Mostly done

Last bits

mutation partially working

Full mutation working (but tags don’t come back in update)

Finish functionality
@dogmar dogmar force-pushed the klink/eng-337-add-edit-page-to-repository-tab branch from 341f7d5 to 7c896bd Compare July 19, 2022 19:24
description,
category,
oauthUrl:
typeof oauthSettings?.uriFormat === 'string'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couldn't this just be oauthSettings?.uriFormat || ''? Or is the typeof clause doing some work to hint ts to it being a string

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make sure that it is a string we can use:

`${oauthSettings?.uriFormat || ''}`

},
},
update: (cache, { data: { updateRepository } }) => {
const prev: any = cache.readQuery({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this cache update necessary, my guess is apollo will just handle it? If it is, we have a helper updateCache that could compress some of the logic as well


const tagSearchRef = useRef<any>(null)

const [mutation, { loading }] = useMutation(UPDATE_REPOSITORY_MUTATION, {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can actually just get the error by doing const [mutation, { loading, error }] here

updateRepository(repositoryId: $repositoryId, attributes: $attributes) {
...RepoFragment
tags {
name: tag
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be best to not do this rename so the cache is consistent elsewhere that doesn't do that

}
: null,
...(iconUpdate.file ? { icon: iconUpdate.file } : {}),
tags: formState.tags.map(t => ({ tag: t.name })),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not doing this tag -> name switch might also eliminate the need for this map call

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This switch was happening all over the app, but I changed it on those places as well.

@dogmar dogmar requested a review from a team July 20, 2022 15:07
@dogmar dogmar changed the base branch from master to packages-redesign July 20, 2022 18:46
@dogmar dogmar requested review from maciaszczykm, floreks and michaeljguarino and removed request for floreks July 20, 2022 18:47
@dogmar dogmar merged commit 93501e8 into packages-redesign Jul 21, 2022
michaeljguarino added a commit that referenced this pull request Aug 19, 2022
* Add "Edit" page to Repository tab (#375)

* Update design-system

* Add typescript plugin to yarn

* Add linting for typescript

Update linting options

* Convert to .tsx

* Fix ts errors

* format with prettier

* Implement new page design

Prevent file upload/delete buttons from submitting form

Mostly done

Last bits

mutation partially working

Full mutation working (but tags don’t come back in update)

Finish functionality

* Remove unused typing

* Linting fixes

* Better intial form state

* Stop renaming tag props in gql queries

* Suppress apollo warning when removing tags

* Remove unnecessary manual cache update

* lint

* Better TS type

* Redesign packages screen (#376)

* Redesign detail container

* Redesigning chart layout

* Use light dashed lines in tree graphs

* Add view headers

* Redesign readme

* Redesign grades

* Header improvements

* Redesigning terraform layout

* Fix typos

* Extract duplicated header component

* Switch from flex to box to fix scaling issues

* Display configuration in code block

* Adjust terraform layout

* Remove redundant export

* Improvements on security screen

* Remove duplicated border

* Add message when there are no vunerabilities

* Add message when there are no scan failures

* Update messages

* Update install buttons

* Use outlet context

* Use select as version picker

* Add installed chip

* Add comment

* Fix console errors

* Other styling improvements

* Other styling improvements

* Lint

* Fill viewport

* Packages improvements (#382)

* Add back to packages button instead of breadcrumbs

* Redesign vulnerability list

* Put back button in scrollable container

* Add gap between vulnerability properties

* Use const width for first column

* Use pointer cursor

* Packages improvements (#383)

* Add collapse icon

* Fix linting issues

* Add legend

* Grid layout (#378)

* Add RepositorySideNav

* Edit vscode settings

* Remove an anchor

* Design some more

* More layout design

* Implement SideCar

* Delete RepositoryHeader

* Add icons

* Update deps

* And here goes the final grid

* Finish feature

* Update deps

* Update deps

* Lint

* Move layout components to their own files

* Update deps

* Rework layout to adapt to changes

* Break words on RepositorySidecar

* Fix InstallDropdownButton caret

* Add RepositorySideCarCollapsed

* Add Marketplace Layout

* Remove vscode dir

* Add typescript linter (#384)

* Add new linter config

* Lint

* Update after review

* Package improvements (#385)

* Update deps (#389)

* Packages improvements (#392)

* Put scan failures in scrollable container

* Change scroll container

* Add margin for hide button

* Reduce content padding

* Fix typo

* Do not force container height

* Redesign update queue

* Use new chips

* Move date component to utils and reuse it in update queue

* Fix markeplace layout (#388)

* Fix markeplace layout

* Design fixes

* Fix marketplace layout bug

* Add input margin

* ENG-310 - Redesign cluster view (#387)

* fix graphql

* Redesign cluster view

* Revert cluster.js

* Update clusters view

* Bump design system

* Use responsive layout and update logic

* Revert change

* Compensate for the missing right border

* Fix lint

* Fix unit tests

Co-authored-by: michaeljguarino <mjg@plural.sh>

* My profile refinement (#393)

* Use design system's page title component

* Redesign EAB credentials

* Fix list item borders when there is only one element

* Redesign public keys

* Set 896px width for ResponsiveLayoutContentContainer

* Redesign access tokens

* Add banner messages

* Add zero state

* Fix console errors

* Redesign security

* Redesign profile

* Finish profile redesign

* Layout refactoring

* Fix alignment issue

* Fix console error

* Add reset functionality

* Remove debug leftover

* Remove duplicated file and update imports

* Format files

* Design improvements (#401)

* Add empty states and other design improvements (#403)

* ENG-311 - Repository refinement (#399)

* Initial commit

* Improve OIDC view, toasts and more

* Use content card

* Use PageTitle where applicable

* Update tests view

* Fix an issue with scroller and add xterm theme

* Revert to token for tag input

* Fix redirect urls width

* Fix unit tests

* Lint fixes

* Fix lint issues, improve toasts and more

* New notifications system (#396)

* Update deps

* Add new notifications system

* Update deps

* Add empty state

* Setup Firebase hosting for plural

Should provide support for pr-based preview envs

* Add run and entryPoint to workflow

* Use yarn

* Remove entrypoint

* fix apiHost function for firebase

* disable service worker on previews

* Update design system and add ThemeProvider for new styled-components theme (#412)

Fix some TS and lint errors

Update design system

* Fix build issue (#414)

* Lint

* Redesign package version picker (#409)

* Use code and markdown components (#424)

* Update dependencies

* Replace markdown components

* Replace code components

* Login view refinement (#425)

* ENG-481/ENG-310 - Use new select component on clusters view (#417)

* Add cluster selector

* Use looping logo and bump design system

* Fix lint

* Update cloud shell init styling

* Update cloud shell build

* Use onboarding wrapper only

* Design improvements (#430)

* Bump design system version

* Set main branch for repo description

* Change highlight.js theme to base16/rebecca

* Set scrollable areas in my profile views

* Adjust "read more" & "hide" shifting

* Adjust tests bottom padding

* Make dependencies graph smaller

* Use secondary button as back button

* Redesign packages button group

* ENG-480 - Update login view and skip demo button styling (#429)

* Update login view and skip demo button styling

* Fix lint

* Review updates

* Design improvements (#433)

* Bump design system version

* Bump design system version

* Use sub tabs in repo packages view

* Use sub tab in chart dependencies view

* Use sub tabs in geodistribution view

* Use the same component for go back links

* Minor styling adjustments

* Remove unused imports

* Add small padding to outlet to make sure outline will not be hidden

* Update empty readme message

* Redesign packages filter

* Add empty state messages for packages

* Set content as scrollable not whole page

* Start Docker image redesign

* Redesign range picker

* Redesign public switch

* Restore vulnerability view

* Update header and empty message

* Redesign vulnerabilities table

* Redesign vulnerability details

* Improve scroll

* Fix go back link

* Update graph tooltip

* Minor adjustments

* Adjust graph ticks

* Ensure user stays on the same view when switching tag

* fix yarn lock

* fix lint

Co-authored-by: Chris Klink <85062+dogmar@users.noreply.github.com>
Co-authored-by: Marcin Maciaszczyk <marcin@plural.sh>
Co-authored-by: Sebastian Florek <sebastian@plural.sh>
Co-authored-by: michaeljguarino <mjg@plural.sh>
Co-authored-by: Marcin Maciaszczyk <marcin9yk@icloud.com>
Co-authored-by: michaeljguarino <mguarino46@gmail.com>
@dogmar dogmar deleted the klink/eng-337-add-edit-page-to-repository-tab branch August 22, 2022 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants