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

feat: preferences settings panel to add display switches with copyright #4601

Closed
wants to merge 2 commits into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ exports[`defaultPreferences immutability test > should not modify the config obj
"enable": true,
"icp": "",
"icpLink": "",
"settingShow": true,
},
"footer": {
"enable": false,
Expand Down
1 change: 1 addition & 0 deletions packages/@core/preferences/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const defaultPreferences: Preferences = {
enable: true,
icp: '',
icpLink: '',
settingShow: true,
},
footer: {
enable: false,
Expand Down
2 changes: 2 additions & 0 deletions packages/@core/preferences/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ interface CopyrightPreferences {
icp: string;
/** 备案号链接 */
icpLink: string;
/** 设置面板是否显示*/
settingShow?: boolean;
}

interface FooterPreferences {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import InputItem from '../input-item.vue';
import SwitchItem from '../switch-item.vue';

defineOptions({
name: 'PreferenceBreadcrumbConfig',
name: 'PreferenceCopyrightConfig',
});

const props = defineProps<{ disabled: boolean }>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { $t } from '@vben/locales';
import SwitchItem from '../switch-item.vue';

defineOptions({
name: 'PreferenceBreadcrumbConfig',
name: 'PreferenceFooterConfig',
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Remaining references to 'PreferenceBreadcrumbConfig' detected.

The old component name is still referenced in the following location:

  • packages/effects/layouts/src/widgets/preferences/blocks/layout/breadcrumb.vue:7

Please update this reference to PreferenceFooterConfig to ensure consistency across the codebase.

🔗 Analysis chain

LGTM! Component name updated correctly.

The component name change from 'PreferenceBreadcrumbConfig' to 'PreferenceFooterConfig' improves clarity and consistency with the file name and component's purpose.

To ensure this change doesn't introduce any issues, please verify that all references to this component have been updated throughout the codebase. Run the following script to check for any remaining occurrences of the old component name:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for any remaining references to the old component name 'PreferenceBreadcrumbConfig'

# Test: Search for the old component name. Expect: No results.
rg --type vue --type ts --type js 'PreferenceBreadcrumbConfig'

Length of output: 90


Script:

#!/bin/bash
# Description: Search for any remaining references to the old component name 'PreferenceBreadcrumbConfig'

# Test: Search for the old component name. Expect: No results.
rg -g "*.vue" -g "*.ts" -g "*.js" 'PreferenceBreadcrumbConfig'

Length of output: 178

});

const footerEnable = defineModel<boolean>('footerEnable');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import SelectItem from '../select-item.vue';
import SwitchItem from '../switch-item.vue';

defineOptions({
name: 'PreferenceBreadcrumbConfig',
name: 'PreferenceHeaderConfig',
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Old component name still in use: PreferenceBreadcrumbConfig

The old component name 'PreferenceBreadcrumbConfig' is still used in breadcrumb.vue. Please update this reference to 'PreferenceHeaderConfig' to ensure consistency across the codebase.

🔗 Analysis chain

Approve component name change and verify usage.

The component name change from 'PreferenceBreadcrumbConfig' to 'PreferenceHeaderConfig' is appropriate and aligns with the component's purpose. This change improves clarity and maintainability.

To ensure this change doesn't break any existing imports or usages, please run the following script to check for any occurrences of the old component name:

If the first command returns any results, those files need to be updated to use the new component name.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for any remaining usage of the old component name 'PreferenceBreadcrumbConfig'

# Test: Search for the old component name. Expect: No results.
rg --type vue --type ts --type js 'PreferenceBreadcrumbConfig'

# Test: Search for the new component name. Expect: At least one result (this file).
rg --type vue --type ts --type js 'PreferenceHeaderConfig'

Length of output: 177


Script:

#!/bin/bash
# Description: Search for any remaining usage of the old component name 'PreferenceBreadcrumbConfig'

# Test: Search for the old component name. Expect: No results.
rg 'PreferenceBreadcrumbConfig' -g '*.vue' -g '*.ts' -g '*.js'

# Test: Search for the new component name. Expect: At least one result (this file).
rg 'PreferenceHeaderConfig' -g '*.vue' -g '*.ts' -g '*.js'

Length of output: 345

});

defineProps<{ disabled: boolean }>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import NumberFieldItem from '../number-field-item.vue';
import SwitchItem from '../switch-item.vue';

defineOptions({
name: 'PreferenceBreadcrumbConfig',
name: 'PreferenceSidebarConfig',
});

defineProps<{ disabled: boolean }>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ const navigationAccordion = defineModel<boolean>('navigationAccordion');
const footerEnable = defineModel<boolean>('footerEnable');
const footerFixed = defineModel<boolean>('footerFixed');

const copyrightSettingShow = defineModel<boolean>('copyrightSettingShow');
const copyrightEnable = defineModel<boolean>('copyrightEnable');
const copyrightCompanyName = defineModel<string>('copyrightCompanyName');
const copyrightCompanySiteLink = defineModel<string>(
Expand Down Expand Up @@ -369,7 +370,10 @@ async function handleReset() {
v-model:footer-fixed="footerFixed"
/>
</Block>
<Block :title="$t('preferences.copyright.title')">
<Block
v-if="copyrightSettingShow"
:title="$t('preferences.copyright.title')"
>
<Copyright
v-model:copyright-company-name="copyrightCompanyName"
v-model:copyright-company-site-link="copyrightCompanySiteLink"
Expand Down