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

Remove /global_definition #71

Merged
merged 1 commit into from
Jul 11, 2024
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

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion frontend/components/GlobalDefinitionModulesTable/index.ts

This file was deleted.

13 changes: 0 additions & 13 deletions frontend/components/Layout/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ export const Header: React.FC = () => {
setNotification(null)
}, [notification, setNotification])

const globalDefinitionQuery = stringify({
compound: true,
concentrate: true,
onlyModule: true,
} as GraphOptions)
const globalDefinitionPath = `${path.globalDefinition.show()}?${globalDefinitionQuery}`

const buttons: ComponentProps<typeof AppNavi>['buttons'] = [
{
children: 'Definition List',
Expand All @@ -47,12 +40,6 @@ export const Header: React.FC = () => {
href: path.modules.index(),
onClick: () => navigate(path.modules.index()),
},
{
children: 'Global Definition',
current: pathname === path.globalDefinition.show(),
href: globalDefinitionPath,
onClick: () => navigate(globalDefinitionPath),
},
{
children: 'Source Aliases',
current: pathname === path.sourceAliases.index(),
Expand Down
6 changes: 0 additions & 6 deletions frontend/constants/path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ export const path = {
index: () => '/modules',
show: (module: string) => `/modules/${module}`,
},
globalDefinition: {
show: () => `/global_definition`,
},
licenses: {
index: () => '/licenses',
},
Expand Down Expand Up @@ -47,8 +44,5 @@ export const path = {
index: () => '/api/modules.json',
show: (module: string) => `/api/modules/${module}.json`,
},
globalDefinition: {
show: () => `/api/global_definition.json`,
},
},
}
2 changes: 0 additions & 2 deletions frontend/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { Layout } from './components/Layout'
import { path } from './constants/path'
import { NotFound } from './pages/Errors'
import { Show as DefinitionList } from './pages/DefinitionList'
import { Show as GlobalDefinitionShow } from './pages/GlobalDefinition'
import { Index as LicenseIndex } from './pages/Lincense'
import { Index as ModuleIndex, Show as ModuleShow } from './pages/Modules'
import { Index as SourceIndex, Show as SourceShow } from './pages/Sources'
Expand All @@ -24,7 +23,6 @@ ReactDOM.createRoot(document.getElementById('root')!).render(
<Route path={path.modules.index()} element={<ModuleIndex />} />
<Route path={path.modules.show('*')} element={<ModuleShow />} />
<Route path={path.licenses.index()} element={<LicenseIndex />} />
<Route path={path.globalDefinition.show()} element={<GlobalDefinitionShow />} />
<Route path="*" element={<NotFound />} />
</Route>
</Routes>
Expand Down
64 changes: 0 additions & 64 deletions frontend/pages/GlobalDefinition/Show.tsx

This file was deleted.

1 change: 0 additions & 1 deletion frontend/pages/GlobalDefinition/index.ts

This file was deleted.

11 changes: 0 additions & 11 deletions frontend/repositories/globalDefinitionRepository.ts

This file was deleted.

8 changes: 0 additions & 8 deletions lib/diver_down/web.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,6 @@ def call(env)
in ['GET', %r{\A/api/modules/(?<modulee>[^/]+)\.json\z}]
modulee = CGI.unescape(Regexp.last_match[:modulee])
@action.module(modulee)
in ['GET', %r{\A/api/global_definition\.json\z}]
focus_modules = request.params['focus_modules'] || []
modules = request.params['modules'] || []
compound = request.params['compound'] == '1'
concentrate = request.params['concentrate'] == '1'
only_module = request.params['only_module'] == '1'
remove_internal_sources = request.params['remove_internal_sources'] == '1'
@action.global_definition(compound, concentrate, only_module, remove_internal_sources, focus_modules, modules)
in ['GET', %r{\A/api/definitions/(?<bit_id>\d+)\.json\z}]
bit_id = Regexp.last_match[:bit_id].to_i
compound = request.params['compound'] == '1'
Expand Down
25 changes: 0 additions & 25 deletions lib/diver_down/web/action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -199,31 +199,6 @@ def pid
)
end

# GET /api/global_definition.json
#
# @param bit_id [Integer]
# @param compound [Boolean]
# @param concentrate [Boolean]
# @param only_module [Boolean]
# @param modules [Array<String>]
def global_definition(compound, concentrate, only_module, remove_internal_sources, focus_modules, modules)
definition = @store.combined_definition

# Resolve source aliases
resolved_definition = @source_alias_resolver.resolve(definition)
# Filter sources and dependencies by condition
resolved_definition = DiverDown::Web::DefinitionFilter.new(@metadata, focus_modules:, modules:, remove_internal_sources:).filter(resolved_definition)

render_combined_definition(
([email protected]).to_a,
resolved_definition,
modules,
compound:,
concentrate:,
only_module:
)
end

# GET /api/definitions/:bit_id.json
#
# @param bit_id [Integer]
Expand Down
Loading