Add isHashed to syncer's tableColumn.

This commit is contained in:
Yang Luo 2021-12-19 23:32:42 +08:00
parent 5ee5299a68
commit bf642b35d4
3 changed files with 17 additions and 2 deletions

View File

@ -25,6 +25,7 @@ type TableColumn struct {
Name string `json:"name"`
Type string `json:"type"`
CasdoorName string `json:"casdoorName"`
IsHashed bool `json:"isHashed"`
Values []string `json:"values"`
}

View File

@ -80,7 +80,9 @@ func (syncer *Syncer) calculateHash(user *OriginalUser) string {
values := []string{}
m := syncer.getMapFromOriginalUser(user)
for _, tableColumn := range syncer.TableColumns {
values = append(values, m[tableColumn.Name])
if tableColumn.IsHashed {
values = append(values, m[tableColumn.CasdoorName])
}
}
s := strings.Join(values, "|")

View File

@ -14,7 +14,7 @@
import React from "react";
import {DownOutlined, DeleteOutlined, UpOutlined} from '@ant-design/icons';
import {Button, Col, Input, Row, Select, Table, Tooltip} from 'antd';
import {Button, Col, Input, Row, Select, Switch, Table, Tooltip} from 'antd';
import * as Setting from "./Setting";
import i18next from "i18next";
@ -107,6 +107,18 @@ class SyncerTableColumnTable extends React.Component {
)
}
},
{
title: i18next.t("syncer:Is hashed"),
dataIndex: 'isHashed',
key: 'isHashed',
render: (text, record, index) => {
return (
<Switch checked={text} onChange={checked => {
this.updateField(table, index, 'isHashed', checked);
}} />
)
}
},
{
title: i18next.t("general:Action"),
key: 'action',